[BUG] Multiple sessions load Telegram channel plugin simultaneously, causing message competition
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using the Telegram channel plugin, every new Claude Code CLI session automatically loads the Telegram MCP plugin as a global plugin (from ~/.claude/plugins/), even if the session was NOT started with --channels plugin:telegram@claude-plugins-official.
This means multiple sessions compete for the same Telegram Bot API messages simultaneously, which can cause:
- Missed messages (one session consumes the message before the other)
- - Duplicate responses
- - - Unpredictable behavior
Steps to reproduce:
- Install the Telegram plugin from the marketplace
- 2. Start a Claude Code session with
--channels plugin:telegram@claude-plugins-official - 3. Open another Claude Code session normally (just
claude) - 4. Observe that both sessions spawn a
bun run ... telegram ... startsubprocess - 5. Both sessions now have Telegram MCP capability and may compete for incoming messages
Environment:
- Claude Code version: 2.1.90
- - OS: macOS (Darwin 24.5.0)
- - - The Telegram plugin subprocess can be observed via
ps aux | grep telegram
What Should Happen?
Channel-type plugins (like Telegram) should only be active in sessions that explicitly opt in via --channels. Sessions started without --channels should NOT load channel plugins, even if they are installed globally.
Alternatively, there should be a locking mechanism to ensure only one session at a time can consume messages from a given channel plugin, preventing message competition between multiple sessions.
Error Messages/Logs
Steps to Reproduce
- Install the Telegram plugin from the Claude Code plugin marketplace
- 2. Start a session with:
claude --channels plugin:telegram@claude-plugins-official - 3. In a separate terminal, start another session with just:
claude - 4. Run
ps aux | grep telegramto observe both sessions have spawned telegram plugin subprocesses - 5. Send a message to the Telegram bot — both sessions may attempt to handle it
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.90
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗