简介
claude-code-local
原始描述
Call Claude Code as a non-interactive coding agent on the same machine as OpenClaw. Use when: (1) You need to delegate coding, refactoring, or bug-fixing tas...
通过你的 Agent 添加
安装目录:claude-code-local/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: claude-code-local
description: "Call Claude Code as a non-interactive coding agent on the same machine as OpenClaw. Use when: (1) You need to delegate coding, refactoring, or bug-fixing tasks to Claude Code, (2) You want non-interactive code exploration and analysis, (3) You need to run batch code reviews, (4) You're setting up automated CI/CD code checks, (5) You want to use Claude Code as a specialized subordinate for project work while keeping the orchestrator agent focused on coordination."
Claude Code Local
调用本机 Claude Code 作为非交互 coding agent。Orchestrator 负责指挥和验收,Claude Code 负责写代码。
Quick Reference
场景
命令模板
短任务
cd <project> && claude --bare -p "<任务>" --max-turns 10
长任务
cd <project> && claude --bare -p "<任务>" --output-format stream-json --verbose --include-partial-messages --max-turns 30
全权限
cd <project> && claude --bare -p "<任务>" --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages --max-turns 30
只读分析
cd <project> && claude --bare -p "<任务>" --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" --max-turns 10
JSON 输出
cd <project> && claude --bare -p "<任务>" --output-format json --max-turns 10
Key Flags
Flag
Purpose
--bare
Minimal mode, skip hooks/LSP/plugins, faster startup
-p / --print
Non-interactive, output to stdout (do not use PTY)
--max-turns N
Limit turns: 10 short, 30 long
--output-format stream-json
Streaming output, prevents timeout
--output-format json
Single JSON with result field
--verbose
Detailed logging (with stream-json)
--include-partial-messages
Incremental output (with stream-json)
Permission Modes
| 场景 | 命令模板 |
|---|---|
| 短任务 | cd <project> && claude --bare -p "<任务>" --max-turns 10 |
| 长任务 | cd <project> && claude --bare -p "<任务>" --output-format stream-json --verbose --include-partial-messages --max-turns 30 |
| 全权限 | cd <project> && claude --bare -p "<任务>" --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages --max-turns 30 |
| 只读分析 | cd <project> && claude --bare -p "<任务>" --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" --max-turns 10 |
| JSON 输出 | cd <project> && claude --bare -p "<任务>" --output-format json --max-turns 10 |
| Flag | Purpose |
|---|---|
--bare |
Minimal mode, skip hooks/LSP/plugins, faster startup |
-p / --print |
Non-interactive, output to stdout (do not use PTY) |
--max-turns N |
Limit turns: 10 short, 30 long |
--output-format stream-json |
Streaming output, prevents timeout |
--output-format json |
Single JSON with result field |
--verbose |
Detailed logging (with stream-json) |
--include-partial-messages |
Incremental output (with stream-json) |
Permission Modes
Default to the lowest level that accomplishes the task.
| Level | Mode | Flags | Use Case |
|---|---|---|---|
| 1 Read | plan | --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" |
Code exploration, doc review |
| 2 Analyze | default | --allowedTools "Read,Bash,Glob,Grep,LSP" |
Run diagnostic commands |
| 3 Edit | acceptEdits | --permission-mode acceptEdits --allowedTools "Read,Edit,Write,Bash,Glob,Grep,LSP" |
Modify source files |
| 4 Full | bypass | --dangerously-skip-permissions |
Trusted projects, batch ops |
Timing Expectations
Complexity
Duration
max-turns
Simple (回答问题)
2-5 min
5-10
Medium (探索+单文件)
5-15 min
10-20
Complex (多文件+测试)
15-30 min
20-40
Never kill Claude Code when exec times out. Check ps aux | grep claude first.
Post-Task Checklist
- Summary of changes
- Modified files list
- Commands executed
-
git status --short
-
git diff --stat
- Test results
- Next steps
References
references/streaming.md — Stream-JSON event types and filtering
references/troubleshooting.md — Common failures and fixes
| Complexity | Duration | max-turns |
|---|---|---|
| Simple (回答问题) | 2-5 min | 5-10 |
| Medium (探索+单文件) | 5-15 min | 10-20 |
| Complex (多文件+测试) | 15-30 min | 20-40 |
Never kill Claude Code when exec times out. Check ps aux | grep claude first.
- Summary of changes
- Modified files list
- Commands executed
-
git status --short -
git diff --stat - Test results
- Next steps
References
references/streaming.md — Stream-JSON event types and filtering
references/troubleshooting.md — Common failures and fixes
references/streaming.md — Stream-JSON event types and filteringreferences/troubleshooting.md — Common failures and fixes正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。