Long-running `--continue` channels sessions degrade into reply-tool omission (responses stop reaching the channel)
Summary
A long-lived claude --continue --channels <plugin> session gradually degrades: the model produces a turn whose intended reply is emitted as plain text/thinking (or, in some cases, as the literal tool-call written out as text) but does not actually invoke the channel's reply tool. Because only the reply tool's output reaches the channel, the response is silently lost — from the user's side the bot "stops replying," intermittently at first, then almost constantly.
Environment
- Claude Code 2.1.185
--channelsmode with the official Telegram plugin (claude-plugins-official/telegram)- Long-lived systemd service:
claude --continue --channels plugin:telegram@... --dangerously-skip-permissions - Session running for several days; transcript ~60 MB; ~16 auto-compaction cycles
Symptom
The model's final turn contains the intended message as a text block (or the literal reply tool-call XML written as text), with no actual tool invocation. In --channels, only the reply tool's output is delivered, so the message never reaches the user. The frequency climbs with session age until the bot is effectively unusable.
What we ruled out (diagnostic)
- Not the plugin — same plugin version throughout, no plugin-side error; inbound messages are received fine.
- Not message formatting — zero parse-entities errors (that is a separate, known issue).
- Not the binary itself — a fresh session on the same 2.1.185 build replies perfectly, so it is not a pure build regression.
- Auto-compaction does NOT fix it — compaction clears context but the degraded behavior persists.
Root correlation
The failure correlates with session length/age (the long-lived --continue session). Starting a true fresh session (a new session, not a --continue resume of the old one) immediately and fully restores correct reply-tool invocation.
Approximate repro
- Run
claude --continue --channels <plugin>as a long-lived service. - Use it regularly for several days (let the transcript grow large with multiple compactions).
- Observe the reply-tool omission rate climb until responses stop reaching the channel.
Workaround
Periodically rotate to a fresh session when the agent is idle: archive the current session transcript and restart the service without --continue, then restore --continue so future restarts resume the fresh session. The agent re-orients from durable state (git branch, files), so in-progress work is not lost.
Ask
Investigate long-session degradation of tool-invocation reliability in --continue mode. A built-in session-health signal or auto-refresh — or guidance on a recommended maximum session lifetime for long-lived --channels agents — would help anyone running Claude Code as a persistent bot.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗