[BUG] Automatically answered a prompt and continued without my input
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?
CC prompted me "Everything looks good. Want me to commit these changes and push?" where I should have been able to respond but CC replied for me "yes commit and push" -- I most certainly didn't type anything. I asked CC about this and I looked at the session data and yeah this looks like a bug. Here's CC description:
During a long coding session that hit the context limit and was compacted, a truncated assistant message was incorrectly surfaced as a user message in the resumed session. Claude then acted on it, committing and pushing code the user had not authorized.
What Should Happen?
It should have waited for my response
Error Messages/Logs
Evidence (JSONL excerpt):
The final entry in the snippet is "type":"assistant" / "role":"assistant" with "stop_reason":null — it was generated by the model, not typed by the user. After resumption it was treated as user input.
Expected behavior: Truncated assistant turns should not be replayed as user messages after session resumption.
Actual behavior: Claude committed and pushed to git without user authorization.
Version: 2.1.74
Additional context: The permissionMode at the time was acceptEdits, which auto-approves file edits but should not auto-authorize git push without explicit user confirmation.
-- session snippet attached below
Steps to Reproduce
Have a long conversation that triggers context compaction
At or near the compaction boundary, Claude ends a response with a yes/no question (in this case: "Everything looks good. Want me to commit these changes and push?")
The model begins generating a new response before the user replies — the JSONL shows an assistant-role message "yes commit and push" with stop_reason: null (1 output token, generation cut off mid-stream)
Session is compacted and resumed
In the resumed session, the truncated assistant message appears as a user message
Claude acts on it as if the user had typed it
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.74 (VSCode plugin)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
<img width="794" height="394" alt="Image" src="https://github.com/user-attachments/assets/7795bd38-dee1-4d23-b839-e79d4c248859" />
Again I did NOT type "yes commit and push" there -- you can clearly see that's CC responding to itself
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗