[BUG] Plan file edits ignored when approving with "Yes, clear context": cached plan content injected instead of re-reading from disk

Resolved 💬 3 comments Opened Feb 9, 2026 by nicolasff Closed Mar 11, 2026

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?

When approving a plan with option 1 ("Yes, clear context and auto-accept edits"), the new session receives the original plan content from when the assistant called ExitPlanMode, ignoring any edits the user made to the plan file on disk before approving. This only happens when "clear context" is used.

The planContent field in the injected user message is populated from the cached ExitPlanMode tool input rather than reading ~/.claude/plans/<slug>.md at approval time.

This is _kind_ of a regression — editing plan files before approval previously worked correctly. The non-context-clearing approval options (2 and 3) still work: the edited plan content is correctly re-injected into the session.

What Should Happen?

When the user edits ~/.claude/plans/<slug>.md and then approves (with any option, including "clear context"), the plan content injected into the session should reflect the current file on disk, not the cached version from the ExitPlanMode tool input.

Error Messages/Logs

The JSONL transcript shows the stale content being injected.

I asked Claude to write a simple plan, asking it to "Say Hello". I then **edited the** file to say "Tell a joke", then approved the plan with the **first option**, "Yes, clear context and auto-accept edits".

`ExitPlanMode` tool input (assistant-side, before user edits):

{
  "type": "tool_use",
  "name": "ExitPlanMode",
  "input": {
    "plan": "# Plan: Say \"Hello\"\n\n## Step 1\nPrint \"Hello\" to the user.\n"
  }
}


Injected user message in the new session (after approval + clear context):

{
  "type": "user",
  "message": {
    "content": "Implement the following plan:\n\n# Plan: Say \"Hello\"\n\n## Step 1\nPrint \"Hello\" to the user.\n"
  },
  "planContent": "# Plan: Say \"Hello\"\n\n## Step 1\nPrint \"Hello\" to the user.\n"
}


This is the **cached** plan, **before edits**.

The `planContent` matches the `ExitPlanMode` input verbatim — my edits to the file were not read.

In contrast, approving without clearing context correctly passes the edited plan content in the `tool_result`:


{
  "type": "tool_result",
  "content": "User has approved your plan...\n\n## Approved Plan:\n# Plan: Tell a joke\n\n## Step 1\nTell the user a joke.\n"
}

Steps to Reproduce

  1. Start Claude Code, switch to plan mode
  2. Ask Claude to create a simple plan (e.g., "create a plan to say hello")
  3. Claude enters plan mode, writes the plan to ~/.claude/plans/<slug>.md, and calls ExitPlanMode
  4. Note the path to the .md file shown in the approval prompt
  5. Open the file in an editor and change the plan content (e.g., change "say hello" to "tell a joke"). Save the file.
  6. Select option 1: "Yes, clear context and auto-accept edits"
  7. Observe: the new session receives the original plan, not the edited version. The assistant executes the original plan and ignores edits.

This only happens when "clear context" is used. Without "clear context", the edited plan is re-injected into the context, as expected.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.37

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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