Back to Blog
Claude CodeOpenClawMigrationMCPAutomation

Your OpenClaw + Claude Setup Just Broke. Here’s How to Keep Using Opus & Sonnet Without Extra Costs.

A complete guide to migrating from OpenClaw to Claude Code’s native tools — done in one day, using your existing Claude subscription.

April 4, 202610 min read

What Happened on April 4, 2026

Anthropic changed their billing so Claude Pro/Max subscription limits no longer cover third-party tools like OpenClaw. If you were running OpenClaw with Claude, all your cron jobs, Telegram bots, and automations stopped with:

> "Third-party apps now draw from your extra usage, not your plan limits."

Your options now:

  1. Pay extra — opt into Anthropic's pay-as-you-go "extra usage" billing
  2. Switch models — run OpenClaw with Kimi, Llama, or other providers instead of Claude
  3. Go native — use Claude Code (Anthropic's own CLI), which IS covered by your subscription

I went with option 3. By the end of the day, I had everything rebuilt — cron jobs, Telegram bot, browser automation, memory system — all running on Claude Code with my existing Claude subscription. No extra costs.

Here's the complete playbook.

What You're Replacing

FeatureOpenClawClaude Code Native
Cron jobsBuilt-in schedulermacOS launchd + claude --print CLI
Telegram bot (DMs + groups)Built-in channelOfficial Telegram plugin (--channels)
Browser automationPlaywright MCPSame — Playwright MCP works in both
Memory across sessionsWorkspace filesFile-based memory in a git repo
Heartbeat checksHEARTBEAT.mdCron job with --model sonnet (cheaper)
MCP serversBuilt-in config~/.claude.json config
Key point: Claude Code uses the same Opus and Sonnet models, covered by your existing subscription. The claude --print CLI is a first-party tool — Anthropic can't cut it off.

The Architecture

Everything lives in one git repo:

my-business-intelligent/
├── config/env.json           # Machine paths, credentials (gitignored)
├── claude-config/
│   ├── CLAUDE.md             # AI instructions (symlinked to ~/.claude/)
│   └── settings.json         # MCP servers, hooks (symlinked to ~/.claude/)
├── memory/                   # Persistent AI memory (symlinked to ~/.claude/)
├── prompts/                  # Cron job prompts
├── hooks/                    # Safety hooks
├── src/
│   ├── server.ts             # MCP server (11 tools)
│   └── setup.ts              # One command installs everything
└── data/cron-logs/           # Cron output

Config is symlinked into ~/.claude/ so Claude Code reads from the repo. Everything is version-controlled. To move to a new machine: clone the repo, edit one config file, run pnpm run setup.

Step 1: Read Your OpenClaw Config (20 min)

Before building anything, read everything in ~/.openclaw/:

# The important files
cat ~/.openclaw/openclaw.json          # Main config
cat ~/.openclaw/cron/jobs.json         # All your cron jobs + prompts
cat ~/.openclaw/workspace/SOUL.md      # AI personality
cat ~/.openclaw/workspace/TOOLS.md     # Tool notes
cat ~/.openclaw/workspace/TODO.md      # Outstanding tasks
ls  ~/.openclaw/workspace/memory/      # Memory files

Copy down your cron job prompts, Telegram bot token, user ID, and any project paths.

Step 2: Create the Repo (5 min)

mkdir ~/my-business-intelligent && cd $_
git init && pnpm init
pnpm add @modelcontextprotocol/sdk zod
pnpm add -D tsx typescript @types/node

Create config/env.json (gitignored) with your machine-specific paths:

{
  "machine": { "home": "/Users/me" },
  "paths": { "repo": "/Users/me/my-business-intelligent" },
  "projects": { "my_app": "/path/to/app" },
  "telegram": { "bot_token": "YOUR_TOKEN", "owner_chat_id": "YOUR_ID" },
  "git": { "email": "me@example.com", "name": "myuser" }
}

Step 3: Create CLAUDE.md (10 min)

Combine OpenClaw's SOUL.md + USER.md + AGENTS.md + TOOLS.md into one file at claude-config/CLAUDE.md. This loads automatically every session:

# Standing Orders

Who You're Working With

  • Name, business, projects...

Core Rules

  • Your rules from SOUL.md...

Infrastructure

  • Database, APIs, services...

Active Cron Jobs
JobScheduleWhat
| ... | ... | ... |

Symlink it: ln -sf ~/my-business-intelligent/claude-config/CLAUDE.md ~/.claude/CLAUDE.md

Step 4: Migrate Cron Jobs to launchd (30 min)

This is the big one. For each cron job in ~/.openclaw/cron/jobs.json:

  1. Copy the prompt — the payload.message field is the full prompt. Save it to prompts/.md
  2. Update paths — replace ~/.openclaw/workspace/ with your new repo paths
  3. Create a LaunchAgent plist that runs:

claude --print --dangerously-skip-permissions -p "$(cat prompts/<job>.md)"

I automated this with a setup script. Define jobs in TypeScript:

const jobs = [
  { name: 'my-job', label: 'com.mybiz.my-job',
    schedule: { interval: 3600 }, // every hour
    prompt_file: 'prompts/my-job.md',
    timeout: 300 },
];

The script generates plists and installs them into ~/Library/LaunchAgents/. Run pnpm run setup and you're done.

Cost tip: Use --model sonnet for lightweight jobs (heartbeat, memory checks). Sonnet is faster, cheaper, and good enough for "check if things are ok" work. Save Opus for heavy tasks like code generation and SEO building.

Recommended Standard Jobs

JobScheduleModelPurpose
health-checkEvery 1hOpusCheck crons, Chrome, MCP servers. Auto-fix issues.
heartbeatEvery 30mSonnetQuick TODO review, rotate checks, proactive tasks
memory-compactorEvery 6hOpusReview and consolidate memory files

Step 5: Set Up Telegram (15 min)

Claude Code shipped official Telegram support with group @mention detection — this replaces OpenClaw's built-in channel.

# Install bun (required by the plugin)
curl -fsSL https://bun.sh/install | bash

Install plugin deps

cd ~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/telegram bun install

Configure bot token (use your existing token from OpenClaw)

mkdir -p ~/.claude/channels/telegram echo "TELEGRAM_BOT_TOKEN=your-token" > ~/.claude/channels/telegram/.env

Add to settings.json: "enabledPlugins": { "telegram@claude-plugins-official": true }

Make it default with an alias in ~/.zshrc:

alias claude="$HOME/.local/bin/claude --dangerously-skip-permissions --channels plugin:telegram@claude-plugins-official"

Important: Stop the OpenClaw gateway first — it will steal your bot's messages:

launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist

For group mentions: Disable privacy mode via @BotFather (/setprivacy then Disable), then add the group ID to access.json.

Step 6: Build an MCP Server (30 min)

Give Claude Code tools to manage itself. Create src/server.ts with:

  • Memory tools — list, read, write, search memory files
  • Cron tools — list jobs, read logs, trigger runs
  • Project tools — git status across repos
  • Telegram — send messages via bot
  • Config — read config values (with denylist for secrets)

11 tools total. Claude can now check on itself, send you alerts, and manage its own memory.

Step 7: Symlink Everything (2 min)

ln -sf ~/my-business-intelligent/claude-config/CLAUDE.md ~/.claude/CLAUDE.md
ln -sf ~/my-business-intelligent/claude-config/settings.json ~/.claude/settings.json
ln -sf ~/my-business-intelligent/memory ~/.claude/memory/repo

The setup script does this automatically.

Step 8: Security (10 min)

Add a pre-commit hook that scans for secrets (API keys, tokens, DB passwords, private keys). Add PreToolUse hooks that block git --no-verify and protect linter configs from modification. Gitignore your config/env.json, .env files, and generated plists.

If you committed secrets during setup (easy to do), scrub them:

brew install git-filter-repo
git filter-repo --replace-text <(echo "your-secret==>REDACTED")
git push --force

Step 9: Stop OpenClaw (1 min)

launchctl bootout gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.gateway.plist

Keep ~/.openclaw/workspace/ as a read-only archive — you may need to reference old configs or docs. Keep the chrome-debug LaunchAgent if you use Playwright.

Step 10: Verify

launchctl list | grep com.mybiz    # All crons loaded?
claude --version                    # CLI works?
curl -s http://127.0.0.1:9222/json/version  # Chrome CDP alive?

Send a test Telegram DM to your bot. Trigger a health check cron. Check that memory loads on a fresh session.

The Bonus: It's Actually Better Now

Once I finished the migration, I realized the new setup has real advantages I didn't have with OpenClaw:

Portability. One git repo. Clone to a new machine, edit one JSON file, run setup. With OpenClaw, migration meant reinstalling the framework, running onboard, reconfiguring browser profiles, re-pairing Telegram.

Version control. Every config change is a git commit. With OpenClaw, config lived in a sprawl of JSON files, SQLite databases, and binary blobs — no history, no review.

Cost control. I can use Sonnet for lightweight crons and Opus for heavy work. With OpenClaw, the gateway burned tokens just to stay alive — heartbeat polling, context maintenance, session state.

No single point of failure. Each cron job is an independent launchd invocation. If one fails, the others keep running. OpenClaw's gateway was one process — when it crashed, everything went down.

You own it. No framework updates breaking your setup. No middleman getting cut off by a provider. No malicious skills from a community marketplace. Every line of code is yours.

Common Gotchas

  1. MCP servers go in ~/.claude.json, not settings.json — Claude Code reads MCP config from .claude.json
  2. Use absolute paths for MCP server scripts — cwd is not reliably honored
  3. pnpm strict hoisting breaks node --import tsx/esm — use npx tsx instead
  4. --print mode can't write to ~/.claude/memory/ — keep memory in your repo
  5. OpenClaw gateway steals your Telegram bot if still running — stop it first
  6. Hook type must be "command" not "intercept"
  7. Shell alias needs full binary pathalias claude="$HOME/.local/bin/claude ..."
  8. MCP env vars set at spawn time — add env field to config, not .env file
  9. enabledPlugins must include "telegram@claude-plugins-official": true

Open Source Migration Skill

I turned this entire process into a reusable skill prompt (300 lines, 11 phases). Give it to any Claude Code agent on a machine with OpenClaw and it'll follow the same playbook:

github.com/HongmingWang-Rabbit/skill-migrate-openclaw-to-cc