Oo0Leo0oO

Claude Code Windows Toast Focus — Development skill for Claude Code

Development community

Windows Toast notifications with click-to-focus terminal activation for Claude Code hooks.

How to install Claude Code Windows Toast Focus

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Oo0Leo0oO/claude-code-windows-toast-focus and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Windows Toast Focus does

Windows Toast notifications with click-to-focus terminal activation for Claude Code hooks.

Alternatives in Development

  • Claude Notifications Go — Cross-platform smart notifications -- 6 types, click-to-focus, context analysis, webhooks 365 ★
  • Device Control Agent — You are an autonomous macOS agent with full control of this device via two CLI tools: - steer — GUI automation 250 ★
  • Evox Short — CEO → EVOX: The Loop + Opus 4.6 Activation 104 ★

README

Claude Code Windows Toast Focus

Claude Code Windows Toast Focus 是一组 Windows PowerShell hooks,用于解决多个命令行窗口运行Claude code时的动态通知运行情况,给 Claude Code 增加更接近桌面应用的通知体验:

  • Claude Code 等待输入时弹出 Windows Toast
  • 需要权限确认时弹出 Windows Toast
  • 任务完成时弹出 Windows Toast
  • 点击通知本体后,通过 claude-focus:// 协议回到对应的 PowerShell / PowerShell 7 / Windows Terminal 窗口
  • 记录窗口状态,优先按 hwnd、PID、标题匹配激活窗口
  • 对 idle_prompt 做去重,避免任务完成后反复提示“等待你的输入”

适用环境

  • Windows 10 / Windows 11
  • Windows PowerShell 5.1 或 PowerShell 7
  • Claude Code hooks
  • BurntToast PowerShell 模块

首次发送通知时,如果没有安装 BurntToast,脚本会提示并执行:

Install-Module BurntToast -Scope CurrentUser -Force

文件说明

scripts/
  install.ps1        安装 hooks、注册协议、合并 settings.json
  notify.ps1         发送 Toast,记录窗口状态,处理去重
  focus-window.ps1   根据 sid 激活对应终端窗口
  register-uri.ps1   注册 claude-focus:// 协议
  uninstall-uri.ps1  只移除 claude-focus:// 协议
assets/
  claude-toast.png   可选通知图标
examples/
  settings-hooks.example.json

运行时会使用用户目录下的:

%USERPROFILE%\.claude\hooks\
%USERPROFILE%\.claude\settings.json

安装

在项目根目录运行:

powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\scripts\install.ps1"

安装脚本会:

  • 创建 %USERPROFILE%\.claude\hooks
  • 复制 notify.ps1、focus-window.ps1、register-uri.ps1
  • 如果存在 assets\claude-toast.png,复制为 hook 图标
  • 备份 %USERPROFILE%\.claude\settings.json 到 settings.json.bak
  • 解析 JSON,失败则停止且不写入
  • 只合并或补充 hooks 字段,保留其他配置
  • 注册 claude-focus:// 协议到当前用户注册表

手动测试

powershell.exe -ExecutionPolicy Bypass -File "$env:USERPROFILE\.claude\hooks\register-uri.ps1"
powershell.exe -ExecutionPolicy Bypass -File "$env:USERPROFILE\.claude\hooks\notify.ps1" -Message "等待你的输入" -Type input
powershell.exe -ExecutionPolicy Bypass -File "$env:USERPROFILE\.claude\hooks\notify.ps1" -Message "需要权限确认" -Type permission
powershell.exe -ExecutionPolicy Bypass -File "$env:USERPROFILE\.claude\hooks\notify.ps1" -Message "任务已完成" -Type done