How the integration works
Two components make up the CC Commander–OpenClaw integration:OpenClaw Native skill
The
openclaw-native skill handles auto-detection, skill sync, agent profile generation, and memory synchronization between CC Commander and the OpenClaw gateway.OpenClaw Bridge skill
The
openclaw-bridge skill provides the /openclaw and /claw commands, hook translation, workspace generation, session handoff protocol, and config sync between the two platforms.Auto-detection
Theopenclaw-sync.js SessionStart hook runs automatically every time you start a Claude Code session. It checks for OpenClaw in this order:
- Look for the
CC_OPENCLAW_ENABLED=1environment variable - Probe the gateway at
http://localhost:18789/health - If the gateway is healthy: sync skills, register hooks, and report the session
- If the gateway is not found: exit silently — no errors, no delays
Skill sync
On session start, all CC Commander skills are registered with OpenClaw’s skill registry:/code-review from Discord, or Neo (orchestrator) can run /tdd across worker agents.
Bidirectional event forwarding
CC Commander hooks and OpenClaw webhooks exchange events in both directions through theopenclaw-adapter.js hook:
CC Commander → OpenClaw
| CC Commander hook | OpenClaw event | Data forwarded |
|---|---|---|
| PostToolUse | cc_kit_tool_use | Tool name, duration, result |
| Stop | cc_kit_session_end | Session summary, cost, files changed |
| cost-alert | cc_kit_cost_alert | Current cost, ceiling, percentage used |
| context-guard | cc_kit_context_warn | Context percentage, tokens remaining |
| OpenClaw event | CC Commander action | Description |
|---|---|---|
agent_task_assigned | Load context | Pre-load relevant files |
agent_mode_change | Switch mode | Apply the requested workflow mode |
channel_message | Status update | Forward to the status-updates skill |
Setting up the integration
Enable the bridge
Add the following to your shell profile (To use a non-default gateway URL:
~/.zshrc or ~/.bashrc):Verify the adapter hook is registered
The
openclaw-adapter.js hook ships with CC Commander. Confirm it appears in your hooks config:Register the webhook in OpenClaw
Add the following entry to
~/.openclaw/openclaw.json (back up the file first):Available commands
Once the integration is active, two slash commands are available in any Claude Code session:Configuration reference
| Setting | Environment variable | Default | Description |
|---|---|---|---|
| Enable integration | CC_OPENCLAW_ENABLED | 0 | Set to 1 to enable |
| Gateway URL | CC_OPENCLAW_URL | http://localhost:18789 | Gateway endpoint |
| Request timeout | CC_OPENCLAW_TIMEOUT | 5000 | Timeout in milliseconds |
| Auto-sync on start | CC_OPENCLAW_AUTOSYNC | 1 | Sync skills when a session starts |
| Debug logging | CC_OPENCLAW_DEBUG | 0 | Verbose output to stderr |
Memory sync
CC Commander session memory (~/.claude/sessions/) and OpenClaw agent memory (~/.openclaw/memory/) can be kept in sync:
- When you run
/save-sessionin CC Commander, decisions and lessons are extracted and appended to the relevant OpenClaw workspace memory file - When you run
/resume-session, CC Commander scans recent OpenClaw memory for[HANDOFF]and[DECISION]tags relevant to the current project - Sync is always additive — neither system removes entries written by the other
Session handoff
You can transfer an active Claude Code session to an OpenClaw agent, or receive a handoff from one. From CC Commander to OpenClaw:- Run
/save-sessionto capture the current state - The handoff payload (task description, relevant files, progress, next steps) is sent to the target agent via
sessions_send - The target agent picks up the payload and continues from where you left off
- The OpenClaw agent posts a handoff summary to
#comms-logand writes a session file to~/clawd/workspaces/{workspace}/memory/ - You run
/resume-sessionin Claude Code to load the handoff context and continue