Claude Code Collaboration

# Claude Code Collaboration

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Claude Code Collaboration" with this command: npx skills add gesilajerry/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 identifier
  • status: "completed" or "failed"
  • prompt: Original prompt
  • stdout: Claude Code's response
  • stderr: Error output if any
  • returncode: Exit code
  • completed_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.json for 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

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Spicy Ai Video

Turn a 60-second talking head clip into 1080p high-energy edited videos just by typing what you need. Whether it's turning bland footage into visually intens...

Registry SourceRecently Updated
Coding

Video Maker Fast

Get polished MP4 videos ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim...

Registry SourceRecently Updated
Coding

Generation Generator

generate text prompts or clips into AI generated videos with this skill. Works with MP4, MOV, PNG, JPG files up to 500MB. marketers, content creators, social...

Registry SourceRecently Updated
Coding

Editor On Android

Get edited MP4 clips ready to post, without touching a single slider. Upload your video clips (MP4, MOV, AVI, WebM, up to 500MB), say something like "trim th...

Registry SourceRecently Updated