Which Session Is Waiting for Me? Claude Code Hooks on a Stream Deck
说明与用途
在 Claude Code 中同时运行多个会话会导致难以跟踪状态和权限请求。通过使用 Stream Deck Neo 显示每个会话的状态(彩色键和像素艺术图标),作者可以快速将会话窗口置顶并批准请求,从而节省时间。
问题
Multiple Claude Code sessions run simultaneously, making it hard to notice when a session asks for permission or finishes, leading to wasted time switching windows.
结果
The Stream Deck display reduces the time spent hunting for session windows and ensures the user notices permission requests and completion states promptly.
工作流
- 1. Install Claude Code hooks that emit events to a small JSON file per session.
- 2. Write a script that maps hook events to four states (running, ask, waiting, idle).
- 3. Store the JSON file (folder, session, state) without prompt or output data.
- 4. Create a Stream Deck plugin that reads the JSON files every second and colors the keys accordingly.
- 5. Press a key to bring the corresponding session window to the front and approve any permission prompt.
- 6. Handle edge cases: retry file rename on Windows to avoid EPERM errors, remove old records after /clear, map old‑ID to new‑ID.
证据
I put the state of each session on a small button box on my desk (a Stream Deck Neo: 8 keys and a thin info bar).
The hook writes to a temp file and renames it over the real one. The plugin reads that file every second. On Windows, if the rename lands at the exact moment the plugin is reading, the rename can fail with EPERM.
Pressing a key brings that session's window to the front. See red, press it, approve in that window. No more hunting.
- 记录日期: 2026-10-24T04:26:13.298Z