命令字典
Slash 命令、CLI 子命令、Hook 事件、启动参数的字典与演进史。
Slash 命令、CLI 子命令、Hook 事件、启动参数的字典与演进史。
启动 Remote Control 服务器
claude remote-control [--name <name>]claude remote-control --name "My Project"claude remote-control 是 claude CLI 的一个子命令,用于启动一个 Remote Control 服务器:以服务器模式运行、不进入本地交互式会话,让你可以从 claude.ai/code 网页或 Claude 手机 App(iOS/Android)连接并控制这台机器上的 Claude Code。代码执行和文件系统访问始终留在本机,Remote Control 只是本地会话与远端界面之间的同步层。
官方文档明确将其与 --remote-control/--rc 参数区分开:
claude remote-control:独立子命令,服务器模式,没有本地交互式会话。claude --remote-control(或 --rc):在交互式会话中额外开启 Remote Control,本地终端照常可用。Remote Control 在所有方案下都可用;但在 Team 和 Enterprise 方案上默认关闭,需要 Owner 在 Claude Code 管理后台的设置中手动开启该开关后才能使用。
claude remote-control [--name <name>]
官方示例:
claude remote-control --name "My Project"
| Flag | 说明 |
|---|---|
--name, -n <name> | 设置会话的显示名称,会出现在 /resume 列表和终端标题中;之后可用 claude --resume <name> 恢复该会话。在交互式会话中,若本机已有同名的存活会话,Claude Code 会改用该名称的一个变体。 |
--remote-control-session-name-prefix <prefix> | 未显式指定 --name 时,自动生成会话名的前缀。默认值为本机主机名,生成形如 myhost-graceful-unicorn 的名称。也可通过环境变量 CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX 设置,效果相同。 |
服务器停止后,它此前承载的会话仍可被找回并恢复(官方文档称为"停止服务器后恢复会话",细节页面本次未能完整抓取,故不展开具体步骤)。
claude remote-control 和 claude --remote-control/--rc 搞混:前者是独立子命令,服务器模式、没有本地交互式会话;后者是给一个正常交互式会话追加开启 Remote Control,本地终端依旧可以直接对话。命令名相似但行为不同,官方 CLI 参考文档专门给出了这条区分说明。--name 撞名会得到变体名称:官方 CLI 参考写明,在交互式会话中,如果本机已有同名的存活会话,Claude Code 会改用该名称的一个变体;这条说明限定在交互式会话,不要默认它同样适用于 claude remote-control 服务器模式。修复未登录时 `claude remote-control --help` 不打印用法且不退出的问题。
修复通过该命令启动的会话中 PushNotification 误报 "Remote Control inactive" 的问题。
修复了在 HTTP 代理后注册失败和 macOS 空闲睡眠时中断的问题
修复了当组织策略关闭 Remote Control 时仍保持连接的问题
改进未信任文件夹的处理,现在请求 workspace trust 而非退出
修复了 `claude remote-control --debug` 失败并报"Unknown argument: --debug"错误的问题
修复 ListAgents 中显示生成名称而非会话标题的问题
修复 `claude remote-control` 在服务器凭据过期约 30 天后退出并断开所有附加会话的问题
添加了可选的 --name 参数来设置自定义会话标题(如 `claude remote-control --name 'My Project'`)。
修复了 npm installs 时 `claude remote-control` 崩溃的问题。
添加 remote-control 子命令用于外部构建