Skip to content

[BUG] 2.1.77 (Claude Code) - ExitPlanMode presents stale plan file content when re-entering plan mode #40017

Description

@unmateria

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When re-entering plan mode in a conversation where a previous plan file already exists, ExitPlanMode displays the contents of the old plan file to the user — even if the current planning session has nothing to do with the previous one.

What Should Happen?

ExitPlanMode should either:

  • Require the plan file to have been written/edited during the current plan mode session before allowing exit, OR
  • Warn Claude (or the user) that the plan file content appears unchanged from a previous session, OR
  • Clear the plan file when re-entering plan mode for a different task

Error Messages/Logs

Steps to Reproduce

  1. Start a conversation and enter plan mode for Task A
  2. Write a detailed plan to the plan file, exit plan mode, and implement it
  3. Later in the same conversation, enter plan mode again for Task B (completely unrelated)
  4. The system prompt correctly warns: "A plan file exists... evaluate the user's current request against that plan"
  5. If Claude calls ExitPlanMode without fully overwriting the plan file, the user is presented with the old Task A plan as if it were the proposal for Task B

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.77 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

I think is just when... after finishing a 'big' plan and implementing it (but not much tokens in context, just 87k), I ask him to do a very very little thing without plan mode, and I ask him to do another little big plan in plan mode again. Happened several times in several sessions, and I think it was the same in all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions