claude-code - 💡(How to fix) Fix Channels: messages not delivered to session during idle REPL [3 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48404Fetched 2026-04-16 07:01:07
View on GitHub
Comments
3
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×4commented ×3closed ×1cross-referenced ×1
RAW_BUFFERClick to expand / collapse

Problem

When a Claude Code session is idle (waiting for user input at the REPL prompt), incoming Telegram channel messages are queued but not delivered to the model until the next terminal interaction. This means:

  1. User sends a Telegram message → Claude doesn't see it
  2. User has to type something in the terminal to "wake up" the session
  3. Only then does Claude receive and respond to the TG message

This makes the Telegram channel unreliable for remote/async workflows — e.g., a founder traveling who wants to send instructions via Telegram while their machine runs Claude Code at home.

Expected behavior

Channel messages should interrupt the idle REPL and be delivered to the model in real-time, similar to how a user typing in the terminal triggers a response.

Reproduction

  1. Start Claude Code with --channels plugin:telegram@claude-plugins-official
  2. Pair a Telegram user
  3. Wait for the REPL to go idle (no active tool calls, just waiting for input)
  4. Send a message from Telegram
  5. Observe: message is not processed until something happens in the terminal

Suggested implementation approaches

  1. REPL interrupt on MCP notification: When the channel plugin sends notifications/claude/channel, the REPL could treat it like user input and wake the model to process it.

  2. Background polling loop: A lightweight periodic check (e.g., every 30-60s) that processes any queued channel notifications during idle.

  3. Event-driven wake: Register a callback on the MCP notification channel that signals the REPL's input loop to yield to the model.

Impact

This is a significant limitation for the Telegram channel's usefulness. The channel plugin itself works correctly (Grammy polling receives messages, MCP notification is sent), but the session layer doesn't process notifications during idle.

Users who rely on Telegram as their primary interface (e.g., mobile-only, traveling, managing servers remotely) experience this as "Claude randomly ignoring messages."

Environment

  • Claude Code on Windows 10, Bash shell
  • Telegram channel plugin v0.0.4
  • Channel messages arrive correctly when session is actively processing (tool calls running, etc.)

🤖 Generated with Claude Code

extent analysis

TL;DR

Implementing an interrupt mechanism for the REPL to process incoming Telegram channel messages during idle sessions is likely to resolve the issue.

Guidance

  • Investigate the feasibility of implementing a REPL interrupt on MCP notification as suggested, which could allow the REPL to treat incoming channel notifications like user input and wake the model to process them.
  • Consider adding a background polling loop to periodically check for queued channel notifications during idle sessions, ensuring that messages are processed in a timely manner.
  • Evaluate the event-driven wake approach, registering a callback on the MCP notification channel to signal the REPL's input loop to yield to the model, as a potential solution.
  • Verify that the channel plugin itself is working correctly and that the issue is indeed with the session layer not processing notifications during idle.

Example

No specific code snippet can be provided without further details on the implementation, but the solution might involve modifying the REPL's input handling to listen for MCP notifications and wake the model accordingly.

Notes

The exact implementation details will depend on the specific architecture and technologies used in Claude Code and the Telegram channel plugin. It's essential to ensure that any solution does not introduce performance issues or interfere with other aspects of the system.

Recommendation

Apply a workaround, such as implementing a background polling loop, as it seems to be a viable temporary solution until a more integrated interrupt mechanism can be developed and tested.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Channel messages should interrupt the idle REPL and be delivered to the model in real-time, similar to how a user typing in the terminal triggers a response.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING