词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 来源 | 内置(默认安装) |
| 路径 | skills/autonomous-ai-agents/claude-code |
| 版本 | 2.2.0 |
| 作者 | Hermes Agent + Teknium |
| 许可证 | MIT |
| 平台 | linux, macos, windows |
| 标签 | Coding-Agent, Claude, Anthropic, Code-Review, Refactoring, PTY, Automation |
| 相关 skill | codex, hermes-agent, opencode |
npm install -g @anthropic-ai/claude-codeclaude 以登录(Pro/Max 使用浏览器 OAuth,或设置 ANTHROPIC_API_KEY)claude auth login --console 用于 API key 计费claude auth login --sso 用于企业版claude auth status(JSON)或 claude auth status --text(人类可读)claude doctor — 检查自动更新器和安装健康状态claude --version(需要 v2.x+)claude update 或 claude upgrade-p)— 非交互式(大多数任务的首选)terminal(command="claude -p 'Add error handling to all API calls in src/' --allowedTools 'Read,Edit' --max-turns 10", workdir="/path/to/project", timeout=120)--json-schema 进行结构化数据提取cat file | claude -p "analyze this")# 启动 tmux 会话
terminal(command="tmux new-session -d -s claude-work -x 140 -y 40")
# 在其中启动 Claude Code
terminal(command="tmux send-keys -t claude-work 'cd /path/to/project && claude' Enter")
# 等待启动,然后发送任务
# (等待约 3-5 秒显示欢迎界面)
terminal(command="sleep 5 && tmux send-keys -t claude-work 'Refactor the auth module to use JWT tokens' Enter")
# 通过捕获面板监控进度
terminal(command="sleep 15 && tmux capture-pane -t claude-work -p -S -50")
# 发送后续任务
terminal(command="tmux send-keys -t claude-work 'Now add unit tests for the new JWT code' Enter")
# 完成后退出
terminal(command="tmux send-keys -t claude-work '/exit' Enter")/compact、/review、/model)❯ 1. Yes, I trust this folder ← 默认(直接按 Enter)
2. No, exittmux send-keys -t <session> Enter — 默认选项正确。❯ 1. No, exit ← 默认(错误选项!)
2. Yes, I accepttmux send-keys -t <session> Down && sleep 0.3 && tmux send-keys -t <session> Enter# 使用权限绕过启动
terminal(command="tmux send-keys -t claude-work 'claude --dangerously-skip-permissions \"your task\"' Enter")
# 处理信任对话框(按 Enter 选择默认的"Yes")
terminal(command="sleep 4 && tmux send-keys -t claude-work Enter")
# 处理权限对话框(按 Down 再按 Enter 选择"Yes, I accept")
terminal(command="sleep 3 && tmux send-keys -t claude-work Down && sleep 0.3 && tmux send-keys -t claude-work Enter")
# 等待 Claude 工作
terminal(command="sleep 15 && tmux capture-pane -t claude-work -p -S -60")--dangerously-skip-permissions 时重复出现。| 子命令 | 用途 |
|---|---|
claude | 启动交互式 REPL |
claude "query" | 以初始 prompt 启动 REPL |
claude -p "query" | Print 模式(非交互式,完成后退出) |
cat file | claude -p "query" | 通过管道传入内容作为 stdin 上下文 |
claude -c | 继续此目录中最近的对话 |
claude -r "id" | 通过 ID 或名称恢复特定会话 |
claude auth login | 登录(添加 --console 用于 API 计费,--sso 用于企业版) |
claude auth status | 检查登录状态(返回 JSON;--text 为人类可读格式) |
claude mcp add <name> -- <cmd> | 添加 MCP 服务器 |
claude mcp list | 列出已配置的 MCP 服务器 |
claude mcp remove <name> | 移除 MCP 服务器 |
claude agents | 列出已配置的 agent |
claude doctor | 对安装和自动更新器运行健康检查 |
claude update / claude upgrade | 将 Claude Code 更新到最新版本 |
claude remote-control | 启动服务器以从 claude.ai 或移动应用控制 Claude |
claude install [target] | 安装原生构建(stable、latest 或特定版本) |
claude setup-token | 设置长期认证 token(需要订阅) |
claude plugin / claude plugins | 管理 Claude Code 插件 |
claude auto-mode | 检查自动模式分类器配置 |
terminal(command="claude -p 'Analyze auth.py for security issues' --output-format json --max-turns 5", workdir="/project", timeout=120){
"type": "result",
"subtype": "success",
"result": "The analysis text...",
"session_id": "75e2167f-...",
"num_turns": 3,
"total_cost_usd": 0.0787,
"duration_ms": 10276,
"stop_reason": "end_turn",
"terminal_reason": "completed",
"usage": { "input_tokens": 5, "output_tokens": 603, ... },
"modelUsage": { "claude-sonnet-4-6": { "costUSD": 0.078, "contextWindow": 200000 } }
}session_id 用于恢复会话,num_turns 表示 agentic 循环次数,total_cost_usd 用于费用追踪,subtype 用于成功/错误检测(success、error_max_turns、error_budget)。stream-json 配合 --verbose:terminal(command="claude -p 'Write a summary' --output-format stream-json --verbose --include-partial-messages", timeout=60)claude -p "Explain X" --output-format stream-json --verbose --include-partial-messages | \
jq -rj 'select(.type == "stream_event" and .event.delta.type? == "text_delta") | .event.delta.text'system/api_retry,带有 attempt、max_retries 和 error 字段(例如 rate_limit、billing_error)。claude -p "task" --input-format stream-json --output-format stream-json --replay-user-messages--replay-user-messages 在 stdout 上重新发出用户消息以供确认。# 通过管道传入文件进行分析
terminal(command="cat src/auth.py | claude -p 'Review this code for bugs' --max-turns 1", timeout=60)
# 通过管道传入多个文件
terminal(command="cat src/*.py | claude -p 'Find all TODO comments' --max-turns 1", timeout=60)
# 通过管道传入命令输出
terminal(command="git diff HEAD~3 | claude -p 'Summarize these changes' --max-turns 1", timeout=60)terminal(command="claude -p 'List all functions in src/' --output-format json --json-schema '{\"type\":\"object\",\"properties\":{\"functions\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"functions\"]}' --max-turns 5", workdir="/project", timeout=90)structured_output。Claude 在返回前会根据 schema 验证输出。# 开始一个任务
terminal(command="claude -p 'Start refactoring the database layer' --output-format json --max-turns 10 > /tmp/session.json", workdir="/project", timeout=180)
# 使用会话 ID 恢复
terminal(command="claude -p 'Continue and add connection pooling' --resume $(cat /tmp/session.json | python3 -c 'import json,sys; print(json.load(sys.stdin)[\"session_id\"])') --max-turns 5", workdir="/project", timeout=120)
# 或恢复同一目录中最近的会话
terminal(command="claude -p 'What did you do last time?' --continue --max-turns 1", workdir="/project", timeout=30)
# 派生会话(新 ID,保留历史)
terminal(command="claude -p 'Try a different approach' --resume <id> --fork-session --max-turns 10", workdir="/project", timeout=120)terminal(command="claude --bare -p 'Run all tests and report failures' --allowedTools 'Read,Bash' --max-turns 10", workdir="/project", timeout=180)--bare 跳过 hook、插件、MCP 发现和 CLAUDE.md 加载。启动最快。需要 ANTHROPIC_API_KEY(跳过 OAuth)。| 要加载的内容 | 标志 |
|---|---|
| 系统 prompt 追加内容 | --append-system-prompt "text" 或 --append-system-prompt-file path |
| 设置 | --settings <file-or-json> |
| MCP 服务器 | --mcp-config <file-or-json> |
| 自定义 agent | --agents '<json>' |
terminal(command="claude -p 'task' --fallback-model haiku --max-turns 5", timeout=90)| 标志 | 效果 |
|---|---|
-p, --print | 非交互式一次性模式(完成后退出) |
-c, --continue | 恢复当前目录中最近的对话 |
-r, --resume <id> | 通过 ID 或名称恢复特定会话(无 ID 时显示交互式选择器) |
--fork-session | 恢复时创建新会话 ID 而非复用原始 ID |
--session-id <uuid> | 为对话使用特定 UUID |
--no-session-persistence | 不将会话保存到磁盘(仅限 print 模式) |
--add-dir <paths...> | 授予 Claude 访问额外工作目录的权限 |
-w, --worktree [name] | 在 .claude/worktrees/<name> 处的隔离 git worktree 中运行 |
--tmux | 为 worktree 创建 tmux 会话(需要 --worktree) |
--ide | 启动时自动连接到有效的 IDE |
--chrome / --no-chrome | 启用/禁用 Chrome 浏览器集成以进行 Web 测试 |
--from-pr [number] | 恢复与特定 GitHub PR 关联的会话 |
--file <specs...> | 启动时下载的文件资源(格式:file_id:relative_path) |
| 标志 | 效果 |
|---|---|
--model <alias> | 模型选择:sonnet、opus、haiku 或完整名称如 claude-sonnet-4-6 |
--effort <level> | 推理深度:low、medium、high、max、auto |
--max-turns <n> | 限制 agentic 循环次数(仅限 print 模式;防止失控) |
--max-budget-usd <n> | 以美元为单位限制 API 花费(仅限 print 模式) |
--fallback-model <model> | 默认模型过载时自动切换(仅限 print 模式) |
--betas <betas...> | 在 API 请求中包含的 beta 头(仅限 API key 用户) |
| 标志 | 效果 |
|---|---|
--dangerously-skip-permissions | 自动批准所有工具使用(文件写入、bash、网络等) |
--allow-dangerously-skip-permissions | 将绕过作为选项启用,但不默认启用 |
--permission-mode <mode> | default、acceptEdits、plan、auto、dontAsk、bypassPermissions |
--allowedTools <tools...> | 白名单特定工具(逗号或空格分隔) |
--disallowedTools <tools...> | 黑名单特定工具 |
--tools <tools...> | 覆盖内置工具集("" = 无,"default" = 全部,或工具名称) |
| 标志 | 效果 |
|---|---|
--output-format <fmt> | text(默认)、json(单个结果对象)、stream-json(换行符分隔) |
--input-format <fmt> | text(默认)或 stream-json(实时流式输入) |
--json-schema <schema> | 强制输出符合 schema 的结构化 JSON |
--verbose | 完整的逐轮输出 |
--include-partial-messages | 在消息块到达时包含部分消息(stream-json + print) |
--replay-user-messages | 在 stdout 上重新发出用户消息(stream-json 双向) |
| 标志 | 效果 |
|---|---|
--append-system-prompt <text> | 追加到默认系统 prompt(保留内置能力) |
--append-system-prompt-file <path> | 追加文件内容到默认系统 prompt |
--system-prompt <text> | 替换整个系统 prompt(通常建议使用 --append) |
--system-prompt-file <path> | 用文件内容替换系统 prompt |
--bare | 跳过 hook、插件、MCP 发现、CLAUDE.md、OAuth(启动最快) |
--agents '<json>' | 以 JSON 形式动态定义自定义子 agent |
--mcp-config <path> | 从 JSON 文件加载 MCP 服务器(可重复使用) |
--strict-mcp-config | 仅使用 --mcp-config 中的 MCP 服务器,忽略所有其他 MCP 配置 |
--settings <file-or-json> | 从 JSON 文件或内联 JSON 加载额外设置 |
--setting-sources <sources> | 逗号分隔的加载来源:user、project、local |
--plugin-dir <paths...> | 仅在本次会话中从目录加载插件 |
--disable-slash-commands | 禁用所有 skill/斜杠命令 |
| 标志 | 效果 |
|---|---|
-d, --debug [filter] | 启用调试日志,可选类别过滤器(例如 "api,hooks"、"!1p,!file") |
--debug-file <path> | 将调试日志写入文件(隐式启用调试模式) |
| 标志 | 效果 |
|---|---|
--teammate-mode <mode> | agent 团队的显示方式:auto、in-process 或 tmux |
--brief | 启用 SendUserMessage 工具用于 agent 间通信 |
Read # 所有文件读取
Edit # 文件编辑(现有文件)
Write # 文件创建(新文件)
Bash # 所有 shell 命令
Bash(git *) # 仅 git 命令
Bash(git commit *) # 仅 git commit 命令
Bash(npm run lint:*) # 使用通配符的模式匹配
WebSearch # Web 搜索能力
WebFetch # Web 页面抓取
mcp__<server>__<tool> # 特定 MCP 工具.claude/settings.local.json(个人,已 gitignore).claude/settings.json(共享,git 跟踪)~/.claude/settings.json(全局){
"permissions": {
"allow": ["Bash(npm run lint:*)", "WebSearch", "Read"],
"ask": ["Write(*.ts)", "Bash(git push*)"],
"deny": ["Read(.env)", "Bash(rm -rf *)"]
}
}~/.claude/CLAUDE.md — 适用于所有项目./CLAUDE.md — 项目特定上下文(git 跟踪).claude/CLAUDE.local.md — 个人项目覆盖(已 gitignore)# 前缀快速添加到记忆:# Always use 2-space indentation。| 命令 | 用途 |
|---|---|
/help | 显示所有命令(包括自定义和 MCP 命令) |
/compact [focus] | 压缩上下文以节省 token;CLAUDE.md 在压缩后保留。例如 /compact focus on auth logic |
/clear | 清除对话历史,重新开始 |
/context | 以彩色网格可视化上下文使用情况并提供优化建议 |
/cost | 查看 token 使用情况,包含按模型和缓存命中的细分 |
/resume | 切换到或恢复不同的会话 |
/rewind | 回退到对话或代码中的上一个检查点 |
/btw <question> | 提问附带问题而不增加上下文成本 |
/status | 显示版本、连接状态和会话信息 |
/todos | 列出对话中跟踪的待办事项 |
/exit 或 Ctrl+D | 结束会话 |
| 命令 | 用途 |
|---|---|
/review | 请求对当前更改进行代码审查 |
/security-review | 对当前更改执行安全分析 |
/plan [description] | 进入 Plan 模式并自动启动任务规划 |
/loop [interval] | 在会话中安排定期任务 |
/batch | 自动创建 worktree 用于大型并行更改(5-30 个 worktree) |
| 命令 | 用途 |
|---|---|
/model [model] | 在会话中途切换模型(使用方向键调整 effort) |
/effort [level] | 设置推理 effort:low、medium、high、max 或 auto |
/init | 创建 CLAUDE.md 文件用于项目记忆 |
/memory | 打开 CLAUDE.md 进行编辑 |
/config | 打开交互式设置配置 |
/permissions | 查看/更新工具权限 |
/agents | 管理专用子 agent |
/mcp | 管理 MCP 服务器的交互式 UI |
/add-dir | 添加额外工作目录(适用于 monorepo) |
/usage | 显示计划限制和速率限制状态 |
/voice | 启用按键说话语音模式(20 种语言;按住 Space 录音,松开发送) |
/release-notes | 版本发布说明的交互式选择器 |
.claude/commands/<name>.md(项目共享)或 ~/.claude/commands/<name>.md(个人):/deploy production — $ARGUMENTS 将被用户输入替换。.claude/skills/ 中的 skill 是 markdown 指南,当任务匹配时 Claude 会通过自然语言自动调用:| 按键 | 操作 |
|---|---|
Ctrl+C | 取消当前输入或生成 |
Ctrl+D | 退出会话 |
Ctrl+R | 反向搜索命令历史 |
Ctrl+B | 将运行中的任务移至后台 |
Ctrl+V | 将图片粘贴到对话中 |
Ctrl+O | 转录模式 — 查看 Claude 的思考过程 |
Ctrl+G 或 Ctrl+X Ctrl+E | 在外部编辑器中打开 prompt |
Esc Esc | 回退对话或代码状态/总结 |
| 按键 | 操作 |
|---|---|
Shift+Tab | 循环切换权限模式(普通 → 自动接受 → 计划) |
Alt+P | 切换模型 |
Alt+T | 切换思考模式 |
Alt+O | 切换快速模式 |
| 按键 | 操作 |
|---|---|
\ + Enter | 快速换行 |
Shift+Enter | 换行(备选) |
Ctrl+J | 换行(备选) |
| 前缀 | 操作 |
|---|---|
! | 直接执行 bash,绕过 AI(例如 !npm test)。单独使用 ! 可切换 shell 模式。 |
@ | 通过自动补全引用文件/目录(例如 @./src/api/) |
# | 快速添加到 CLAUDE.md 记忆(例如 # Use 2-space indentation) |
/ | 斜杠命令 |
/effort 设置如何,这都会触发最深层的思考模式。terminal(command="cd /path/to/repo && git diff main...feature-branch | claude -p 'Review this diff for bugs, security issues, and style problems. Be thorough.' --max-turns 1", timeout=60)terminal(command="tmux new-session -d -s review -x 140 -y 40")
terminal(command="tmux send-keys -t review 'cd /path/to/repo && claude -w pr-review' Enter")
terminal(command="sleep 5 && tmux send-keys -t review Enter") # 信任对话框
terminal(command="sleep 2 && tmux send-keys -t review 'Review all changes vs main. Check for bugs, security issues, race conditions, and missing tests.' Enter")
terminal(command="sleep 30 && tmux capture-pane -t review -p -S -60")terminal(command="claude -p 'Review this PR thoroughly' --from-pr 42 --max-turns 10", workdir="/path/to/repo", timeout=120)terminal(command="claude -w feature-x --tmux", workdir="/path/to/repo").claude/worktrees/feature-x 创建隔离的 git worktree,并为其创建 tmux 会话。有 iTerm2 时使用原生面板;添加 --tmux=classic 使用传统 tmux。# 任务一:修复后端
terminal(command="tmux new-session -d -s task1 -x 140 -y 40 && tmux send-keys -t task1 'cd ~/project && claude -p \"Fix the auth bug in src/auth.py\" --allowedTools \"Read,Edit\" --max-turns 10' Enter")
# 任务二:编写测试
terminal(command="tmux new-session -d -s task2 -x 140 -y 40 && tmux send-keys -t task2 'cd ~/project && claude -p \"Write integration tests for the API endpoints\" --allowedTools \"Read,Write,Bash\" --max-turns 15' Enter")
# 任务三:更新文档
terminal(command="tmux new-session -d -s task3 -x 140 -y 40 && tmux send-keys -t task3 'cd ~/project && claude -p \"Update README.md with the new API endpoints\" --allowedTools \"Read,Edit\" --max-turns 5' Enter")
# 监控所有任务
terminal(command="sleep 30 && for s in task1 task2 task3; do echo '=== '$s' ==='; tmux capture-pane -t $s -p -S -5 2>/dev/null; done")CLAUDE.md。使用它来持久化项目上下文:.test.ts 后缀命名"。具体的指令可以减少纠错循环。.claude/rules/*.md — 团队共享,git 跟踪~/.claude/rules/*.md — 个人,全局.md 文件都作为额外上下文加载。这比将所有内容塞进单个 CLAUDE.md 更整洁。~/.claude/projects/<project>/memory/ 中。.claude/agents/(项目)、~/.claude/agents/(个人)中定义专用 agent,或通过 --agents CLI 标志(会话)定义:.claude/agents/ — 项目级,团队共享--agents CLI 标志 — 会话特定,动态~/.claude/agents/ — 用户级,个人@security-reviewer review the auth moduleterminal(command="claude --agents '{\"reviewer\": {\"description\": \"Reviews code\", \"prompt\": \"You are a code reviewer focused on performance\"}}' -p 'Use @reviewer to check auth.py'", timeout=120).claude/settings.json(项目)或 ~/.claude/settings.json(全局)中配置:{
"hooks": {
"PostToolUse": [{
"matcher": "Write(*.py)",
"hooks": [{"type": "command", "command": "ruff check --fix $CLAUDE_FILE_PATHS"}]
}],
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{"type": "command", "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -q 'rm -rf'; then echo 'Blocked!' && exit 2; fi"}]
}],
"Stop": [{
"hooks": [{"type": "command", "command": "echo 'Claude finished a response' >> /tmp/claude-activity.log"}]
}]
}
}| Hook | 触发时机 | 常见用途 |
|---|---|---|
UserPromptSubmit | Claude 处理用户 prompt 之前 | 输入验证、日志记录 |
PreToolUse | 工具执行之前 | 安全门控、阻止危险命令(exit 2 = 阻止) |
PostToolUse | 工具完成之后 | 自动格式化代码、运行 linter |
Notification | 权限请求或等待输入时 | 桌面通知、告警 |
Stop | Claude 完成响应时 | 完成日志记录、状态更新 |
SubagentStop | 子 agent 完成时 | Agent 编排 |
PreCompact | 上下文记忆被清除之前 | 备份会话转录 |
SessionStart | 会话开始时 | 加载开发上下文(例如 git status) |
| 变量 | 内容 |
|---|---|
CLAUDE_PROJECT_DIR | 当前项目路径 |
CLAUDE_FILE_PATHS | 正在修改的文件 |
CLAUDE_TOOL_INPUT | 工具参数(JSON 格式) |
{
"PreToolUse": [{
"matcher": "Bash",
"hooks": [{"type": "command", "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE 'rm -rf|git push.*--force|:(){ :|:& };:'; then echo 'Dangerous command blocked!' && exit 2; fi"}]
}]
}# GitHub 集成
terminal(command="claude mcp add -s user github -- npx @modelcontextprotocol/server-github", timeout=30)
# PostgreSQL 查询
terminal(command="claude mcp add -s local postgres -- npx @anthropic-ai/server-postgres --connection-string postgresql://localhost/mydb", timeout=30)
# Puppeteer 用于 Web 测试
terminal(command="claude mcp add puppeteer -- npx @anthropic-ai/server-puppeteer", timeout=30)| 标志 | 作用域 | 存储位置 |
|---|---|---|
-s user | 全局(所有项目) | ~/.claude.json |
-s local | 此项目(个人) | .claude/settings.local.json(已 gitignore) |
-s project | 此项目(团队共享) | .claude/settings.json(git 跟踪) |
terminal(command="claude --bare -p 'Query database' --mcp-config mcp-servers.json --strict-mcp-config", timeout=60)--strict-mcp-config 忽略除 --mcp-config 以外的所有 MCP 服务器。@github:issue://123maxResultSizeChars 注解允许最多 500K 字符的大型输出export MAX_MCP_OUTPUT_TOKENS=50000 — 限制 MCP 服务器的输出以防止上下文泛滥stdio(本地进程)、http(远程)、sse(服务器发送事件)# 定期捕获以检查 Claude 是否仍在工作或等待输入
terminal(command="tmux capture-pane -t dev -p -S -10")❯ = 等待您的输入(Claude 已完成或正在提问)● 行 = Claude 正在主动使用工具(读取、写入、运行命令)⏵⏵ bypass permissions on = 状态栏显示权限模式◐ medium · /effort = 状态栏中的当前 effort 级别ctrl+o to expand = 工具输出被截断(可在交互模式中展开)/context 查看上下文使用情况的彩色网格。关键阈值:/compact/compact 或 /clear| 变量 | 效果 |
|---|---|
ANTHROPIC_API_KEY | 用于认证的 API key(OAuth 的替代方案) |
CLAUDE_CODE_EFFORT_LEVEL | 默认 effort:low、medium、high、max 或 auto |
MAX_THINKING_TOKENS | 限制思考 token 数量(设为 0 完全禁用思考) |
MAX_MCP_OUTPUT_TOKENS | 限制 MCP 服务器的输出(默认值不固定;例如设为 50000) |
CLAUDE_CODE_NO_FLICKER=1 | 启用备用屏幕渲染以消除终端闪烁 |
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB | 从子进程中清除凭据以提高安全性 |
--max-turns 以防止失控循环。大多数任务从 5-10 开始。--max-budget-usd 设置成本上限。注意:系统 prompt 缓存创建的最低成本约为 $0.05。--effort low(更快、更便宜)。复杂推理使用 high 或 max。--bare 以跳过插件/hook 发现开销。--allowedTools 限制为任务实际需要的工具(例如仅审查时使用 Read)。/compact 当上下文变大时。--model haiku(更便宜),复杂多步骤工作使用 --model opus。--fallback-model haiku 以优雅处理模型过载。--no-session-persistence 以避免在磁盘上积累已保存的会话。pty=true 可以工作,但 tmux 提供了 capture-pane 用于监控和 send-keys 用于输入,这对编排至关重要。--dangerously-skip-permissions 对话框默认为"No, exit" — 必须按 Down 再按 Enter 才能接受。Print 模式(-p)完全跳过此步骤。--max-budget-usd 最低约为 $0.05 — 仅系统 prompt 缓存创建就需要这么多。设置更低会立即报错。--max-turns 仅限 print 模式 — 在交互会话中被忽略。python 而非 python3 — 在没有 python 符号链接的系统上,Claude 的 bash 命令首次会失败,但它会自我纠正。--continue 查找当前工作目录 中最近的会话。--json-schema 需要足够的 --max-turns — Claude 必须先读取文件才能生成结构化输出,这需要多轮次。tmux kill-session -t <name> 清理。/commit)仅在交互模式下有效 — 在 -p 模式中,用自然语言描述任务。--bare 跳过 OAuth — 需要 ANTHROPIC_API_KEY 环境变量或设置中的 apiKeyHelper。/context 监控并主动使用 /compact。-p) — 更简洁,无需处理对话框,输出结构化workdir — 让 Claude 专注于正确的项目目录--max-turns — 防止无限循环和失控成本tmux capture-pane -t <session> -p -S -50 检查进度❯ 提示符 — 表示 Claude 正在等待输入(已完成或正在提问)--allowedTools — 将能力限制为任务实际需要的工具