Post-compaction: Claude resumes the prior user request instead of the most recent one

Resolved 💬 3 comments Opened Apr 20, 2026 by CeidFord Closed May 27, 2026

Environment

  • Claude Code CLI (terminal REPL, --dangerously-skip-permissions)
  • Model: Claude Opus 4.7 (claude-opus-4-7)
  • OS: Windows 11, bash shell

Summary

After automatic conversation compaction, Claude frequently picks up the second-to-last user request and acts on it, instead of the most recent one. The behavior is consistent enough to be noticeable across sessions, not a one-off.

Expected

After compaction, the next turn should execute against the latest user message. The compacted summary should preserve "what was just asked" as the active task.

Actual

The newest request gets dropped or deprioritized; Claude resumes work on the request immediately preceding it, as if the compaction boundary shifted the "current task" pointer back one turn.

Impact

  • Wasted turns re-asking
  • Risk of Claude silently executing stale intent (especially bad for autonomous / scheduled sessions where no human is watching the next turn)
  • Breaks trust in long sessions

Suspected area

Compaction summary generation: likely the "most recent user turn" isn't being held out of the summarization window, so it gets folded into history rather than staying as the live prompt.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗