[Bug] Plan mode resurfaces old plans after session compaction with Claude 4.5 Opus
Open 💬 19 comments Opened Nov 26, 2025 by Tigres2526
Bug Description
plan mode is glitched out when using opus 4.5. when we keep compacting the same session and have concurent plan mode for every request and old plan resurfaces every single time automatically after a while and when i say no and explain thats an old plan it immediatly gives me the old plan seems like an plan system error
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.0.54
- Feedback ID: cf43135b-ecb3-4d40-a338-9cb109976a24
Errors
[]
19 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I am consistently seeing the same issue - even without session compaction. Sometimes a plan gets executed, then a new prompt/task gets asked, but the latest plan shows the right new task PLUS the entire old plan which has already been finished. Now I need to explicitly ask it to drop the old plan in order to switch to new plans - this is very annoying. Possibly a combination effect of recent ~/.claude/plans/* file updating and Opus 4.5. It's not very easy to isolate the root cause or even write reproducible steps for this. But it's not a corner-case bug, it's happening after almost every single long plan execution.
I can confirm this is happening even without ever compacting the session. It regurgitates the whole plan every time it wants to suggest something else in Plan Mode. As @taiyangc suggested, I think it's because of the usage of .md files inside the plans folder. Because of this, it's difficult to follow exactly what changes Claude Code will do next as it shares the whole plan from the start of the conversation.
Confirming that this is happening every time I make changes to plans in Plan Mode within the same session. SO annoying.
I can confirm, I'm seeing this happen over and over starting this week. It seems it reads the old plan's .md file.
Steps to reproduce:
For now, I'm asking it directly to scratch the previous plan.
The plan that is shown in Plan mode is not being cleaned up or updated, at least visually, and it's getting hard to follow.
It is not just after compaction, but it also happens after switching back to plan mode.
plan mode -> auto accept -> stop claude -> plan mode = old plan shown
Additional reproduction: Session resume (no compaction)
Same symptom occurs on session resume without any compaction involved.
Environment
Reproduction
ExitPlanModeExitPlanModeagainRoot cause hypothesis
The plan file (
~/.claude/plans/*.md) persists across sessions. When Plan Mode is entered in a resumed session, Claude doesn't read/validate existing plan file content before callingExitPlanMode. Claude describes the correct new solution verbally but the system presents the stale file content.Workaround
User must explicitly ask Claude to delete the plan file, then Claude writes fresh content.
The #12988 I just created asks to address a broader need to be able to tell Claude "You are to no longer concern yourself with the previous task in any way, you are now working on a different but related new task" (with implications including new planning file, as well as no longer talking about old task in progress reports, in /compact summaries, etc).
GitHub Comment for Issue #12505
Post this to: https://github.com/anthropics/claude-code/issues/12505
---
Additional Reproduction Details & Root Cause Analysis
I've been experiencing this issue consistently in moderate-length sessions (1-2 hours) when working on multiple features. After investigating my local
~/.claude/plans/directory, I've identified the underlying mechanism.What I Found
My plans directory contains 285 accumulated plan files totaling 2.1MB. Examining the file structure reveals the issue:
Key observations:
# Previous Plan:headerscompressed-nibbling-porcupine.md) with no session ID associationReproduction Pattern
# Previous Plan:headerProposed Fixes
1. Session-scoped plan files (recommended)
Plans are deleted or archived when session ends.
2. Plan file metadata
Only load plans where
session_idmatches current session andstatus: active.3. PrePlanMode hook (see #14259)
Allow users to run cleanup before entering plan mode:
4. Explicit plan versioning
Replace
# Previous Plan:concatenation with structured versioning that marks old plans assupersededso the model knows to ignore them.Current Workaround
For others experiencing this, here's what works:
Environment
This issue significantly impacts workflow when doing iterative development across multiple features in a single session. Happy to provide more details or test proposed fixes.
@bcherny
Confirming with Forensic Evidence
I can confirm this bug with detailed forensic analysis from conversation logs. Our experience adds concrete evidence to what @benabraham hypothesized:
What We Experienced
A single session (
a1b5968e-...) persisted from Jan 13 → Jan 15 (across multiple days due to session resumption). During this time, 9 completely different plans were written to the same file (recursive-churning-octopus.md):| Timestamp | Plan Title | Action |
|-----------|------------|--------|
| Jan 13 17:45 | NLP-to-JSON Filters | CREATED |
| Jan 13 18:23 | NLP-to-JSON Pipeline - Simplified | OVERWRITE |
| Jan 13 19:43 | Ambiguity Handling Redesign | OVERWRITE |
| Jan 15 00:23 | Git Repository Setup | OVERWRITE ← Different task! |
| Jan 15 00:32 | Ambiguity Handling | OVERWRITE |
| Jan 15 00:38 | Git Repository Setup | OVERWRITE |
| Jan 15 01:06 | Git Version Tag Replacement | OVERWRITE |
| Jan 15 01:14 | Git Repository Setup | OVERWRITE |
| Jan 15 01:32 | (test writes) | OVERWRITE |
Forensic Method
Analyzed the 14MB JSONL conversation log:
Found 14 distinct Write tool calls to the same plan file — confirming @felipefreitag's observation:
Key Finding: Session Slug Reuse
The session slug (
recursive-churning-octopus) is generated once per session and reused for ALL subsequent plan mode entries. This means:Related Issues
This bug is connected to several other plan mode issues:
Cross-referenced to this issue:
#12778, #12827, #12838, #12988, #13114, #13539, #13641, #13716, #13740
Other plan mode bugs:
Partial Fix in v2.1.3
The changelog notes:
This addresses only the
/clearcase — the core bug (multiple plans in same session without/clear) remains.Supporting the Proposed Fixes
Agreeing with @Tigres2526's suggestions and the workarounds shared by @aayush-exe and @bluecon — the cleanest permanent fix would be:
Perhaps appending a counter or timestamp to the slug:
recursive-churning-octopus-2,recursive-churning-octopus-3, etc.---
Environment: Claude Opus 4.5, Linux (Ubuntu), Claude Code CLI 2.1.7
Feedback ID:
7c02bc81-4ce7-4d67-b003-1bb4c1ef4272Glad to see this is still open. Sad to see that it's still happening two and a half months later.
I closed my duplicate report. But here's the description since it's rather more concise:
I've used Claude Plan Mode to create a plan. When the plan runs out of context and there's not enough context to say compact, I say /new, abd then I tell it to look at what progress has been made on the current plan and then continue executing it.
The problem is that it can't identify what the current plan is, and so it searches around in the repository to find what plan it might be and pretends that that's the right thing to do. It doesn't warn me that it can't find the plan. It doesn't know to look in my ~/.claude/plans folder where it saves plans. That sounds like a bug.
Still reproducing on v2.1.44
Environment:
Behavior:
/resume(or--resume) restores the conversation to the point where the last plan was presented for approval, rather than the actual end of the conversation. This has happened across multiple versions, not just the current one.Workaround: Clearing
~/.claude/plans/*.mdbefore resuming avoids the issue, but this shouldn't be necessary.This is still a significant workflow disruption — adding my confirmation to keep this from going stale.
Just happened to me again.
happened to me too right now, but there was no compacting
A
UserPromptSubmithook can detect and clear stale plan references after compaction:Pair with a
PreCompacthook that saves the active plan:And a post-compaction reinject:
This is still a problem on 2.1.92 (Claude Code). It's kind of insane it's lasted so long.
Claude Code for VS Code plugin v. 2.1.101 - same problem.
Fun fact: Claude Code itself referred me to this ticket, so I'll also be waiting here for the solution.
This is happening so often that I'm looking into alternative tools. I'm on version 2.1.104. It's becoming unusable