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
- Complete loss of Telegram responsiveness — when the interactive session ends, the bot becomes completely unresponsive. No messages are processed.
- Unbounded error log growth — the same error is retried indefinitely with no backoff, rate limit, or log rotation. The
.errfile grows until manually cleared. - No notification to user — the user has no way to know the bot is down until they notice the silence.
Expected Behavior
- The
--printfallback 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
- Start Claude Code with Telegram plugin enabled
- Have an active interactive session receiving Telegram messages
- End the interactive session (close terminal, context limit hit, etc.)
- Send a Telegram message to the bot
- Observe
~/.claude/channels/telegram/claude-telegram.errfilling 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
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗