claude-code

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Claude Code

Claude Code

Options and boundaries

选项与边界

Default:
claude --print --output-format text "<prompt>"
from the target directory; permission mode and model omitted; parent wait 15m. "Read-only" / "plan" adds
--permission-mode plan
; print alone can write. "Use <model>" adds
--model
. "Interactive" / "TUI" omits
--print
. "Resume <id>" adds
--resume
; "continue" adds
--continue
; both block. "Worktree [name]" adds
--worktree [name]
; record the emitted path. "JSON" / "stream-json" selects that print output. Missing needed values or conflicting options are
BLOCKED
.
Permissions remain when print skips the trust dialog. A named waiver is required for skip-permissions, bypassPermissions, dontAsk, auto, or allow-dangerously-skip-permissions. Before using one, or when a print permission prompt appears, follow
references/permissions.md
; recovery does not invent a bypass.
claude help
starts a session: use
claude --help
.
remote-control
is not documentation.
默认:在目标目录执行
claude --print --output-format text "<prompt>"
;省略权限模式和模型;父进程等待15分钟。 「只读」/「计划」模式会添加
--permission-mode plan
参数;仅使用 print 参数时允许写入操作。 「使用 <model>」会添加
--model
参数。「交互式」/「TUI」模式会省略
--print
参数。 「恢复 <id>」会添加
--resume
参数;「继续」会添加
--continue
参数;二者均为阻塞式操作。 「工作树 [名称]」会添加
--worktree [name]
参数;需记录输出的路径。 「JSON」/「流式JSON」会选择对应的打印输出格式。缺少必要参数或选项冲突时会被标记为
BLOCKED
。
当 print 参数跳过信任对话框时,权限规则仍然生效。使用 skip-permissions、bypassPermissions、dontAsk、auto 或 allow-dangerously-skip-permissions 参数需要对应的豁免声明。在使用上述参数前,或出现 print 权限提示时,请遵循
references/permissions.md
的规定;恢复流程不会自行生成权限绕过方式。
claude help
会启动一个会话:请使用
claude --help
。
remote-control
不属于文档范畴。

1. Resolve

1. 解析

Fix absolute workspace, prompt, mode, session, worktree, output, and wait. Check binary and
claude auth status --text
without exposing secrets. Missing binary → follow
references/install.md
; missing auth →
BLOCKED
unless login was requested. Wrong cwd blocks. Record
cmd | workspace | mode | session | worktree | waiver | wait | evidence | terminal
. Done when target, binary, auth, and authorized options are fixed.
确定绝对工作区、提示词、模式、会话、工作树、输出和等待时间。 在不泄露密钥的前提下检查二进制文件是否存在,并执行
claude auth status --text
命令验证状态。 缺少二进制文件 → 遵循
references/install.md
;缺少认证信息 → 返回
BLOCKED
,除非用户请求登录。cwd 错误会导致阻塞。 记录
cmd | workspace | mode | session | worktree | waiver | wait | evidence | terminal
信息。 当目标、二进制文件、认证信息和授权选项全部确认后,该步骤完成。

2. Run

2. 运行

Build argv from those options and quote the prompt literally. Default text is quiet until process exit; silence is not a hang. Wait for exit or the recorded deadline, and kill only this run's PID when that deadline expires. Nonzero exit: capture stderr, inspect the tree, and report
BLOCKED
.
For JSON/stream output, follow
references/streaming.md
. For resume, continue, or background sessions, follow
references/sessions.md
. For worktrees or parallel runs, follow
references/worktrees.md
. For an asked-for TUI or management command, follow
references/management.md
. A rejected flag requires scoped
--help
, not a guessed replacement. Done when the process exits, an intended live handle is recorded, or a permission/authorization gate is reported.
根据上述选项构建 argv,并按字面意思引用提示词。默认文本模式下,进程退出前不会产生输出;静默不代表程序挂起。等待进程退出或达到记录的截止时间,截止时间到期时,仅终止本次运行对应的 PID。 进程非零退出时:捕获 stderr 输出,检查目录树结构,并报告
BLOCKED
。
对于 JSON/流式输出,请遵循
references/streaming.md
。对于恢复、继续或后台会话,请遵循
references/sessions.md
。 对于工作树或并行运行,请遵循
references/worktrees.md
。 对于请求的 TUI 或管理命令,请遵循
references/management.md
。 如果某个标志参数被拒绝,应使用对应范围的
--help
查看用法,而非猜测替代参数。 当进程退出、记录了预期的活动句柄,或报告遇到权限/授权关卡时,该步骤完成。

3. Verify and report

3. 验证与报告

Inspect status and diff; CLI text is not proof. Run the narrowest covering tests for edited executable code. Plan mode must leave the tree unchanged. Verify each worktree and any integrated tree. Clean up only this run's sessions/worktrees unless explicitly kept; preserve auth, MCP, and plugins. Report command, mode, session/worktree, waiver, wait, and outcome evidence. Done when every requested outcome is observed or a blocker is evidenced.
Terminals:
SUCCESS
,
NO_CHANGES
,
BLOCKED
,
AWAITING_USER
.
检查状态和差异;CLI 的文本输出不能作为有效证明。针对编辑过的可执行代码运行最小覆盖范围的测试。计划模式必须保证目录树无任何变更。 验证每个工作树和所有集成的目录树。除非明确要求保留,否则仅清理本次运行产生的会话/工作树;保留认证信息、MCP 配置和插件。 报告命令、模式、会话/工作树、豁免声明、等待时间和结果证据。 当所有预期结果都已观察到,或证实存在阻塞因素时,该步骤完成。
终止状态:
SUCCESS
、
NO_CHANGES
、
BLOCKED
、
AWAITING_USER
。