Context compaction auto-submits unfinished user message without Enter

Status Fixed / completed
Maintainer reply None cached
Activity 3 comments · opened May 5, 2026 · closed May 5, 2026

Description

During context compaction, an in-progress user message was automatically submitted and executed without the user pressing Enter. The user was mid-message when compaction triggered, and the partial/complete message was sent as if the user had confirmed it.

Steps to Reproduce

  1. Have a long conversation that approaches context limits
  2. Begin typing a message but do not press Enter
  3. Context compaction triggers
  4. Message is submitted automatically without user confirmation

Expected Behavior

Context compaction should never submit or execute a pending user message. Any in-progress input should remain in the input buffer, untouched, after compaction completes.

Actual Behavior

The unfinished message was submitted as a command and executed without the user pressing Enter.

Impact

This can cause unintended actions — in this case, infrastructure changes were applied to a live AWS environment based on a message the user had not yet chosen to send. The outcome happened to be acceptable, but this behavior is unsafe in general.

Environment

  • Platform: macOS (darwin 25.3.0)
  • Shell: zsh
  • Model: claude-sonnet-4-6

View original on GitHub ↗

3 Comments

github-actions[bot] · 5 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/50658

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Gary-Armstrong · 5 months ago

Duplicate of #50658 — same root cause (silent compaction restores unsent input buffer from session snapshot). Closing and upvoting the existing issue.

github-actions[bot] · 3 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.