[FEATURE] Mods: a way to alert the user in the active window about events in another Claude Code window
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I built a mod (usage-board) from the "Getting started with Claude Code mods" guide. It shows a live band above the prompt with this window's context usage, my plan limits, and the context percent of my other open windows (each window writes to a shared file every 10 seconds, and every window reads the others').
I often run several projects in parallel. A long task in a background window can fill its context while I'm working in another window, and I only notice if I switch to it. A mod can show the numbers, but as far as I can tell it has no way to alert me in the window I'm currently using about something happening in a different window.
#99306 notes that $.ui.toast only shows inside the TUI. I haven't found documentation saying whether a toast can reach a different window or session. The best workaround I can see is for every window to read a shared file and raise its own toast, which only works for windows that run the mod and are visible at that moment.
Proposed Solution
A way for a mod to notify the user in whichever window they are currently using about an event in another Claude Code window or session. For example, a $.ui.toast (or similar) that can target another window, or all windows, so that a monitoring mod can warn: "project X is at 90% context".
This is separate from #99306, which asks for native/OS notifications. Cross-window targeting would help even when the user is looking at Claude Code, and the two ideas could share the same notification path.
Alternative Solutions
Each window reads a shared file and raises its own toast. This only reaches windows that run the mod and are in front of me, and it means every mod author has to rebuild the same cross-window plumbing.
Related: #99306 (native notification from a mod) and #94424 (an event when session usage or a rate-limit window changes, so trackers don't have to poll). Both would help a usage-monitoring mod, but neither lets one window alert me about another.
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- Window A (project 1) is running a long refactor.
- I'm working in window B (project 2).
- Window A's context reaches 90%.
- I get a notification in window B naming project 1, so I can compact or restart it before it degrades.
The same pattern would work for the weekly plan limit passing a threshold.
Additional Context
Question I couldn't answer from the mods guide: can $.ui.toast reach another window or session today? If it can, a docs note would be enough.
Environment: Claude desktop app on macOS, mod loaded via CLAUDE_CODE_PLUGIN_DIRS.