Telegram channel: each inbound message creates a new session instead of reusing existing one
Description
When using the official Telegram plugin (claude-plugins-official/telegram), every inbound Telegram message creates a new Claude Code session instead of routing to the existing active session. This makes the Telegram channel essentially unusable for multi-turn conversations — each message starts fresh with no context.
Expected Behavior
Messages from the same Telegram chat_id should route to the existing active Claude Code session, maintaining conversational context.
Actual Behavior
Each notifications/claude/channel notification from the Telegram plugin spawns a new session, losing all prior conversation context.
Root Cause Analysis
The Telegram plugin correctly includes chat_id and user_id in the notification meta:
mcp.notification({
method: 'notifications/claude/channel',
params: {
content: text,
meta: {
chat_id,
message_id: String(msgId),
user: from.username ?? String(from.id),
user_id: String(from.id),
ts: new Date((ctx.message?.date ?? 0) * 1000).toISOString(),
},
},
})
However, Claude Code's internal channel notification routing does not appear to use chat_id for session affinity. The MCP notifications/claude/channel schema has no session_id field the plugin could set.
This is a platform-side routing issue — the plugin is doing everything it can.
Suggested Fix
Claude Code's channel handler should use chat_id from the notification meta to route messages to an existing session for that chat, rather than creating a new session per notification.
Environment
- Claude Code: latest (as of April 2026)
- Telegram plugin: 0.0.4
- OS: macOS
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗