Telegram plugin: duplicate process after context compaction causes 409 Conflict and lost messages

Resolved 💬 3 comments Opened Mar 31, 2026 by timanovsky Closed Apr 4, 2026

Problem

After context compaction, Claude Code spawns a second instance of the Telegram plugin from a different path, resulting in two processes polling getUpdates simultaneously. This causes Telegram Bot API 409 Conflict errors and messages being delivered to the wrong instance (effectively lost).

Evidence

Two plugin processes running under the same Claude session (PID 99515):

PID 19355 → bun run --cwd ~/.claude/plugins/cache/claude-plugins-official/telegram/0.0.4 --shell=bun --silent start
PID 22652 → bun run --cwd ~/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/telegram --shell=bun --silent start

Both are children of the same Claude process. Timeline:

| Event | Time |
|-------|------|
| Session start | 22:38 UTC (Mar 30) |
| Compaction 1 | 10:36 local (Mar 31) |
| Plugin 19355 spawn (cache path) | 13:29 local |
| Compaction 2 | 13:30 local |
| Plugin 22652 spawn (marketplace path) | 13:38 local |

The second compaction triggered a plugin respawn, but Claude Code launched it from the marketplace path instead of reusing the already-running cache instance.

Impact

  • Telegram messages are randomly delivered to one of the two instances
  • The instance that doesn't receive the message can't respond
  • User sees the bot going silent or responding inconsistently
  • Only fix is to manually kill the duplicate process

Expected behavior

Compaction should not spawn additional plugin processes. If a plugin restart is needed, the existing process should be terminated first.

Environment

  • Claude Code CLI with --channels plugin:telegram@claude-plugins-official
  • Long-running session via caffeinate -is claude
  • macOS

View original on GitHub ↗

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