Loading...
Loading...
Compare original and translation side by side
| Parameter | Default |
|---|---|
| Model selection | Use Claude Code CLI default unless the user explicitly asks for |
| Effort | Use CLI default unless the user explicitly asks for |
| Permission mode | |
| Headless mode | |
| CI / scripted run | Add |
| Resume target | |
| 参数 | 默认值 |
|---|---|
| 模型选择 | 除非用户明确要求使用 |
| 工作力度 | 除非用户明确要求使用 |
| 权限模式 | |
| 无头模式 | |
| CI/脚本化运行 | 添加 |
| 恢复目标 | 当前目录中最新会话使用 |
claudeclaudeclaudeclaudeclaudeauth-refactorclaude --bare -pclaudeclaudeauth-refactorclaude --bare -pclaude-p--print-p-pundefined-p--print-p-pundefined
`-p` is the canonical SDK/CI entrypoint. The CLI was previously called "headless mode"; the `-p` flag is unchanged.
`-p`是标准的SDK/CI入口点。该CLI之前被称为“无头模式”;`-p`标志保持不变。--bareANTHROPIC_API_KEYANTHROPIC_AUTH_TOKENapiKeyHelper--settingsANTHROPIC_API_KEY=$KEY claude --bare -p "Summarize the diff" --allowedTools "Read"claude setup-tokenCLAUDE_CODE_OAUTH_TOKENCLAUDE_CODE_OAUTH_TOKENANTHROPIC_API_KEYapiKeyHelper--bare--bareANTHROPIC_API_KEYANTHROPIC_AUTH_TOKEN--settingsapiKeyHelperANTHROPIC_API_KEY=$KEY claude --bare -p "Summarize the diff" --allowedTools "Read"claude setup-tokenCLAUDE_CODE_OAUTH_TOKENCLAUDE_CODE_OAUTH_TOKEN--bareANTHROPIC_API_KEYapiKeyHelper| Flag | When to use |
|---|---|
| General Claude Code usage with normal approval prompts |
| Read-only analysis or planning with no file changes or shell execution |
| The user explicitly wants Claude Code to write files (also auto-approves common filesystem commands like |
| Long autonomous tasks where prompt fatigue matters; a server-side classifier blocks risky actions but does not replace review |
| Locked-down CI: only |
| Containers / VMs only — equivalent to |
| 标志 | 使用场景 |
|---|---|
| 带有正常批准提示的常规Claude Code使用 |
| 只读分析或规划,不修改文件或执行shell命令 |
| 用户明确希望Claude Code写入文件(也会自动批准常见的文件系统命令,如 |
| 长期自主任务,避免提示疲劳;服务器端分类器会阻止危险操作,但不能替代人工审核 |
| 锁定的CI环境:仅允许 |
| 仅适用于容器/虚拟机——等同于 |
claude --permission-mode default -p "your prompt here"--model <model>--effort <level>--output-formattexttextjsonstream-json--output-format json--json-schema '<JSON Schema>'--max-turns <N>--max-budget-usd <dollars>--fallback-model <name>--add-dir <path>--add-dir.claude/.claude/skills/--allowedTools--disallowedTools--tools--tools ""--tools "default""Bash,Edit,Read"--append-system-prompt--append-system-prompt-file--system-prompt--system-prompt-file--mcp-config <file-or-json>--strict-mcp-config--dangerously-skip-permissions--permission-mode acceptEditsclaude --permission-mode default -p "your prompt here"--model <model>--effort <level>text--output-formattextjsonstream-json--output-format json--json-schema '<JSON Schema>'--max-turns <N>--max-budget-usd <dollars>--fallback-model <name>--add-dir <path>--add-dir.claude/.claude/skills/--allowedTools--disallowedTools--tools--tools ""--tools "default""Bash,Edit,Read"--append-system-prompt--append-system-prompt-file--system-prompt--system-prompt-file--mcp-config <file-or-json>--strict-mcp-config--dangerously-skip-permissions--permission-mode acceptEditsundefinedundefined
Use `--continue` for the latest conversation in the current directory.
Use `--resume` for a specific session by **ID or by display name** (set with `--name` / `-n`, or by `/rename` mid-session).
Use `--session-id` only with a real UUID — the CLI rejects other strings.
When resuming, keep the existing session's behavior unless the user explicitly asks to change the model, effort, or permission mode.
Add `--fork-session` only when the user wants to branch from the existing session instead of reusing it.
使用`--continue`恢复当前目录中的最新对话。
使用`--resume`通过**ID或显示名称**恢复特定会话(通过`--name`/`-n`设置,或在会话中使用`/rename`设置)。
仅当使用真实UUID时才使用`--session-id`——CLI会拒绝其他字符串。
恢复会话时,保持现有会话的行为,除非用户明确要求更改模型、工作力度或权限模式。
仅当用户希望从现有会话分支而非重用时,添加`--fork-session`。claude --continue-cclaude --resume <id-or-name>-rclaude --from-pr <pr>claude --continue-cclaude --resume <id-or-name>-rclaude --from-pr <pr>CLAUDE_CODE_USE_BEDROCK_VERTEX_FOUNDRYANTHROPIC_AUTH_TOKENANTHROPIC_API_KEYapiKeyHelperCLAUDE_CODE_OAUTH_TOKEN/loginclaudeclaude auth login--console--ssoclaude auth status/statusclaude auth logout/logoutclaude setup-tokenCLAUDE_CODE_OAUTH_TOKEN--bareANTHROPIC_API_KEYX-Api-KeyANTHROPIC_AUTH_TOKENAuthorization: BearerCLAUDE_CODE_USE_BEDROCK_VERTEX_FOUNDRYANTHROPIC_AUTH_TOKENANTHROPIC_API_KEYapiKeyHelperCLAUDE_CODE_OAUTH_TOKEN/loginclaudeclaude auth login--console--ssoclaude auth status/statusclaude auth logout/logoutclaude setup-tokenCLAUDE_CODE_OAUTH_TOKENANTHROPIC_API_KEYX-Api-KeyANTHROPIC_AUTH_TOKENAuthorization: Bearercommand not found: claudeclaude install stableunset ANTHROPIC_API_KEYclaude auth loginclaude auth status--permission-modeplanacceptEdits--allowedTools--disallowedTools--dangerously-skip-permissionsclaude --resumeclaude --continue--session-iddefaultacceptEditsclaude --helpclaude --helpcommand not found: claudeclaude install stableunset ANTHROPIC_API_KEYclaude auth loginclaude auth status--permission-modeplanacceptEdits--allowedTools--disallowedTools--dangerously-skip-permissionsclaude --resumeclaude --continue--session-iddefaultacceptEditsclaude --helpclaude --help