Skip to content

About

claude任务完成时闪烁

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Claude Code Taskbar Flash

English | 中文


English

What it does

Automatically flashes the Windows taskbar icon when Claude Code finishes responding, so you can step away during long tasks and know exactly when to come back.

How it works

  • Uses Claude Code's Stop hook to trigger a PowerShell script on response completion
  • Calls Windows API FlashWindowEx to flash the terminal's taskbar button
  • Smart detection: checks if the terminal is in the foreground or background
    • Foreground → flashes 5 times (brief reminder)
    • Background → keeps flashing until you switch back

Quick Install

一句话安装(推荐)

直接告诉 Claude Code:

帮我从 https://github.com/chen1guan/claude-code-taskbar-flash 安装任务栏闪烁功能

Claude 会自动:下载 skill → 复制脚本 → 配置 hook → 验证。全部一步完成。

如果 Claude 没有自动执行配置,补充一句:/taskbar-flash

Option B: Manual install

  1. Copy skills/taskbar-flash/references/flash-terminal.ps1 to ~/.claude/flash-terminal.ps1

  2. Add the Stop hook to ~/.claude/settings.json:

{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\<your-username>\\.claude\\flash-terminal.ps1\""
          }
        ]
      }
    ]
  }
}
  1. Restart Claude Code and test.

Requirements

  • Windows 10/11
  • PowerShell 5.1+
  • Claude Code CLI

Supported Terminals

Terminal Support
Windows Terminal ✅ Best experience
cmd.exe ✅
PowerShell window ✅
VS Code integrated terminal ⚠️ Flashes VS Code window

Troubleshooting

Check the log file at ~/.claude/flash-hook.log:

Get-Content "$env:USERPROFILE\.claude\flash-hook.log" -Tail 5
  • No log entries → Hook format is wrong in settings.json. Must use nested {matcher, hooks[{type, command}]} format.
  • HWND is 0 → Cannot find terminal window. Make sure you're running in a supported terminal.
  • Result: False → Invalid window handle. Try restarting the terminal.

中文

这是什么

Claude Code 回复完成后,自动闪烁 Windows 任务栏图标。长时间任务等待时,你可以放心去做别的事情,完成时立刻知道。

工作原理

  • 利用 Claude Code 的 Stop hook,回复完成时触发 PowerShell 脚本
  • 通过 Windows API FlashWindowEx 闪烁终端窗口的任务栏按钮
  • 智能策略:自动检测窗口前后台状态
    • 前台(正在看)→ 闪 5 次
    • 后台(切走了)→ 持续闪烁直到切回

快速安装

一句话安装(推荐)

直接告诉 Claude Code:

帮我从 https://github.com/chen1guan/claude-code-taskbar-flash 安装任务栏闪烁功能

Claude 会自动:下载 skill → 复制脚本 → 配置 hook → 验证。全部一步完成。

如果 Claude 没有自动执行配置,补充一句:/taskbar-flash

手动安装

  1. 将 skills/taskbar-flash/references/flash-terminal.ps1 复制到 ~/.claude/flash-terminal.ps1

  2. 在 ~/.claude/settings.json 中添加 Stop hook:

{
  "hooks": {
    "Stop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "powershell.exe -NoProfile -ExecutionPolicy Bypass -File \"C:\\Users\\<你的用户名>\\.claude\\flash-terminal.ps1\""
          }
        ]
      }
    ]
  }
}
  1. 重启 Claude Code 测试。

环境要求

  • Windows 10/11
  • PowerShell 5.1+
  • Claude Code CLI

排查问题

查看日志文件 ~/.claude/flash-hook.log:

Get-Content "$env:USERPROFILE\.claude\flash-hook.log" -Tail 5
现象 原因 解法
没有日志 Hook 格式错误 检查 settings.json 是否用嵌套格式
HWND 为 0 找不到终端窗口 确认在受支持的终端中运行
Result: False 窗口句柄无效 重启终端
一直闪烁不停 用了 FLASHW_TIMER 标志 确保脚本用的是 FLASHW_ALL | FLASHW_TIMERNOFG
完全不闪烁 用了 FLASHW_TIMERNOFG 且窗口在前台 脚本需要 GetForegroundWindow() 判断前后台

License

MIT

About

claude任务完成时闪烁

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages