Context compression drops explicit user instructions, causing agent to ignore prompts

Resolved 💬 1 comment Opened Mar 9, 2026 by williamscales Closed Mar 9, 2026

Description

When a conversation is long enough that context compression occurs (e.g. entering/exiting plan mode), explicit user instructions from earlier in the conversation are lost. The agent then acts on the injected plan prompt rather than the user's actual request.

Steps to Reproduce

  1. In a long conversation, user gives an explicit instruction: "make a pr for the issue you fixed"
  2. Context gets compressed as the conversation transitions (in this case, entering plan mode)
  3. A plan prompt is injected as the next message the agent sees
  4. Agent executes the plan's verification steps instead of the user's actual instruction (create a PR)
  5. User has to re-state the instruction

Expected Behavior

The user's explicit instruction should be preserved through context compression, or the agent should be able to recover intent from repo state (e.g. all commits already exist → the next logical step is the PR the user asked for).

Actual Behavior

The instruction is completely lost. The agent mechanically executes verification steps from the plan despite the work already being committed, ignoring that the user explicitly asked for a PR.

Impact

  • User has to repeat themselves
  • Agent does redundant work (re-running typecheck/lint/tests when everything is already committed)
  • Breaks trust — the user gave a clear, explicit instruction and it was ignored

Notes

  • Memory files and repo state assessment can partially mitigate this, but aren't reliable since the agent still needs to connect "work is done" → "user must have asked for something beyond the plan"
  • The core issue is that context compression can drop the user's most recent actionable instruction, which should arguably be prioritized for preservation

Environment

  • Claude Code CLI
  • Model: claude-opus-4-6
  • Long conversation with plan mode transition triggering compression

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗