> ## Documentation Index
> Fetch the complete documentation index at: https://docs.commanderplugin.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw Integration: Native CC Commander Support

> Connect CC Commander to the OpenClaw AI agent platform for skill sync, bidirectional event forwarding, and seamless session handoffs across 38+ agents.

OpenClaw is a personal AI assistant platform that orchestrates multiple specialized agents across communication channels — Discord, Slack, Telegram, and others — from a single gateway. CC Commander ships a native integration that treats OpenClaw as a first-class runtime: skills sync automatically, hooks forward events in both directions, and sessions can hand off between Claude Code and any OpenClaw agent.

<Warning>
  The OpenClaw integration requires OpenClaw to be installed and running
  separately. CC Commander does not bundle or install OpenClaw. Refer to the
  OpenClaw project for installation instructions.
</Warning>

## How the integration works

Two components make up the CC Commander–OpenClaw integration:

<CardGroup cols={2}>
  <Card title="OpenClaw Native skill" icon="plug">
    The `openclaw-native` skill handles auto-detection, skill sync, agent profile generation, and memory synchronization between CC Commander and the OpenClaw gateway.
  </Card>

  <Card title="OpenClaw Bridge skill" icon="arrows-left-right">
    The `openclaw-bridge` skill provides the `/openclaw` and `/claw` commands, hook translation, workspace generation, session handoff protocol, and config sync between the two platforms.
  </Card>
</CardGroup>

### Auto-detection

The `openclaw-sync.js` SessionStart hook runs automatically every time you start a Claude Code session. It checks for OpenClaw in this order:

1. Look for the `CC_OPENCLAW_ENABLED=1` environment variable
2. Probe the gateway at `http://localhost:18789/health`
3. If the gateway is healthy: sync skills, register hooks, and report the session
4. If the gateway is not found: exit silently — no errors, no delays

You never need to manually trigger the sync. If OpenClaw is not running, CC Commander starts normally with no visible impact.

### Skill sync

On session start, all CC Commander skills are registered with OpenClaw's skill registry:

```
Syncing: 450+ skills → OpenClaw registry
  ├── Core workflow skills
  ├── 11 CCC domains (ccc-seo, ccc-design, ccc-testing, ...)
  ├── Integration skills (openclaw-native, status-updates, ...)
  └── Mode switcher (9 workflow modes)
```

Once synced, any OpenClaw agent can invoke CC Commander skills by name. For example, Alfred (personal assistant) can call `/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 the `openclaw-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 → CC Commander**

| 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

<Steps>
  <Step title="Enable the bridge">
    Add the following to your shell profile (`~/.zshrc` or `~/.bashrc`):

    ```bash theme={null}
    export CC_OPENCLAW_ENABLED=1
    ```

    To use a non-default gateway URL:

    ```bash theme={null}
    export CC_OPENCLAW_URL=http://localhost:18789
    ```
  </Step>

  <Step title="Verify the adapter hook is registered">
    The `openclaw-adapter.js` hook ships with CC Commander. Confirm it appears in your hooks config:

    ```json theme={null}
    {
      "hooks": {
        "PostToolUse": [
          {
            "matcher": "",
            "hooks": ["hooks/openclaw-adapter.js"]
          }
        ]
      }
    }
    ```
  </Step>

  <Step title="Register the webhook in OpenClaw">
    Add the following entry to `~/.openclaw/openclaw.json` (back up the file first):

    ```json theme={null}
    {
      "webhooks": {
        "bible": {
          "enabled": true,
          "source": "cc-commander",
          "allowedEvents": ["bible_hook"],
          "targetAgent": "alfred"
        }
      }
    }
    ```
  </Step>

  <Step title="Validate the connection">
    Check that the gateway is responding and run OpenClaw's built-in diagnostics:

    ```bash theme={null}
    curl -s http://localhost:18789/health
    openclaw doctor
    ```
  </Step>
</Steps>

## Available commands

Once the integration is active, two slash commands are available in any Claude Code session:

<CodeGroup>
  ```bash OpenClaw management theme={null}
  /openclaw status      # Gateway and agent overview
  /openclaw sync        # Force skill and hook sync
  /openclaw configure   # Set up or update integration config
  /openclaw health      # Detailed health check
  /openclaw agents      # List and manage agents
  ```

  ```bash ClawCLI integration theme={null}
  /claw                 # ClawCLI integration and CLI bridge
  ```
</CodeGroup>

## 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-session` in 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:**

1. Run `/save-session` to capture the current state
2. The handoff payload (task description, relevant files, progress, next steps) is sent to the target agent via `sessions_send`
3. The target agent picks up the payload and continues from where you left off

**From OpenClaw to CC Commander:**

1. The OpenClaw agent posts a handoff summary to `#comms-log` and writes a session file to `~/clawd/workspaces/{workspace}/memory/`
2. You run `/resume-session` in Claude Code to load the handoff context and continue

## Architecture overview

```
CC Commander                    OpenClaw Gateway
┌──────────────────┐              ┌──────────────────┐
│  Skills (450+)   │──── sync ───→│  Skill Registry  │
│  Hooks (25)      │←── events ──→│  Webhook System  │
│  Modes (9)       │──── sync ───→│  Agent Profiles  │
│  Sessions        │←── sync ───→│  Memory DBs      │
└──────────────────┘              └──────────────────┘
         ↕                                 ↕
    Claude Code CLI              38+ AI Agents (12 workspaces)
```
