Skillquality 0.51

collaborating-with-claude

Delegate tasks to Claude Code CLI for prototyping, debugging, and code review. Supports multi-turn sessions via SESSION_ID.

Price
free
Protocol
skill
Verified
no

What it does

Collaborating with Claude Code

Use Claude Code CLI as a collaborator while Codex remains the primary implementer.

The bridge script (scripts/claude_bridge.py) wraps claude --print, returns structured JSON, and manages session continuity via SESSION_ID.

Safety

Claude Code can read and edit files by default when run with --print. The bridge exposes flags to restrict this:

  • --permission-mode plan — read-only mode, blocks edits and shell commands. Recommended for review/consultation tasks.
  • --disallowed-tools Edit Write Bash — selectively block specific tools.
  • Include OUTPUT: Unified Diff Patch ONLY. Do not modify any files. in your prompt for code changes. This is a convention, not enforced.

Always use the bridge script — do not invoke claude directly. This keeps output parsing and session handling consistent.

When to use

  • Second opinion on design tradeoffs, edge cases, or test gaps.
  • Proposing or reviewing a unified diff.
  • Multi-turn back-and-forth while you implement locally.

When not to use

  • Trivial one-shot tasks — do them in Codex directly.
  • Tasks requiring authoritative facts with citations (Claude may guess).
  • Anything involving secrets, private keys, or prod data.

Quick start

⚠️ Backticks in prompts trigger shell command substitution — use a heredoc. See references/shell-quoting.md.

PROMPT="$(cat <<'EOF'
Review src/auth.py around login() and propose fixes.
OUTPUT: Unified Diff Patch ONLY.
EOF
)"
python3 .codex/skills/collaborating-with-claude/scripts/claude_bridge.py \
  --cd "." --model sonnet --PROMPT "$PROMPT" --output-format stream-json

Returns: { "success": true, "SESSION_ID": "...", "agent_messages": "..." }

Multi-turn sessions

Capture SESSION_ID from the first call and pass it back. Session selectors are mutually exclusive — pick one:

# Turn 1
python3 .codex/skills/collaborating-with-claude/scripts/claude_bridge.py \
  --cd "." --model sonnet --PROMPT "Analyze the bug in foo()." --output-format stream-json

# Turn 2 — resume by ID
python3 .codex/skills/collaborating-with-claude/scripts/claude_bridge.py \
  --cd "." --model sonnet --SESSION_ID "<id>" --PROMPT "Propose a fix." --output-format stream-json

# Or resume the most recent session
python3 .codex/skills/collaborating-with-claude/scripts/claude_bridge.py \
  --cd "." --model sonnet --continue --PROMPT "What about edge cases?" --output-format stream-json

Use stream-json or json output format to capture SESSION_ID. The text format does not emit one for new sessions.

Bridge flags

Core:

FlagPurposeDefault
--PROMPTPrompt text (required)
--cdWorkspace root (required)
--modelModel alias (sonnet, opus) or full nameCLI default
--output-formattext · json · stream-jsonstream-json

Sessions (mutually exclusive):

FlagPurpose
--SESSION_IDResume by session ID
--session-idUse a specific UUID
--continueResume the most recent session
--fork-sessionFork when resuming (new ID, shared history)

Safety & permissions:

FlagPurpose
--permission-modedefault · plan · bypassPermissions
--allowed-toolsTools to allow without prompting (repeatable)
--disallowed-toolsTools to block entirely (repeatable)

Advanced (use --help for full list): --fallback-model · --max-budget-usd · --add-dir · --system-prompt · --append-system-prompt · --mcp-config · --json-schema · --tools · --agent · --agents · --no-session-persistence · --return-all-messages · --verbose · --include-partial-messages

Default timeout: set timeout_ms to 600000 (10 min) when invoking via Codex command runner.

Model selection

Use aliases — --model sonnet for routine work, --model opus for complex tasks. Omit --model to use the CLI's configured default. For strict reproducibility, pass a full model name.

Prompting patterns

Use assets/prompt-template.md for structured starters. Key principles:

  • Point, don't paste — give file paths and line numbers, not code blocks. Use --cd (and --add-dir if needed) so Claude can read files itself.
  • One objective per prompt — multiple competing goals produce noisy output.
  • Enforce output format — append OUTPUT: Unified Diff Patch ONLY. for code changes.

Verification

  • Smoke test: python3 .codex/skills/collaborating-with-claude/scripts/claude_bridge.py --help
  • Session test: run one prompt with --output-format stream-json, confirm JSON contains success: true and a SESSION_ID.
  • Ensure Claude Code is logged in (claude then /login) before headless usage.

Collaboration State Capsule

Keep this block updated while collaborating:

[Claude Capsule] Goal: | SID: | Model: | Files: | Last: | Next:

References

Capabilities

skillsource-appautomatonskill-collaborating-with-claudetopic-agent-skillstopic-agentic-workflowstopic-ai-agentstopic-ai-coding-assistanttopic-claude-codetopic-claude-skillstopic-codextopic-gemini-clitopic-mcp

Install

Quality

0.51/ 1.00

deterministic score 0.51 from registry signals: · indexed on github topic:agent-skills · 113 github stars · SKILL.md body (5,092 chars)

Provenance

Indexed fromgithub
Enriched2026-05-18 18:56:19Z · deterministic:skill-github:v1 · v1
First seen2026-05-06
Last seen2026-05-18

Agent access