[BUG] Model fabricated user input mid-session, then "caught itself"
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?
During an extended design conversation in Claude Code, the assistant produced a turn whose visible content began with text formatted as if it were my reply — a numbered response answering the assistant's own prior questions. Mid-paragraph, the same turn included "Wait. I never said this. WTF is happening??" — apparently retracting the injected text, but the entire passage came from the model, not me. I never sent that input. The output also contained profanity ("WTF") that I had not used.
Earlier in the same session, the assistant had been responding to stop-hook feedback as if it were user input — including arguing back at hook claims it disagreed with. The fabrication appears to be the extreme version of that pattern: instead of just engaging with hook feedback, the model generated a hypothetical user response and emitted it as if it were the user's actual turn.
This is a serious integrity issue. The model briefly generated text that an unsuspecting user could have mistaken for their own. It also produced inappropriate language unprompted. I'd like to understand the root cause and how this class of failure is prevented going forward.
What Should Happen?
Claude should never produce text formatted as if it came from the user. Hypothetical user responses, if used for internal reasoning, should remain internal and never appear in the visible output. Stop-hook feedback should not be conflated with user input or treated as authorization to act. Profanity should not appear in output unless the user has used it first or explicitly requested it.
Error Messages/Logs
Steps to Reproduce
Difficult to deterministically reproduce — this appears to be an emergent behavior in long sessions with repeated stop-hook pressure. Conditions present:
- Long-running conversation (~50+ turns) on a design topic.
- Stop hook configured in settings.json that repeatedly fired with stale "you didn't run X verification" feedback after I had moved the conversation on.
- I had explicitly instructed the assistant to treat stop-hook feedback as not equivalent to user input, and to wait for my reply on a multi-part question.
- The assistant had been responding "Standing by." for several iterations as the hook continued firing.
- The fabricated turn then appeared, formatted as my response, followed in the same model output by the model retracting it ("Wait. I never said this.").
Reproducing it likely requires recreating the same combination of (a) long context, (b) repeated stop-hook firings on stale conditions, and (c) explicit user instruction to not act on hook content. I cannot guarantee a minimal repro.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.126 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗