
Remote Control 不是把 Claude Code 云化,而是让手机和浏览器接管仍在本机运行的会话。本篇拆解它的三种启动方式、server mode 并发策略、安全边界、移动推送与使用限制。
claude.ai/code 或 Claude 手机 App 连接到一条正在你机器上运行的 Claude Code session;任务开始后,Claude 仍在本地运行,文件系统、MCP servers、工具和项目配置都留在本机,远端界面只是这条本地 session 的窗口。1| 你要做的事 | 更适合 |
|---|---|
| 继续一个本地已经跑起来的重构、测试、调试任务 | Remote Control |
需要沿用本机 .env、本地 MCP、私有脚本、未推送分支 | Remote Control |
| 想从零启动一个不用依赖本机环境的任务 | Claude Code on the web |
| 让 CI、Telegram、Discord 之类外部事件触发 Claude | Channels / Scheduled tasks |
claude --version 检查。1claude remote-control:开一个远程会话服务器claude remote-controlclaude remote-control \
--name "payments-debug" \
--spawn worktree \
--capacity 8 \
--sandbox--name:给远端 session 一个可识别标题。--spawn same-dir:默认模式,多个远端 session 共用当前目录,容易互相踩文件。--spawn worktree:每条 on-demand session 分到独立 git worktree,要求当前目录是 Git 仓库。--spawn session:单 session 模式,只服务一条远程会话,拒绝新增连接。--capacity:设置最大并发 session 数,默认 32,不能和 --spawn=session 一起用。--sandbox / --no-sandbox:开启或关闭文件系统与网络隔离;默认关闭。1claude --remote-control:本地和远端一起操作同一条交互会话claude --remote-controlclaude --remote-control "payments-refactor"claude.ai/code 或手机 App 里输入, conversation 会同步。1/remote-control:把已经进行中的会话接到远端/remote-control/rc--verbose、--sandbox、--no-sandbox 这些 CLI flag。VS Code 扩展里也支持 /remote-control 或 /rc,要求 Claude Code v2.1.79 或更高版本;VS Code 版本不会显示 QR code,也不接受 name 参数。1notify me when the tests finish/config,打开 Push when Claude decides、Push when actions required,或两者都开。1CLAUDE_CLIENT_PRESENCE_FILE 指向一个 marker file;当这个文件存在时,即使你在另一个窗口,推送也会被跳过。1claude 并用 /login 登录。还要在项目目录里至少运行过一次 Claude Code,接受 workspace trust dialog。1cd /path/to/repo
claude
# inside Claude Code: /login if neededclaude --remote-control "repo-name-task-name"/rc repo-name-task-name--spawn=worktreeclaude remote-control --spawn worktree --capacity 4same-dir 默认模式会让多个 session 操作同一 working directory。对代码修改来说,这种冲突不够隐蔽:两个任务都能成功跑一半,最后把 diff 搅在一起。worktree 模式至少把文件层面隔开。1--sandbox 在 Remote Control server mode 里不是默认开启。只要远端任务可能跑 Bash、访问网络、生成文件,建议先开:claude remote-control --spawn worktree --sandboxclaude 进程,session 就结束。机器醒着但网络断开超过大约 10 分钟,session 也会超时并退出。1/plugin 和 /resume。远端可用的多是文本输出型命令,例如 /compact、/clear、/context、/usage、/recap、/reload-plugins;/mcp 从 v2.1.166 起在远端返回 server 状态文本并支持部分子命令;/config 从 v2.1.181 起可以用 key=value 改单个设置,或者不带参数列出可设置的 key。1cd ~/work/payments
claude --remote-control "payments: checkout timeout"Read the failing checkout tests, inspect the recent diff, propose a plan before editing. Notify me when you need approval or when tests finish.claude remote-control --name "payments remote queue" --spawn worktree --capacity 4 --sandboxThis story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.