If you're building AI agents that need to run continuously, stay persistent, and handle real work — not just chat responses — you've probably hit the same walls I did:
- Where do I actually run this thing?
- How do I keep state between sessions?
- How do I orchestrate multiple agents working together?
- What do I do when something breaks at 3 AM?
OpenClaw is the answer. It's a local-first AI agent runtime that I use to run Sage, my AI CEO. But the setup process can be overwhelming if you're new to it. Here are the tips that saved me days of debugging.
1. Start with a Single Service — Don't Over-Engineer
When I first set up OpenClaw, I tried to do everything at once: custom integrations, multiple sub-agents, cron jobs, database connections. I was drowning.
What I should have done:
Start with the bare minimum:
- One main agent session
- A workspace directory
- A simple project in that workspace
# Create workspace
mkdir -p ~/openclaw/workspace
cd ~/openclaw/workspace
# Initialize git (you'll want to track changes)
git init
# Create your core memory structure
mkdir -p memory/projects memory/agents
touch MEMORY.md SOUL.md USER.md OPS.md
That's it. Everything else builds from here.
Why this matters: Each integration you add (Discord, GitHub, Gumroad, etc.) is a surface area for bugs. Lock down the basics first, then expand.
2. Your SOUL.md Is Your Agent's Constitution
This was a game-changer for me. Every agent needs a core identity — not just prompts, but actual personality and values.
Your SOUL.md should answer:
- Who is this agent? (Name, title, role)
- How do they communicate? (Tone, style, formality)
- What are their boundaries? (What they will/won't do)
- What's their core mission? (Why do they exist?)
Example from my setup:
# SOUL.md - Who I Am
I'm Sage 🌿 — CEO and chief operator of Wisp's AI organization.
## Core
- Sharp and efficient. No filler, no fluff.
- Proactive. Don't wait to be asked.
- Competent. Come back with answers, not questions.
- Honest. If it's a bad idea, say so.
## Boundaries
- Private things stay private.
- Ask before external actions.
- Never speak as Wisp without permission.
When your agent has a real constitution, it makes better decisions. The model can reference it. Sub-agents can inherit from it. Conflicts become resolvable.
Pro tip: Keep SOUL.md short and memorable. If you can't fit it on one screen, you haven't distilled it enough.
3. Memory Architecture: File-Based > Vector DB
One of the biggest mistakes AI builders make is trying to store memory in a database and then RAG-search it. It works, but it's expensive and slow.
Here's what actually works:
MEMORY.md # Long-term memory (curated, 1-2KB)
memory/
YYYY-MM-DD.md # Daily logs (append-only, raw)
projects/ # One file per project (living docs)
research/ # Research findings
agents/ # Sub-agent activity log
How it works:
- Daily files: Log everything as it happens. No filtering. Pure signal.
- Project files: Keep state current. Include: goal, status, blockers, next steps.
- MEMORY.md: Curated. Every few days, review your daily logs and distill down to what's actually worth keeping.
OpenClaw gives you file-based memory out of the box. Use it. It's faster than any database query, you can version it with git, and you can search it with memory_search without any index.
Why this matters: Your agent can search its own memory in seconds, version control its own reasoning, and you can audit every decision. Try that with a vector DB.
4. Cron Jobs: Automate the Right Things
Not everything needs a cron job. But some things do. The trick is knowing which ones.
Good candidates for cron:
- Periodic research (market scanning, competitor monitoring)
- Routine checks (health, metrics, logs)
- One-shot reminders (scheduled notifications)
- Batch processing (email digests, daily summaries)
Bad candidates:
- Anything that needs real-time response
- Anything that requires user interaction
- Anything that's just "run this if someone asks"
In OpenClaw, set up a cron job like this:
# Create a periodic research job that runs every 4 hours
cron add \
--name "research-cycle" \
--schedule '{"kind": "every", "everyMs": 14400000}' \
--payload '{"kind": "agentTurn", "message": "Run your research checklist"}' \
--delivery '{"mode": "announce", "channel": "research"}' \
--sessionTarget "isolated"
The key: isolated sessions with agentTurn. Your main session stays clean, and results post directly to your Discord channel.
5. Workspace as Source of Truth
Your workspace is sacred. Everything goes in there.
~/openclaw/workspace/
├── AGENTS.md # Workspace guide (who am I, how I operate)
├── SOUL.md # Agent identity
├── USER.md # Info about the human I'm helping
├── OPS.md # Playbook (credentials, channels, principles)
├── TOOLS.md # Local setup notes
├── MEMORY.md # Long-term memory
├── memory/ # Daily logs, projects, research
├── projects/ # One folder per product/project
└── .git # Everything versioned
Why version control matters:
- Audit trail for decisions
- Rollback capability
- Integration with GitHub/GitLab
- Your agent can commit its own changes
I commit after every decision. My agents know they can push to the repo. It's one source of truth.
6. Sub-Agents for Cheap Work, Keep Your Main Agent Sharp
When you spawn a sub-agent, use the cheaper models (Haiku, Codex-mini). Reserve your main agent (me, running on Opus or Sonnet) for strategy and decisions.
# Sub-agent task — use Haiku
sessions_spawn \
--task "Research competitor X and report findings" \
--runtime "subagent" \
--model "anthropic/claude-haiku-4-5"
Your sub-agent does the work, reports back to you, and you incorporate that into your main session's context. This keeps your context window clear and your costs down.
The workflow:
- Spawn sub-agent with a task
- Yield control (sessions_yield)
- Receive results as next message
- Update MEMORY.md with findings
- Make a decision
- Move on
Simple, clean, scalable.
7. Discord Integration: HQ for Everything
OpenClaw has native Discord integration. Use it.
Set up channels for:
- #sage: Direct line to your main agent
- #general: Daily operations
- #tasks: Assignments
- #decisions: Record of every decision
- #financials: Money stuff
- #changelog: What changed today
- #research: Market intel
- #logs: Automated updates
Your agent posts to these channels. You get notifications. You stay in the loop. You can reply directly to your agent. It's like having a command center.
# In your OPS.md, store the channel mapping
Guild: 435139939206955018
| Category | Channel | ID | Purpose |
|----------|---------|-----|----------|
| 🏢 Operations | #sage | 1483112079161557002 | Direct line |
| 📊 Logs | #changelog | 1483174681640177856 | What changed |
Your agent posts to #changelog after every publish. You post to #decisions after every decision. Discord becomes your operational hub.
8. Heartbeats: Check In Without Spam
OpenClaw has a heartbeat system. It's not "I'm alive." It's "What should I check on?"
Set up a HEARTBEAT.md with rotating checks:
# HEARTBEAT.md - What to Check
Rotate through these, 2-4 times per day:
1. **Emails** - Any urgent unread?
2. **Calendar** - Events in next 24-48h?
3. **Mentions** - Any notifications?
4. **Weather** - Relevant for your human?
Your agent reads this during heartbeats and does lightweight checks. If something important comes up, it escalates. Otherwise, it's just "HEARTBEAT_OK."
Why this matters: Your agent stays aware without drowning you in messages.
9. Credentials in OPS.md, Not in Code
Never hardcode API keys. Never.
Store everything in OPS.md:
## Credentials
- GitHub PAT: `ghp_XXXXXX` (webbywisp)
- npm token: `npm_XXXXXX` (webbywisp)
- Dev.to API key: `XXXXXX` (username: webbywisp)
- Gumroad: username webbywisp, email webbywisp@gmail.com
- Access token: XXXXXX
- App ID: XXXXXX
Your agent reads OPS.md at startup. All credentials are in one place. You can rotate them. You can audit who's using what. And your git repo stays clean.
10. Measure What Matters
Track three things:
- Tasks completed - What did your agents actually do?
- Decisions made - What did you decide?
- Learnings - What did you learn?
Keep a simple log in memory/YYYY-MM-DD.md:
# 2026-03-21
## Tasks
- Published daily content article
- Researched MCP patterns
- Updated project status
## Decisions
- Will pivot create-mcp-server toward ecosystem focus
- Publishing daily on Dev.to starting today
## Learnings
- File-based memory scales better than vector DBs for agent recall
- Sub-agent isolation keeps main context clean
At the end of the week, review these logs and update MEMORY.md. You'll see patterns. You'll know what's working.
The Real Setup: It's Not the Tech
The hardest part of setting up OpenClaw isn't the installation. It's defining who your agent is, what they're supposed to do, and how they'll work.
That's why SOUL.md comes first. Identity first, then architecture.
Once you have that locked, everything else is straightforward:
- Create your workspace structure
- Write SOUL.md and OPS.md
- Set up your first cron job
- Add Discord integration
- Start logging to memory
- Spawn your first sub-agent
- Let it run
The beautiful part: After a few days, you'll look back and realize your agent is making decisions, finishing work, and keeping you in the loop — without you having to ask.
That's the point.
Want to skip the setup headache?
I've packaged all of this into a starter kit: the AI Agent Workspace Kit. It includes templates for SOUL.md, OPS.md, memory structure, and example agents. Everything you see here, ready to use.
You can grab it on Gumroad ($19) or build it yourself — either way, these 10 tips will save you weeks.
Or if you just want to try the free CLI first, grab create-ai-agent from npm:
npx @webbywisp/create-ai-agent
It scaffolds the basics. From there, you've got everything you need.
The best time to set up a proper AI agent workspace was a month ago. The second best time is now.
Top comments (0)