Telegram plugin: --print fallback silently fails with empty stdin, causing 57K+ error log spam

Resolved 💬 2 comments Opened Apr 1, 2026 by Manzojunior Closed May 8, 2026

Bug Description

When an interactive Claude Code session ends (crash, context limit, etc.), the Telegram plugin falls back to --print mode to handle incoming messages. However, this fallback consistently fails because the message content is not properly passed via stdin.

Error

Error: Input must be provided either through stdin or as a prompt argument when using --print

This single error repeated 57,084 times in ~/.claude/channels/telegram/claude-telegram.err, growing the log to 5.3MB.

Impact

  1. Complete loss of Telegram responsiveness — when the interactive session ends, the bot becomes completely unresponsive. No messages are processed.
  2. Unbounded error log growth — the same error is retried indefinitely with no backoff, rate limit, or log rotation. The .err file grows until manually cleared.
  3. No notification to user — the user has no way to know the bot is down until they notice the silence.

Expected Behavior

  • The --print fallback should correctly pass the Telegram message content to Claude Code via stdin or as a prompt argument
  • Failed attempts should have exponential backoff to prevent log spam
  • Error log should have rotation or size limits
  • Ideally, the user should be notified (e.g., a Telegram message saying "session ended, restart needed")

Environment

  • Claude Code: 2.1.89
  • Platform: macOS (Darwin 25.4.0)
  • Telegram plugin: telegram@claude-plugins-official

Reproduction

  1. Start Claude Code with Telegram plugin enabled
  2. Have an active interactive session receiving Telegram messages
  3. End the interactive session (close terminal, context limit hit, etc.)
  4. Send a Telegram message to the bot
  5. Observe ~/.claude/channels/telegram/claude-telegram.err filling with the error

Suggested Fix

In the Telegram plugin's message handler, ensure the message body is piped to claude --print via stdin or passed as a positional argument. Add retry backoff and log rotation as defensive measures.

---
🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗