collaborating-with-claude
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "collaborating-with-claude":https://skillpi.com/zh/skills/deepskill-ccaf23587d2b01fd443aafc9bc5dbc6e50e68a1645c5a8e554880db63a79be0f。安装前核对上游来源和版本:https://github.com/appautomaton/agent-designer。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
将任务委派给 Claude Code CLI,用于原型设计、调试和代码审查。支持通过 SESSION_ID 进行多轮会话。
介绍来源: third_party · appautomaton · 0.0.1 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: collaborating-with-claude
description: Delegate tasks to Claude Code CLI for prototyping, debugging, and code review. Supports multi-turn sessions via SESSION_ID.
metadata:
short-description: Delegate to Claude Code CLICollaborating with Claude Code
Drive Claude Code headlessly as an independent collaborator while the calling agent stays responsible for verification, synthesis, and final user-facing decisions.
The bridge (scripts/claude_bridge.py) wraps claude --print, streams progress to stderr, returns structured JSON with telemetry, and manages multi-turn continuity via SESSION_ID. Always go through the bridge — don't invoke claude directly — so output parsing and session handling stay consistent.
Commands below write <skill_dir> for the absolute path of the directory containing this SKILL.md. Your harness usually reports that path when it loads the skill. If it does not, use this SKILL.md's own location. Substitute it before running, for example ~/.codex/skills/collaborating-with-claude.
In Claude Code, run non-trivial calls in the background and watch the stderr progress:
Bash tool call:
command: python3 <skill_dir>/scripts/claude_bridge.py --cd "/project" --PROMPT "Analyze auth flow in src/auth/"
run_in_background: true
run_in_background is a host tool parameter, not a shell argument. Use the task-output view to monitor timestamped stderr progress (session, responses, tools, cost) and the final JSON result.
Safety
Default to read-only delegation: --permission-mode plan (analyze, no edits/commands) or --tools "Read,Glob,Grep". Grant writes only deliberately (acceptEdits/auto), preferably in an isolated worktree. Do not hand secrets, private keys, or production data to Claude. Full permission-mode set and the worktree pattern: cli-reference.md, handoff-patterns.md.
Permissions and network (headless)
Headless claude -p cannot prompt: every gated action is denied on the spot and recorded in permission_denials, which the bridge surfaces (verified). Authority is therefore decided entirely up front via --permission-mode, --tools, and --allowed-tools — get user consent before granting anything beyond read-only.
Network is governed by tool policy, not an OS sandbox: plan mode denies WebFetch/WebSearch too (verified), while an allowed Bash can reach the network freely. Pick the posture per task:
- No network, read-only:
--permission-mode plan, or--tools "Read,Glob,Grep". - Read-only plus targeted web research (verified):
--permission-mode dontAsk --tools "Read,Glob,Grep,WebFetch,WebSearch" --allowed-tools "WebFetch(domain:example.com)" --allowed-tools "WebSearch". - Reads outside
--cdare gated as well — grant extra roots with--add-dir.
Host-side approval (the bridge call itself)
Everything above governs the child Claude. The host agent's own permission layer gates the python3 … claude_bridge.py Bash call first — and under classifier-gated auto-approval (Claude Code auto/dontAsk, Codex non-interactive runs), a long-running script that spawns another agent over the codebase pattern-matches "high-risk" and can be denied silently: the delegation never starts. A host permission error instead of bridge JSON means the host blocked the bridge, not that Claude failed.
- Pre-authorize the bridge instead of relying on the classifier. Claude Code host: add
"Bash(python3 *collaborating-with-claude*bridge.py*)"topermissions.allowin yoursettings.json. The wildcard form keeps matching wherever the skill is installed. Sandboxed hosts also need"python3 *collaborating-with-claude*bridge.py*"insandbox.excludedCommands, because sandbox network policy blocks the child CLI's API traffic even after the command is allowed. Grok host: pass the same rule via--allow. Install and approval runbooks: docs/setup/ in the source repo. - Codex host: the sandbox is the second gate. Both
read-onlyandworkspace-writeblock shell network, so the child CLI can't reach its API at all. Run the bridge call through an approved escalation, or knowingly grant network for that call. - Never degrade silently. If the host denies the bridge call, report it and propose the allowlist fix — don't substitute your own answer for the independent second opinion that was requested.
When to use / not use
Use for: second opinions on design, edge cases, or test gaps; proposing or reviewing a unified diff; multi-turn analysis while you implement. Skip for: trivial one-shot edits (do them directly); tasks needing authoritative cited facts (Claude may guess); anything touching secrets or prod data.
Quick start
⚠️ Backticks / $VARS in prompts trigger shell expansion — use a single-quoted heredoc, or --prompt-file for large/generated prompts. See shell-quoting.md.
PROMPT="$(cat <<'EOF'
Review src/auth.py around login() and propose fixes.
OUTPUT: Unified Diff Patch ONLY.
EOF
)"
python3 <skill_dir>/scripts/claude_bridge.py \
--cd "." --model sonnet --permission-mode plan --PROMPT "$PROMPT" --output-format stream-json
For large or shell-sensitive prompts, write the prompt to a file and pass --prompt-file /tmp/prompt.md (piped via stdin — no argv/quoting limits).
Returns (stdout JSON): { "success": true, "SESSION_ID": "...", "agent_messages": "...", "model": "...", "subtype": "success", "total_cost_usd": 0.03, "usage": {...}, "num_turns": 1 } — plus tools_used / tools_failed / tool_counts / permission_denials / structured_output / is_error when relevant. Check tools_failed and permission_denials before trusting the answer: a denied tool means Claude reasoned without the evidence it asked for. Progress streams to stderr; the bridge exits non-zero on failure.
Multi-turn sessions
Capture SESSION_ID from the first call and pass it back (selectors are mutually exclusive):
# Turn 1
python3 <skill_dir>/scripts/claude_bridge.py \
--cd "." --model sonnet --PROMPT "Analyze the bug in foo()." --output-format stream-json
# Turn 2 — resume by ID (use the same --cd)
python3 <skill_dir>/scripts/claude_bridge.py \
--cd "." --model sonnet --SESSION_ID "<id>" --PROMPT "Propose a fix." --output-format stream-json
# Or resume the most recent session in this directory
python3 <skill_dir>/scripts/claude_bridge.py \
--cd "." --model sonnet --continue --PROMPT "What about edge cases?" --output-format stream-json
Use stream-json or json output to capture SESSION_ID.
Bridge flags
Core: --PROMPT (or --prompt-file) · --cd (required) · --model (alias haiku/sonnet/opus/fable, or full id) · --output-format (text·json·stream-json, default stream-json).
Sessions (mutually exclusive): --SESSION_ID · --session-id <uuid> · --continue; plus --fork-session, --no-session-persistence.
Permissions: --permission-mode (plan·manual·acceptEdits·auto·dontAsk·bypassPermissions) · --tools · --allowed-tools · --disallowed-tools. Footgun: the space in Bash(git diff *) is load-bearing.
Reproducibility & cost: --bare / --safe-mode (skip customizations; --bare needs ANTHROPIC_API_KEY) · --effort (low→max) · --max-budget-usd · --max-turns · --timeout <seconds>.
Context & advanced: --prompt-file · --system-prompt[-file] · --append-system-prompt[-file] · --add-dir · --json-schema · --mcp-config · --settings · --agent/--agents · --return-all-messages · --verbose.
Full semantics in cli-reference.md. Set the host's timeout_ms to 600000 (10 min) when invoking via a command runner.
Tune performance
--model haiku for quick checks, sonnet for routine work, opus or fable for hard tasks; --effort low→max trades depth for speed/cost; --max-budget-usd caps spend. Omit --model to use the CLI default.
Prompting
Quick starters in prompt-template.md; composable XML blocks in prompt-blocks.md; end-to-end recipes in prompt-recipes.md; delegation patterns and principles in patterns.md. In short: point (file:line), don't paste; one objective per run; state the output shape; verify Claude's output before acting.
Verification
- Smoke:
python3 <skill_dir>/scripts/claude_bridge.py --help - Syntax:
python3 -m py_compile <skill_dir>/scripts/claude_bridge.py - Session: run a prompt with
--output-format stream-json; confirm JSON hassuccess: true, aSESSION_ID, and telemetry (subtype/total_cost_usd/usage/num_turns); failures exit non-zero. - Ensure Claude is logged in (
claudethen/login), or setANTHROPIC_API_KEY(required for--bare).
Collaboration State Capsule
Keep this updated across turns (referenced by handoff-patterns.md):
[Claude Capsule] Goal: | SID: | Model: | PermMode: | Files: | Last: | Next:
References
- prompt-template.md — quick plain-text starters
- prompt-blocks.md — composable XML blocks
- prompt-recipes.md — end-to-end templates
- prompt-antipatterns.md — common mistakes
- patterns.md — when to delegate + prompt patterns
- handoff-patterns.md — read-only / worktree / synthesis
- parallel.md — parallel runs and worktree isolation
- cli-reference.md — verified Claude CLI flags + event schema
- shell-quoting.md — safe heredoc prompts
当前收录版本
0.0.1
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供与 Claude Code CLI 的任务委派能力,支持原型设计、调试和代码审查
- 支持多轮会话和独立协作者模式,显著提升开发效率
- 明确区分了 read-only 和 write 权限场景,安全性设计完善
亮点
- description 精准描述了核心功能:委派任务给 Claude Code CLI
- 明确指出了关键特性:支持通过 SESSION_ID 进行多轮会话
- 触发词边界清晰,无歧义
待提升项
-
文档过长 原报告严重程度:轻微
SKILL.md 文档内容超过 500 行,影响可读性
改进建议:考虑将部分内容拆分为独立的参考文档或使用折叠区块
-
When to Use 未独立成节 原报告严重程度:轻微
虽然有使用场景说明,但未作为独立章节清晰列出
改进建议:将 'When to use / not use' 内容提升为独立章节,增强可读性
亮点
- 文档结构清晰,包含多个逻辑 Phase(Safety、Permissions、Quick start 等)
- 提供了详细的端到端示例和命令说明
- frontmatter 完整,包含 name、description 和 metadata
亮点
- 工具来源明确:通过 scripts/claude_bridge.py 封装调用
- 参数说明详细,覆盖核心、会话、权限、性能等各个方面
- 对权限拒绝、网络策略、host-side approval 等主要异常情况有详细说明
- 提供了完整的验证步骤和故障排查建议
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- github.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。