Extended thinking / internal reasoning leaks as visible chat text (session-persistent, survives app restart)
Description
During a single long-running Claude Code session, extended thinking (internal reasoning) content that should remain hidden began rendering as regular visible text in the chat transcript. This started partway through the session —\ the user first noticed it right after answering a multiple-choice question (posed via the AskUserQuestion tool) with free-text input, though causation there is not confirmed.
Observed behavior
- Occurred during a long session involving multiple
AskUserQuestiontool calls, backgroundAgent(subagent) tasks, and many file edits. - Restarting the Claude Code app did NOT resolve the issue —\ reopening the same session still showed leaked internal reasoning text in new turns.
- Starting a brand-new session did NOT reproduce the issue at all.
This pattern (persists across app restart within the same session, but does not carry over to a new session) suggests the problem is tied to state stored/persisted as part of the session itself, rather than a purely transient rendering glitch or a global application bug.
Hypothesis (unconfirmed —\ offered as a possible lead, not a diagnosis)
This may be related to the automatic context summarization/compaction that occurs as a session's conversation grows long (documented behavior: "the system will automatically compress prior messages... the summary... is provided in the next context window"). If thinking-block boundaries are lost or corrupted during that summarization step, and the corrupted summary is then persisted as part of the session's stored history, that would explain:
- why reloading/restarting doesn't help (the same corrupted history is reloaded each time), and
- why a new session is unaffected (there is no corrupted summary to inherit).
Environment
- OS: Windows 10 Pro (10.0.19045)
- Claude Code CLI running within a git repository project (long session with heavy tool use: Explore/general-purpose subagents, file reads/edits, multiple
AskUserQuestionrounds)
Impact
Internal reasoning / tool-call content that should stay hidden from the end user was exposed directly in the visible transcript —\ both a content-leakage/privacy concern and a UX regression.
---
Filed on behalf of the user via gh issue create at their request.