Claude Code 自动提醒配置:让 AI 主动找你,不再盯屏等待

Claude Code 自动提醒配置:让 AI 主动找你,不再盯屏等待

用 Claude Code 写代码时,有没有这种烦恼:

Claude 在后台跑任务时,你不知道它什么时候需要输入确认,什么时候完成,只能不停切回窗口刷新

这不仅打断工作流,还浪费时间,甚至可能错过最佳响应时机。

其实,Claude Code 自带的 hooks 机制,可以让它在需要你时主动通知你

无论你是在电脑前,还是走开了去喝咖啡,都能第一时间收到提醒。

今天我就分享两种高效通知方案:

  • macOS 系统通知(适合电脑前使用)
  • 企业微信通知(适合离开电脑时使用)

你可以二选一,也可以同时启用,实现无死角提醒


参考:

Get started with Claude Code hooks

Claude配置切换工具 (CCS)


1. 什么是 hooks?

Claude Code 的 hooks 类似"事件触发器",可以在特定时刻自动执行命令或脚本,比如:

  • Notification → Claude 需要你输入确认时触发
  • Stop → Claude 完成任务时触发

有了 hooks,我们就能把这些事件绑定到 系统通知IM 消息推送,做到即时提醒。


2. 一步到位的完整配置

下面是包含 macOS terminal-notifier企业微信 Webhook 两种通知方式的 hooks 配置。

你可以按需选择(保留一段或两段都保留)。

arduino 复制代码
{
  "hooks": {
    // ===== Notification:Claude 需要输入确认时触发 =====
    "Notification": [
      {
        "hooks": [
          {
            "type": "command",
            // macOS 系统通知版(需先安装:brew install terminal-notifier)
            "command": "terminal-notifier -message '需要您的输入确认...' -title 'Claude Code' -sender com.apple.Terminal"
          }
        ]
      },
      {
        "hooks": [
          {
            "type": "command",
            // 企业微信 Webhook 版
            // ⚠ 替换 xxxxx 为你的企业微信 Webhook key
            "command": "curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"Claude Code:需要您的输入确认..."}}'"
          }
        ]
      }
    ],

    // ===== Stop:Claude 任务完成时触发 =====
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            // macOS 系统通知版
            "command": "terminal-notifier -message '已完成,请检查结果' -title 'Claude Code' -sender com.apple.Terminal"
          }
        ]
      },
      {
        "hooks": [
          {
            "type": "command",
            // 企业微信 Webhook 版
            // ⚠ 替换 xxxxx 为你的企业微信 Webhook key
            "command": "curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"Claude Code:任务已完成,请检查结果"}}'"
          }
        ]
      }
    ]
  }
}

3. 使用方法

macOS 系统通知

  1. 安装通知工具:

    复制代码
    brew install terminal-notifier
  2. 保留配置中的 terminal-notifier 部分

  3. Claude 需要你时,会在屏幕右上角弹出通知

企业微信通知

  1. 在企业微信群聊中添加"自定义机器人",获取 Webhook URL
  2. 替换配置中的 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 为你的 Webhook key
  3. Claude 触发时,手机企业微信会收到提醒

混合模式(双提醒)

两种通知方式可以同时启用:

  • 电脑前用系统通知 → 立即响应
  • 离开电脑用企业微信 → 随时收到消息

4. 总结

通过这套 hooks 配置,Claude Code 会主动找你 ,而不是你去找它。

无论你是在专注写代码、开会,还是悠闲喝咖啡,都能第一时间响应 AI 的请求。

高效工作,从"不再盯屏等待"开始。


我可以帮你在这个版本里加一张通知效果截图 + Claude Code 工作流示意图 ,这样博客的视觉冲击力会更强,读者会更有代入感。

你要我帮你画一张这样的图吗?这样会非常适合发在公众号和技术博客。

相关推荐
致Great19 分钟前
Chatgpt三周年了:大模型三年发展的里程碑
人工智能·chatgpt·agent
阿杰学AI29 分钟前
AI核心知识27——大语言模型之AI Agent(简洁且通俗易懂版)
人工智能·ai·语言模型·自然语言处理·aigc·agent·ai agent
AI大模型1 小时前
别再瞎学大模型了,这份GitHub神级课程火爆全网
程序员·llm·agent
AI大模型1 小时前
检索增强生成(RAG)与大语言模型微调(Fine-tuning)的差异、优势及使用场景详解
程序员·llm·agent
Mintopia3 小时前
🧩 Codex 配置自定义指令指南
人工智能·llm·claude
大模型真好玩4 小时前
Chatbox支持接入LangGraph智能体?一切都靠Trae Solo!
人工智能·agent·trae
用户479492835691514 小时前
Claude 总是泛泛而谈?试试给它装个"技能包",用 Skills 沉淀团队最佳实践
aigc·ai编程·claude
用户479492835691515 小时前
Claude 代码审查不好用?试试这个我花了一周优化的 Skill
agent·ai编程·claude
后端小肥肠1 天前
n8n+Coze+飞书:公众号对标文章一键录入+深度拆解,打造你的【爆款素材库】
人工智能·agent·coze
AI大模型1 天前
大模型开发实战篇3:函数调用FunctionCall
程序员·llm·agent