如何让Claude Code 写完/等你的时候 给你通知Windows版完美解决 Stop hook error: Failed with non-blocking status code: /usr/bin/bash: line 1: C:WindowsSystem32WindowsPowerShellv1.0powershell.exe: command not found

Author
玄易同志
作者
2026-04-15
发布时间
AI综合
分类
需要准备 Git 这个 是必要的

然后下载脚本
我用夸克网盘给你分享了「windows-notification.ps1」,点击链接或复制整段内容,打开「夸克APP」即可获取。
/~bdb33Y9gpc~:/
链接:https://pan.quark.cn/s/5d7e91f16ee5

放在 .claude/hooks
其实放哪里都行只要 下面在
settings.json中设置的 路径能找到都行别弄丢了

PLAINTEXT
"hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -File \"C:/Users/SmallXY/.claude/hooks/windows-notification.ps1\" -Title \"Claude Code\" -Message \"任务已完成\"",
            "timeout": 10
          }
        ]
      }
    ],
    "Notification": [
      {
        "matcher": "permission_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -File \"C:/Users/SmallXY/.claude/hooks/windows-notification.ps1\" -Title \"Claude Code\" -Message \"需要权限审批\"",
            "timeout": 10
          }
        ]
      },
      {
        "matcher": "idle_prompt",
        "hooks": [
          {
            "type": "command",
            "command": "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -ExecutionPolicy Bypass -File \"C:/Users/SmallXY/.claude/hooks/windows-notification.ps1\" -Title \"Claude Code\" -Message \"等待你的输入\"",
            "timeout": 10
          }
        ]
      }
    ]
  },