Back to blog

April 8, 2026

Migration Guide

How to Migrate from OpenClaw to Claude Code (Complete Guide)

We ran OpenClaw as our production agent for months. Then we switched to Claude Code -- and rebuilt everything: the identity file, the memory system, the MCP wiring, the scheduled automation. This is the guide we wished existed when we did it.

Why We Migrated (And Why You Might Want To)

OpenClaw was not broken. It was good software that did exactly what it said it would. Our reasons for switching were less about frustration and more about ceiling -- we kept hitting things Claude Code made possible that OpenClaw did not.

Native Anthropic integration

Claude Code talks directly to Anthropic's model stack. No API key juggling, no middleman config, no worrying about whether you're hitting the right endpoint. You authenticate once and every model -- Sonnet, Opus, Haiku -- is available without additional setup.

Hooks are more powerful than heartbeats

OpenClaw heartbeats are time-based triggers. Claude Code hooks fire on events -- file changes, tool completions, errors, user input. You can build reactive workflows that respond to what actually happens, not just clock ticks.

Worktree-isolated subagents

Claude Code can spawn subagents in separate git worktrees -- meaning parallel agents that each have their own isolated filesystem view. Running two tasks in parallel without them stomping on each other's file changes is clean and built-in.

IDE integrations

VS Code and JetBrains extensions give Claude Code real-time context about your open files and editor state. OpenClaw can read files too, but not with the same editor-aware latency. If you do any coding work, this alone is worth the switch.

Skills ecosystem growing fast

Claude Code's skills system (think: reusable agent behaviors you can install and invoke by name) is expanding quickly. OpenClaw had a smaller, more DIY ecosystem. This gap will only widen.

OpenClaw to Claude Code: Concept Mapping

The mental models are similar. Most OpenClaw concepts have a direct Claude Code equivalent. Here is the full mapping so you know what you're translating before you start.

OpenClawClaude Code equivalentNotes
SOUL.md / AGENTS.mdCLAUDE.mdSame Markdown format, same purpose -- different filename
HeartbeatsHooks + launchd/cronHooks are event-driven, not just time-based
Knowledge graph memoryFile-based memory systemMarkdown files in a memory/ dir, referenced from CLAUDE.md
Daily notesMEMORY.md / dated log filesSame concept, flat files instead of a graph
Skills (OpenClaw)Skills (Claude Code)Different format, same idea -- reusable agent behaviors
MCP serversMCP serversSame protocol, config moves to .claude/settings.json
Tool integrationTool use (built-in)Claude Code has more built-in tools out of the box
Multi-agent / sub-agentsAgent tool + worktreesClaude Code subagents support file-system isolation
Browser automationSame patternsAppleScript + Chrome JS injection works identically
openclaw.json.claude/settings.jsonDifferent file, same role -- central agent config

The complete playbook

We wrote the guide we wish existed when we switched. Memory architecture, hooks, subagents, worktrees, MCP wiring -- the full Claude Code production stack.

This post covers the migration path. The guide covers everything you need to run Claude Code at production quality from day one.

Get the KaiShips Guide to Claude Code -- $29

Step-by-Step Migration

We ran this migration on a production setup with a full SOUL.md, a file-based memory system, eight MCP servers, and launchd-driven heartbeats. The steps below are the exact sequence we followed.

1

Install Claude Code

Claude Code is distributed as an npm package. Install it globally and authenticate with your Anthropic account.

npm install -g @anthropic-ai/claude-code

# Authenticate (opens browser for OAuth)
claude login

# Verify
claude --version

If you have an Anthropic Pro or Max subscription, you get model access through that subscription. No separate API key needed for interactive use. For non-interactive/cron runs, you'll use an API key -- set ANTHROPIC_API_KEY in your environment.

2

Convert SOUL.md / AGENTS.md to CLAUDE.md

CLAUDE.md is the direct equivalent of SOUL.md or AGENTS.md. The format is plain Markdown. The content -- agent identity, rules, context, behavior guidelines -- maps over almost line-for-line.

The main things to update:

  • --Remove OpenClaw-specific syntax (heartbeat schedules, tool allowlist format, any @openclaw directives)
  • --Update memory file references to point at your new memory/ directory
  • --Replace heartbeat duty lists with a "scheduled triggers" section that documents what your cron jobs do
  • --Keep everything else -- identity, rules, tone, mission, red lines all carry over verbatim

Place CLAUDE.md at ~/.claude/CLAUDE.md for global agent instructions (applies everywhere) or at the root of a specific project for project-scoped instructions. We use both: a global file for identity and a project-level file for project-specific context.

3

Migrate Memory Files

OpenClaw's knowledge graph stores entities and relationships in a structured database. Claude Code uses flat Markdown files. The migration is not automatic -- you'll need to export and restructure.

Our recommended structure:

~/.claude/
  CLAUDE.md           # global agent instructions
  projects/
    <project-name>/
      memory/
        MEMORY.md       # index / table of contents
        projects.md     # active projects + status
        people.md       # contacts, collaborators
        decisions.md    # important decisions + context
        learnings.md    # lessons, patterns, gotchas
        daily/
          2026-04-08.md # daily activity logs

MEMORY.md acts as the index -- it lists every memory file and what's in it, so the agent can find what it needs without reading every file on every call. Reference MEMORY.md from CLAUDE.md so the agent knows the memory system exists.

4

Re-wire MCP Servers

MCP servers themselves do not change. The only thing that changes is the config location. In OpenClaw, MCP servers lived in ~/.openclaw/openclaw.json. In Claude Code, they go in ~/.claude/settings.json.

The format is nearly identical:

// ~/.claude/settings.json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
      }
    },
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/you/projects"
      ]
    },
    "discord": {
      "command": "npx",
      "args": ["-y", "mcp-discord"],
      "env": {
        "DISCORD_TOKEN": "${DISCORD_BOT_TOKEN}"
      }
    }
  }
}

You can also add MCP servers via the CLI:

# Add a server via CLI
claude mcp add github -- npx -y @modelcontextprotocol/server-github

# List connected servers
claude mcp list

# Verify a server is responding
claude mcp get github
5

Set Up Hooks to Replace Heartbeats

OpenClaw heartbeats are scheduled triggers -- run this prompt every N minutes. Claude Code hooks are the same idea but more flexible. You configure hooks in settings.json and drive them with launchd (macOS) or cron.

A basic launchd plist for a 15-minute heartbeat:

<!-- ~/Library/LaunchAgents/com.kaiships.heartbeat.plist -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
  "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>Label</key>
  <string>com.kaiships.heartbeat</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/claude</string>
    <string>--print</string>
    <string>--dangerously-skip-permissions</string>
    <string>Run your scheduled heartbeat duties.</string>
  </array>
  <key>StartInterval</key>
  <integer>900</integer>
  <key>StandardOutPath</key>
  <string>/tmp/kai-heartbeat.log</string>
  <key>StandardErrorPath</key>
  <string>/tmp/kai-heartbeat-err.log</string>
  <key>EnvironmentVariables</key>
  <dict>
    <key>ANTHROPIC_API_KEY</key>
    <string>your-key-here</string>
  </dict>
</dict>
</plist>
# Load the job
launchctl load ~/Library/LaunchAgents/com.kaiships.heartbeat.plist

# Run it once manually to test
launchctl start com.kaiships.heartbeat

# Check the log
tail -f /tmp/kai-heartbeat.log

Hooks in settings.json add event-driven triggers on top of the time-based ones -- for example, running a validation script after every file write, or sending a notification when the agent completes a task. This is where Claude Code genuinely goes beyond what OpenClaw offered.

6

Test Everything

Before letting any automation run unsupervised, test the full stack interactively:

  • --Open Claude Code interactively and verify it reads CLAUDE.md correctly (ask it to summarize its own identity)
  • --Test each MCP server by asking for a tool call (e.g. "list my GitHub repos")
  • --Verify memory file reads (ask the agent what projects you're working on -- it should read the memory files)
  • --Trigger a scheduled run manually with launchctl start and review the log
  • --Run two sessions in parallel to make sure they don't conflict on shared files

What's Genuinely Better in Claude Code

After running both systems in production, here is an honest assessment of where Claude Code wins.

Model access

One subscription, every model, no config. Switching between Sonnet for speed and Opus for reasoning is a single flag, not a config change and restart.

Hooks system

Event-driven triggers fire on tool use, file changes, errors, and task completion. OpenClaw heartbeats were fire-and-forget cron jobs. Hooks are reactive.

Worktree isolation

Parallel subagents in separate worktrees means zero file conflicts. Running three tasks simultaneously without coordination overhead is something OpenClaw could not do cleanly.

IDE integrations

VS Code and JetBrains extensions mean the agent knows what file you have open, what's selected, what errors exist in the current file. Coding workflows are materially faster.

CLAUDE.md scoping

Global + project-level + directory-level instruction files mean you can have different agent behavior per project without duplicating your global config. OpenClaw had one config.

Skills ecosystem

Installable, reusable agent behaviors are growing fast. Complex workflows that used to require custom scripting can often be replaced with a skill invocation.

The complete playbook

We wrote the guide we wish existed when we switched. Memory architecture, hooks, subagents, worktrees, MCP wiring -- the full Claude Code production stack.

This post covers the migration path. The guide covers everything you need to run Claude Code at production quality from day one.

Get the KaiShips Guide to Claude Code -- $29

What You Might Miss from OpenClaw (Honest)

This is not a sales pitch. Some things in OpenClaw were genuinely good and the transition involves real tradeoffs.

Knowledge graph memory

OpenClaw's graph-based memory could model relationships between entities -- people, projects, decisions, events -- and traverse them automatically. Flat Markdown files are simpler and more portable, but you lose automatic relationship discovery. For complex organizational knowledge, this is a real downgrade.

Community resources

OpenClaw had a well-established community, subreddit, and a large library of community SOUL.md templates. The Claude Code community is growing but the institutional knowledge is younger. Expect to figure out more things yourself, at least for now.

Heartbeat simplicity

OpenClaw heartbeats were simple to configure -- just a schedule and a prompt in your config file. The launchd + Claude Code CLI pattern gets you the same result but requires more setup. It is more powerful but less beginner-friendly.

Model agnosticism

OpenClaw could route to any model -- OpenAI, Gemini, local Ollama, Anthropic. Claude Code is Anthropic-native. If your workflow required mixing models from different providers, you will need to either switch or maintain a second setup for non-Anthropic workloads.

Frequently Asked Questions

Is Claude Code a direct replacement for OpenClaw?
Mostly yes, with some differences. Claude Code covers everything OpenClaw does -- agent instructions, memory, MCP servers, scheduled automation, multi-agent workflows -- but the mental model differs. OpenClaw was designed as a standalone agent shell. Claude Code is deeper integrated with your IDE and the Anthropic model stack. If you ran OpenClaw as a coding + ops agent, Claude Code is a strong replacement and often an upgrade.
Do I have to rewrite my SOUL.md or AGENTS.md from scratch?
No. The rename is mostly mechanical -- SOUL.md becomes CLAUDE.md, the format stays Markdown, and the content structure (who the agent is, what it does, what rules it follows) maps over directly. The main thing to update is tool references and any OpenClaw-specific syntax. A full SOUL.md rewrite typically takes 30-60 minutes.
Will my MCP servers still work in Claude Code?
Yes. MCP is the same protocol on both sides. The config format is slightly different (Claude Code uses .claude/settings.json instead of openclaw.json) but the servers themselves do not change. Copy your server definitions over, update the config location, and they work.
What happens to my OpenClaw memory (knowledge graph, daily notes)?
Claude Code uses a file-based memory system rather than a graph database. You convert OpenClaw memory entries into Markdown files (one file per topic or domain). This is actually easier to edit, version-control, and audit. The tradeoff is that you lose graph traversal -- there is no automatic relationship mapping. For most setups, flat Markdown files work just as well.
Can I run Claude Code on a cron schedule like OpenClaw heartbeats?
Yes. Claude Code has a hooks system that can be triggered by external events, and you can drive it with launchd (macOS) or cron on Linux. The pattern is: scheduled trigger fires, calls the Claude Code CLI with a prompt, Claude Code executes and logs results. This is essentially identical to OpenClaw heartbeats.
Does Claude Code support subagents like OpenClaw?
Yes, and the subagent system is more capable. Claude Code's Agent tool lets you spawn isolated subagents with their own working directories and context. Worktrees give each subagent file-system isolation. You can run multiple subagents in parallel -- something that required significant setup in OpenClaw.
How long does the full migration take?
For a typical OpenClaw setup (SOUL.md + memory files + 5-10 MCP servers + heartbeat automation), expect 2-4 hours for the migration itself and another few hours of testing and tuning. If you have custom OpenClaw skills or hooks, add time to port those. The hardest part is usually the memory re-architecture, not the tooling.

The complete playbook

We wrote the guide we wish existed when we switched. Memory architecture, hooks, subagents, worktrees, MCP wiring -- the full Claude Code production stack.

This post covers the migration path. The guide covers everything you need to run Claude Code at production quality from day one.

Get the KaiShips Guide to Claude Code -- $29