Claude Code Collaboration
/install claude-code-collaboration
Claude Code Collaboration
Enable OpenClaw to delegate tasks to Claude Code CLI for collaborative discussions and complex task execution. When OpenClaw needs deeper analysis, coding assistance, or multi-turn discussions with a powerful code-generation model, it writes tasks to a queue and Claude Code Interface Agent executes them.
Architecture
OpenClaw (main agent)
↓ writes task .json
Claude Code Interface Agent (polling loop)
↓ calls claude CLI with env vars
Claude Code CLI →阿里云 API (qwen3.5-plus)
↓ returns result .json
OpenClaw reads result and continues
Setup Requirements
1. Install Claude Code CLI
# macOS
brew install anthropic/claude-code/claude-code
# Or via npm
npm install -g @anthropic/claude-code
2. Configure Environment Variables
The agent requires these environment variables:
export ANTHROPIC_AUTH_TOKEN="your-api-token"
export ANTHROPIC_BASE_URL="https://coding.dashscope.aliyuncs.com/apps/anthropic"
export ANTHROPIC_MODEL="qwen3.5-plus" # or your preferred model
3. Start the Interface Agent
mkdir -p ~/.openclaw/agents/main/workspace/.oc-cc-in
mkdir -p ~/.openclaw/agents/main/workspace/.oc-cc-out
python3 agent.py &
Usage
Sending a Task
Create a JSON file in .oc-cc-in/ with:
{
"task_id": "unique-task-id",
"prompt": "Your question or task for Claude Code",
"priority": "normal"
}
The interface agent polls the directory, executes via Claude Code CLI, and writes results to .oc-cc-out/{task_id}.json.
Reading Results
Results are JSON files with:
task_id: Task identifierstatus: "completed" or "failed"prompt: Original promptstdout: Claude Code's responsestderr: Error output if anyreturncode: Exit codecompleted_at: ISO timestamp
Example: Collaborative Discussion
OpenClaw sends:
{
"task_id": "discuss-01",
"prompt": "Analyze the pros and cons of microservices vs monolith for a small startup. Provide concrete recommendations.",
"priority": "high"
}
Claude Code returns detailed analysis in stdout, OpenClaw reads it and continues the conversation with the user.
Directory Structure
.oc-cc-agent/
├── agent.py # Interface agent (polling loop)
.oc-cc-in/ # Input queue (tasks to process)
.oc-cc-out/ # Output queue (results)
.oc-cc-chat.log # Conversation log
.oc-cc-status.json # Agent status
Monitoring
- Status: Check
.oc-cc-status.jsonfor agent state - Logs: Conversation log at
.oc-cc-chat.log - View Results: Read JSON files in
.oc-cc-out/
Configuration
Key settings in agent.py:
WORK_DIR = "/path/to/workspace" # Claude Code's working directory
IN_DIR = f"{WORK_DIR}/.oc-cc-in"
OUT_DIR = f"{WORK_DIR}/.oc-cc-out"
LOG_FILE = f"{WORK_DIR}/.oc-cc-chat.log"
PORT = 18790 # Optional HTTP server port
TIMEOUT = 120 # seconds
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-code-collaboration - After installation, invoke the skill by name or use
/claude-code-collaboration - Provide required inputs per the skill's parameter spec and get structured output
What is Claude Code Collaboration?
Integrates OpenClaw with Claude Code CLI to delegate coding tasks via JSON queues for advanced multi-turn code collaboration and analysis. It is an AI Agent Skill for Claude Code / OpenClaw, with 145 downloads so far.
How do I install Claude Code Collaboration?
Run "/install claude-code-collaboration" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Claude Code Collaboration free?
Yes, Claude Code Collaboration is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Claude Code Collaboration support?
Claude Code Collaboration is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Claude Code Collaboration?
It is built and maintained by gesilajerry (@gesilajerry); the current version is v1.0.0.