Feature request: reliable interrupt/notification mechanism for inter-agent messaging
Problem
There is no reliable way to deliver a message to an active Claude Code session mid-conversation. We've built a multi-agent fleet coordination system (2 machines, multiple concurrent sessions) and tried every approach available:
Approaches tried
- PostToolUse hook (Edit|Write) — only fires on file edits. Agents doing research/reading are unreachable for minutes.
- PostToolUse hook (Read|Bash) — fires more often but
systemMessageinjection gets swallowed during active generation. The hook runs, acks the message, but the user/agent never sees it.
- Agent() subagent as background listener — works but wastes reasoning tokens on empty polls. 30-60s latency. Times out after 120s and needs manual re-launch.
- MCP server with
list_changednotification —notifications/tools/list_changedis not handled by Claude Code (ref: #13646, #4094, #2722). The notification fires into a void.
- Background Bash task — processes get killed when the Bash tool returns. Can't maintain a persistent polling loop.
- Daemon message relay — delivers messages to session inbox within 5 seconds. But no mechanism for the session to notice.
What we need
A way for an external process to reliably surface a message into an active Claude Code conversation within ~10 seconds. Specifically:
- Option A: Fix
list_changedhandling (#13646) — MCP servers could then push notifications that Claude Code actually processes.
- Option B: Add an
InboxorNotificationhook event — fires on a timer (e.g., every 10s) regardless of tool use, checks a configured endpoint/file, and injectssystemMessageif content is found.
- Option C: Allow PostToolUse
systemMessageto queue — if a hook returns a systemMessage during active generation, queue it for display after the current response completes, rather than swallowing it.
Use case
We have a Fleet Command SPA (web interface) where a human sends messages to agents from their phone via Tailscale. The coordination backbone (coord-api, Redis, session inboxes) delivers messages within 5 seconds. But the last mile — getting the message into the agent's conversation — fails because there's no interrupt mechanism.
This blocks: mobile fleet control, agent-to-agent real-time communication, human-in-the-loop approval workflows, and trading execution interfaces where latency matters.
Environment
- Claude Code on Windows (WSL) and native Windows
- Multiple concurrent sessions across machines
- coord-api (FastAPI) + Redis for message routing
- PostToolUse hooks for inbox checking
- MCP servers for tool integration
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗