← 返回
未分类

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...
在同一台机器上调用 Claude Code 作为非交互式编程代理,适用于代码编写、重构或缺陷修复等场景
xxuzzwz xxuzzwz 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 365
下载
💾 0
安装
1
版本
#latest

概述

Claude Code Local

调用本机 Claude Code 作为非交互 coding agent。Orchestrator 负责指挥和验收,Claude Code 负责写代码。

Quick Reference

场景命令模板
---------------
短任务cd && claude --bare -p "<任务>" --max-turns 10
长任务cd && claude --bare -p "<任务>" --output-format stream-json --verbose --include-partial-messages --max-turns 30
全权限cd && claude --bare -p "<任务>" --dangerously-skip-permissions --output-format stream-json --verbose --include-partial-messages --max-turns 30
只读分析cd && claude --bare -p "<任务>" --permission-mode plan --allowedTools "Read,Glob,Grep,LSP" --max-turns 10
JSON 输出cd && claude --bare -p "<任务>" --output-format json --max-turns 10

Key Flags

FlagPurpose
---------------
--bareMinimal mode, skip hooks/LSP/plugins, faster startup
-p / --printNon-interactive, output to stdout (do not use PTY)
--max-turns NLimit turns: 10 short, 30 long
--output-format stream-jsonStreaming output, prevents timeout
--output-format jsonSingle JSON with result field
--verboseDetailed logging (with stream-json)
--include-partial-messagesIncremental output (with stream-json)

Permission Modes

Default to the lowest level that accomplishes the task.

LevelModeFlagsUse Case
------------------------------
1 Readplan--permission-mode plan --allowedTools "Read,Glob,Grep,LSP"Code exploration, doc review
2 Analyzedefault--allowedTools "Read,Bash,Glob,Grep,LSP"Run diagnostic commands
3 EditacceptEdits--permission-mode acceptEdits --allowedTools "Read,Edit,Write,Bash,Glob,Grep,LSP"Modify source files
4 Fullbypass--dangerously-skip-permissionsTrusted projects, batch ops

Timing Expectations

ComplexityDurationmax-turns
--------------------------------
Simple (回答问题)2-5 min5-10
Medium (探索+单文件)5-15 min10-20
Complex (多文件+测试)15-30 min20-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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-08 01:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 198 📥 68,199
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 42,091
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 81 📥 182,986