[BUG] Session compaction loses user's most recent instructions, causing agent to misinterpret intent

Resolved 💬 3 comments Opened Feb 6, 2026 by rosepark4861 Closed Feb 6, 2026

Description

When a Claude Code conversation approaches context limits and session compaction triggers, the compaction summary loses critical details from the user's most recent prompt. Specifically, the user's instructions and intent are lost or mischaracterized, while the technical content of the conversation is preserved.

This has occurred multiple times over several days in long-running development sessions.

Reproduction Steps

  1. Work in a long Claude Code session (bypass permissions mode, not plan mode) that approaches context limits
  2. Iterate on a plan with the agent — provide detailed feedback on a proposal and instruct the agent to revise the plan and present it for review before implementation
  3. Context compaction triggers
  4. After compaction, the agent proceeds to implement code changes directly, skipping the requested plan review

Note: The user was iterating on a plan conversationally in bypass permissions mode, not using Claude Code's formal plan mode. The compaction should still preserve the user's explicit instructions regardless of which permission mode is active.

Concrete Example (2026-02-06)

  1. User and agent were investigating a production bug (EPG version detection getting stuck)
  2. Agent presented findings and an initial fix proposal
  3. User provided detailed feedback and asked the agent to revise the plan and present it for review before implementation
  4. Context compaction triggered
  5. After compaction:
  • Preserved correctly: Technical details of the discussion (15-minute timeout suggestion, asymmetric version window idea, etc.)
  • Preserved correctly: A direct quote: "Please make sure that your plan details are fully saved"
  • Lost/mischaracterized: The user's actual instruction to revise and present the plan for review
  • Summary stated: "Implement two changes" — this was WRONG; the user wanted plan review first
  1. The agent proceeded to implement code changes, create test files, and run builds — all without the plan review the user had requested

Root Cause Analysis

The compaction summary preserved technical content accurately but failed to capture:

  • The user's actual instruction to revise and present the plan for review
  • That the user was in a plan-review iteration cycle, not ready for implementation
  • The conditional nature of the next steps (review first, then implement if approved)

The "Pending Tasks" or "what to do next" section of the compaction summary reflected the agent's interpretation of intent rather than the user's explicit instructions.

Impact

  • Agent made unauthorized code changes (multiple file edits, new test file, build runs)
  • User had to interrupt and explain what actually happened
  • Work may need to be reverted if the plan wasn't acceptable
  • Trust erosion — user cannot rely on compaction to preserve their instructions in long sessions

Expected Behavior

  • Session compaction should preserve the user's most recent instructions/intent with high fidelity
  • The "what to do next" section should reflect the user's actual request, not the agent's interpretation
  • Conditional instructions ("review first, then implement") should not be collapsed into unconditional ones ("implement")

Environment

  • Claude Code CLI v2.1.29+
  • Platform: Linux (Ubuntu 22.04)
  • Permission mode: --dangerously-skip-permissions (bypass permissions, not plan mode)
  • Affected models: Both Claude Opus 4.5 and Claude Opus 4.6 — this issue occurred multiple times over several days with Opus 4.5, and continues to occur with Opus 4.6 (released 2026-02-05). The bug is not model-specific.

View original on GitHub ↗

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