AgentStack
MCP unreviewed MIT Self-run

ClawCode

mcp-crisandrews-clawcode · by crisandrews

Persistent agents for Claude Code as a plugin, not a harness. Memory, personality, messaging across WhatsApp, Telegram, and Discord, plus a service mode for 24/7 runs. Imports from OpenClaw.

No reviews yet
0 installs
17 views
0.0% view→install

Install

$ agentstack add mcp-crisandrews-clawcode

Open-source listing — not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures
  • high Destructive filesystem operation.

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of ClawCode? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

ClawCode

Turn Claude Code into a persistent agent — memory, personality, voice, messaging, and more.

Quick Setup · Why · Features · Skills · Going further · Troubleshooting · Issues


[What this is](#what-this-is)

ClawCode is a plugin for Claude Code. Install it and Claude Code remembers you between sessions: your name, the agent's own name and personality, the notes you and the agent wrote together last week. It adds memory with bilingual recall (Spanish ↔ English), messaging through WhatsApp, Telegram, Discord, iMessage and Slack, a browser chat, nightly memory consolidation, and a background service for 24/7 runs. Everything lives inside Claude Code's plugin system.

The agent remembers your dog's name, warns about allergies before suggesting food, and answers in 1 to 2 lines instead of paragraphs.

[Why it exists](#why-it-exists)

Claude Code is stateless by default. Open a new session and the agent starts from zero: no memory of what you were working on yesterday, no name, no feel for who it is. Good agents should not do that. That gap is what ClawCode fills.

There are roughly two ways to build persistence on top of Claude. One is a harness: a separate runtime that wraps Claude's API with its own session, memory, and tool layer. OpenClaw is one example. Harnesses run on Claude's API directly; as of April 2026 they can no longer draw from a Claude subscription, so users need to pay for API usage separately.

ClawCode takes the other route. It extends Claude Code from inside as a plugin, so there's no separate runtime and no separate billing. A ClawCode user is just a Claude Code user with an extra layer on top. ClawCode inherits what Claude Code already does well (its harness, tool system, skills, hooks, MCP plumbing) and adds only what a persistent agent needs.

Coming from OpenClaw? /agent:import brings your agent's personality, memory, skills, and crons across.

[Highlights](#highlights)

  • [Persistent identity](#how-it-works) — name, personality, emoji. The agent wakes up as itself on every session via lifecycle hooks that inject SOUL.md + IDENTITY.md at startup.
  • [Messaging channels](#messaging-channels) — WhatsApp, Telegram, Discord, iMessage, Slack via MCP plugins. Same agent, every channel, no conflicts.
  • [Active memory](#memory) — bilingual recall (ES ↔ EN) at the start of every turn. Ask "cómo se llama mi perro?" and it finds "Cookie" from English notes. Warns about allergies before suggesting food.
  • [Lifecycle hooks](#hooks) — SessionStart injects identity + auto-creates crons. PreCompact flushes memory before context compression. Stop writes session summaries. SessionEnd tracks dream events.
  • [Dreaming](#dreaming) — nightly 3-phase consolidation (Light → REM → Deep) with 6 weighted signals. Promotes important memories to long-term storage.
  • [Language adaptation](#how-it-works) — detects the user's language and responds in kind. Switch mid-conversation and the agent switches too. Commands, status cards, and errors all adapt.
  • [Voice](#voice) — TTS via sag, ElevenLabs, OpenAI, macOS say. STT via local Whisper or OpenAI API.
  • [WebChat](#webchat) — browser chat UI with SSE real-time delivery. Conversation logs in JSONL + Markdown (same format as WhatsApp).
  • [Slash commands everywhere](#messaging-channels)/status, /help, /whoami, /new, /compact work from CLI, WhatsApp, Telegram, Discord — same commands, formatting adapts per platform.
  • [Smart import from OpenClaw](#importing-agents) — 3-tier classifier (GREEN/YELLOW/RED) for skills and crons. Step-by-step wizard with clickable options. Skipped items go to a backlog with recovery notes.
  • [Community skills](#community-skills) — install from GitHub with owner/repo@branch#subdir. OS + dependency validation.
  • [Always-on](#always-on-service) — launchd / systemd service. Enables dreaming + heartbeat 24/7.
  • [Webhooks](#webhooks) — external systems (Cloudflare Workers, GitHub Actions, CI/CD, IoT) can POST events to the agent via HTTP. The agent processes them like any other message.
  • [Channel scope](#channel-scope) — opt-in per-channel privacy layer. When you pair WhatsApp, you can choose: agent acts as owner (sees all chats), guest (sees nothing channel-derived), or auto (owner-only ceiling). Default is off — zero behavior change for users who don't opt in.
  • [Execution gate](#channel-scope) — opt-in guardrail (companion to channel scope). When the current Claude Code turn was triggered by a non-owner message in a paired group chat, blocks destructive tools (Bash, Write, Edit, Task, and more) per a denylist/allowlist policy. Always-on protected paths fire even with the gate off — agent cannot self-modify hooks, agent-config, SSH/credential dirs, shell init, or persistence mechanisms. Default off.
  • [Doctor](#diagnostics) — 9+ health checks (config, identity, memory, SQLite, QMD, bootstrap, HTTP, messaging, dreaming, scope). --fix auto-repairs safe issues.
  • [Terse by design](#how-it-works) — the agent acts, doesn't narrate. Confirmations in 1-2 lines, no preambles, no recaps.

[Prerequisites](#prerequisites)

  • Node.js v18+
  • Windows: Claude Code must be run from inside [WSL2](docs/wsl2.md) (not native PowerShell / cmd).

[Quick Setup](#quick-setup)

1. Create a folder for your agent.

Each agent lives in its own folder. Create one and open Claude Code there:

mkdir ~/my-agent && cd ~/my-agent
claude

2. Install the plugin.

Inside Claude Code, add Anthropic's official community marketplace:

/plugin marketplace add anthropics/claude-plugins-community

Then install the plugin:

/plugin install clawcode@claude-community

When prompted for scope, select "Install for you, in this repo only (local scope)" — this keeps the agent isolated to this folder.

Then reload plugins so the skills become available:

/reload-plugins

> Bleeding-edge alternative. The community marketplace syncs nightly from Anthropic's review pipeline, so brand-new fixes can take up to ~24h to land. If you want the absolute latest commit, install from this repo's marketplace instead — same plugin, different identifier. Run them one at a time: > > `` > /plugin marketplace add crisandrews/ClawCode > ` > > ` > /plugin install agent@clawcode > ``

3. Create your agent:

/agent:create

This starts the bootstrap ritual — a casual conversation where the agent discovers its name, personality, and emoji. You can also import an existing agent instead:

/agent:import

4. Reload to apply the personality:

/mcp

The agent now wakes up with its identity on every session.

[How it works](#how-it-works)

ClawCode injects personality and behavior at four points in the session lifecycle:

| Hook | When | What happens | | --- | --- | --- | | SessionStart | Session opens | Reads SOUL.md + IDENTITY.md + USER.md and injects them as context. Checks if heartbeat + dreaming crons exist — creates them if missing. | | PreCompact | Context getting full | Reminds agent to save important facts to memory/YYYY-MM-DD.md before compression erases them. | | Stop | Session closing | Reminds agent to write a session summary (what was discussed, decisions, open items). | | SessionEnd | Session closed | Logs a session.end event for the dreaming system. |

This means:

  • Every session starts with personality — the agent never says "I'm Claude." It knows its name, vibe, and your info.
  • Memory survives compaction — PreCompact flushes facts before they're lost.
  • Sessions are summarized — the next session knows what happened in the last one.
  • Dreaming tracks sessions — knows when you were active, when you paused.

The agent also detects your language from each message and responds in kind. Switch from Spanish to English mid-conversation — the agent switches too. Status cards, error messages, and commands all adapt.

Full details: [docs/hooks.md](docs/hooks.md)

[Features](#features)

[Memory](#memory)

The agent writes to memory/YYYY-MM-DD.md during sessions and searches it automatically at the start of every turn — no need to say "search memory." Bilingual (Spanish ↔ English, 40+ synonym pairs), date-aware ("hoy" resolves to today's date), and safety-critical (warns about allergies before suggesting food). Trivial messages (greetings, "ok", slash commands) skip the search — no wasted context.

Two backends: builtin (SQLite + FTS5, works out of the box) and QMD (local embeddings for semantic search — install with bun install -g qmd).

Full details: [docs/memory.md](docs/memory.md) · [docs/memory-context.md](docs/memory-context.md) · [docs/qmd.md](docs/qmd.md)

[Dreaming](#dreaming)

Nightly cron (3 AM) runs 3-phase memory consolidation:

  • Light — ingests recall signals from the day, deduplicates candidates
  • REM — extracts recurring themes, identifies multi-day patterns, writes reflections to DREAMS.md
  • Deep — ranks candidates with 6 weighted signals (relevance 0.30, frequency 0.24, query diversity 0.15, recency 0.15, consolidation 0.10, conceptual richness 0.06) and promotes winners to memory/MEMORY.md

Run manually: dream(action='run') or preview with dream(action='dry-run').

Full details: [docs/dreaming.md](docs/dreaming.md)

[Voice](#voice)

TTS via sag, ElevenLabs, OpenAI, or macOS say. STT via local Whisper or OpenAI Whisper API. The agent auto-selects the best available backend. Enable with agent_config(action='set', key='voice.enabled', value='true').

Full details: [docs/voice.md](docs/voice.md)

[WebChat](#webchat)

Browser-based chat UI with real-time SSE delivery. Enable the HTTP bridge, open http://localhost:18790. Dark/light mode, conversation logging in JSONL + Markdown (same format as WhatsApp plugin).

agent_config(action='set', key='http.enabled', value='true')
/mcp

Every browser tab gets its own sessionId (UUID v4, persisted in localStorage) that partitions per-session chat history and live agent replies — two browsers sharing the same http.token cannot read each other's conversations. sessionId is a privacy partition; http.token remains the auth boundary.

Full details: [docs/webchat.md](docs/webchat.md) · [docs/http-bridge.md](docs/http-bridge.md)

[Messaging channels](#messaging-channels)

Reach your agent from WhatsApp, Telegram, Discord, iMessage, or Slack. Each messaging plugin is an independent MCP server — no conflicts with ClawCode.

/agent:messaging

Slash commands work from any channel — /status, /help, /whoami, /new, /compact all respond whether the user is in the CLI terminal or chatting via WhatsApp. Formatting adapts automatically (*bold* for WhatsApp, **bold** for Telegram, standard markdown for CLI).

Full details: [docs/channels.md](docs/channels.md)

[Channel scope](#channel-scope)

When the agent indexes messaging-channel logs into its memory (WhatsApp via claude-whatsapp), it can apply per-channel scope filtering so the agent only sees what the operator is allowed to see — mirroring the upstream plugin's own access governance.

Default is off. Users who don't opt in see no behavior change.

To opt in:

/agent:scope wizard

The wizard walks through: which channel, mode (shadow = log only, enforce = filter), and identity (owner = sees all, guest = sees nothing channel-derived, auto = owner-only ceiling). owner mode requires an out-of-band trust file you create via Bash — the agent cannot grant itself owner privileges.

Important caveats:

  • MCP scope is not a filesystem sandbox. Native Read, Grep, or direct SQLite over channel log files always bypass the scope filter by design. Hard isolation lives at the OS/filesystem layer.
  • The filter covers MCP tools (memory_search, memory_get, memory_context, dream, voice_transcribe, chat_inbox_read).
  • A separate per-chat indexer reads upstream messages.db read-only and stores chat-id columns locally so per-chat allowlists work.
  • Trust files are per-workspace. As of 1.7.0 the trust file lives under ~/.claude/agent/scope-trust//-, keyed by a fingerprint of the workspace path. Granting trust in workspace A does NOT unlock workspace B — open each workspace and run the wizard to grant trust there. Upgrading from 1.5/1.6: legacy global files are ignored; doctor surfaces them with a cleanup command.

Execution gate (independent opt-in, layered on top of read scope) — same wizard adds a separate question that activates a PreToolUse gate. When the current turn was triggered by a non-owner message in a paired channel, destructive tools (Bash, Write, Edit, Task, etc.) are blocked per a denylist (recommended) or allowlist policy. Shadow mode logs would-block decisions for review; enforce mode blocks them outright. Always-on protected paths refuse MCP writes to plugin internals, agent-config, scope-trust dir, SSH/credential dirs, shell init files, and persistence mechanisms — even with the gate off, so the agent cannot self-modify the gate. A separate per-workspace -exec trust file (created via Bash) unlocks the gate for a trusted machine without disabling read scope.

Full details: [docs/channel-scope-compat.md](docs/channel-scope-compat.md) · [PRIVACY.md](PRIVACY.md#channel-scope-per-channel-opt-in)

[Importing agents](#importing-agents)

Have an existing OpenClaw agent? /agent:import brings it into Claude Code with a step-by-step wizard (clickable options, one question at a time):

  1. Bootstrap files — copies SOUL.md, IDENTITY.md, USER.md, AGENTS.md, TOOLS.md, HEARTBEAT.md
  2. Memory — imports MEMORY.md + recent daily logs (credentials are never copied)
  3. Memory backend — asks: QMD (semantic search) or builtin (SQLite + FTS5)?
  4. Skills — classifies each skill as GREEN (portable), YELLOW (needs adaptation), or RED (incompatible). You choose: all, specific ones, or skip.
  5. Crons — same 3-tier classification for scheduled tasks. Prompts are adapted for Claude Code tools.
  6. Messaging — offers WhatsApp, Telegram, Discord, iMessage setup.

Files are copied clean — no annotations, no comments. Adaptation details go to IMPORT_BACKLOG.md so the user can revisit skipped items later. The import event is logged to memory so the agent remembers what was imported.

[Webhooks](#webhooks)

External systems can send events to the agent via POST /v1/webhook (requires HTTP bridge enabled). The agent queues them and processes on the next turn.

Use cases:

  • [Email catch-all](docs/webhooks.md#cloudflare-email-worker--real-time-email-catch-all) — Cloudflare Email Worker forwards every incoming email to the agent in real-time
  • [Gmail push](docs/webhooks.md#gmail--real-time-push-notifications) — Gmail notifies the agent via Pub/Sub when new emails arrive
  • [CI/CD](docs/webhooks.md#cicd-github-actions) — GitHub Actions sends build results → agent summarizes and notifies via WhatsApp
  • [Scheduled tasks](docs/webhooks.md#cloudflare-worker--scheduled-tasks) — Cloudflare Workers trigger agent actions on a cron schedule
  • Monitoring — uptime checker sends alert → agent investigates and reports
  • IoT — sensor data arrives → agent logs to memory and acts on thresholds
curl -X POST http://localhost:18790/v1/webhook \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-token" \
  -d '{"event": "deploy", "status": "success", "repo": "my-app"}'

Security: when the bridge is exposed to the network (host: "0.0.0.0"), a token is required — the bridge refuses to start without one.

Queue holds up to 1000 events. Drain with GET /v1/webhooks or the chat_inbox_read MCP tool.

Full details: [docs/http-bridge.md](docs/http-bridge.md)

[Diagnostics

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.