Claude Code 可以在长任务完成或需要你做决定时推送到你的手机。你需要 Remote Control、Claude 应用,以及 /config 中的一个或两个推送开关。Notification 钩子不需要 Remote Control 也能使用。
收到提醒后,Macky 会把你 Mac 的终端搬到 iPhone 上,让你直接在会话里回复。
方式一:通过 Remote Control 推送
推送需要 Remote Control 处于激活状态。设置方法如下:
- 为 iOS 或 Android 安装 Claude 应用。
- 使用你在终端里运行 Claude Code 时所用的同一账号和组织登录。
- 应用询问时,允许通知。
- 用
claude remote-control启动 Remote Control,或在打开的会话中运行/remote-control。 - 运行
/config,启用 Push when Claude decides、Push when actions required,或两者都启用。
Push when Claude decides 覆盖主动提醒,例如任务完成。Push when actions required 覆盖权限提示和问题。你也可以在提示词中说:"notify me when the tests finish."
想自动连接,请使用 remoteControlAtStartup 设置。完整设置请参阅 Claude Code Remote Control。
方式二:Notification 钩子
Notification 是一个钩子事件,在 Claude Code 发送通知时触发。钩子保存在 ~/.claude/settings.json 中。下面的示例会在 Claude 需要权限时显示 macOS 横幅:
{"hooks":{"Notification":[{"matcher":"permission_prompt","hooks":[{"type":"command","command":"osascript -e 'display notification \"Claude Code needs your attention\" with title \"Claude Code\"'"}]}]}}matcher 接受以下值:
permission_promptidle_promptelicitation_dialogelicitation_url_dialogauth_success
idle_prompt 事件在 Claude 回复结束约 60 秒后、且你没有再输入任何内容时触发。在终端会话中,这些事件只在你似乎离开终端时才会触发。
有些博客说,用 curl 调用 ntfy.sh 或 Pushover 就能推送到手机应用。这些说法来自第三方文章,请自行测试。
在 iPhone 上回复 Claude
通知告诉你 Claude 正在等待。Macky 让你在 iPhone 上通过 Mac 上的真实 shell 进行操作。
在终端模式下,你可以连接到正在运行的会话,回复,然后断开。按键栏有 Esc、Tab 和 Ctrl,还有方向键。连接端到端加密,并且不会在你的网络上打开任何端口。

修复通知缺失
| 现象 | 修复方法 |
|---|---|
/config 中出现 "No mobile registered" | 打开手机上的 Claude 应用,让它刷新推送令牌。下次 Remote Control 连接时,警告会消失。 |
| 完全收不到推送 | 检查手机上的 Settings → Notifications → Claude。 |
| Android 上收不到推送 | 将 Claude 应用排除在电池优化之外。 |
| 你在 Mac 旁边时收不到推送 | Claude Code 在终端获得焦点时会跳过推送。如果存在 CLAUDE_CLIENT_PRESENCE_FILE,则不会发送推送。 |
一些第三方指南说,推送开关可能要先手动开启,iOS 专注模式也可能隐藏提醒。连接错误请参阅 Claude Code Remote Control not working。
保持 Mac 唤醒
只有会话仍在运行时才会收到提醒,所以要让 Mac 保持唤醒。请参阅 Mac 上的 caffeinate 或 合盖时让 MacBook 保持唤醒。
常见问题
Claude Code 有手机应用吗?
没有。Claude Code 没有单独的手机应用。Remote Control 和云端会话都会显示在 iOS 和 Android 版 Claude 应用的 Code 标签页中。
不用 Remote Control 也能收到 Claude Code 通知吗?
可以。在 Notification 中添加一个 ~/.claude/settings.json 钩子,让它在 Claude 需要注意时运行一条命令。有些博客说钩子可以调用 ntfy.sh 或 Pushover。官方文档没有提到这一点。
我在 Mac 旁边时为什么收不到推送?
当你正在输入或停留在已连接的终端上时,Claude Code 会跳过手机推送。设置 CLAUDE_CLIENT_PRESENCE_FILE 后,只要你在机器旁边,它都会跳过推送。
怎样在 Claude Code 完成任务时收到通知?
开启 Remote Control,在 /config 中启用推送开关,然后在提示词中说:"notify me when the tests finish"。任务完成后,Claude 就能推送到你的手机。