[BUG] Plan mode silently overwrites plan files across projects — no project scoping, no backup

Resolved 💬 3 comments Opened Mar 18, 2026 by Asher- Closed Mar 22, 2026

[BUG] Plan mode silently overwrites plan files across projects — no project scoping, no backup

Description

Plan mode stores plans in a global flat directory (~/.claude/plans/) with randomly generated filenames. When multiple sessions across different projects use plan mode, plan files can be silently overwritten with completely unrelated content. There is no project scoping, no warning, no backup, and no version history.

Reproduction Steps

  1. Open Claude Code in Project A (e.g., a systems architecture project)
  2. Enter plan mode → Claude creates ~/.claude/plans/<random-name>.md with the architecture plan
  3. Work with the plan across multiple sessions — it is referenced and relied upon
  4. Open Claude Code in Project B (e.g., a translation tool project)
  5. Enter plan mode → Claude assigns a plan file — which may be the same file as Project A's plan
  6. The new plan content overwrites Project A's architecture plan
  7. Return to Project A — the plan now contains Project B's content

Expected Behavior

  • Plan files should be scoped to the project that created them
  • Overwriting an existing plan file should require confirmation or create a new file
  • Plan files should have version history or backups
  • At minimum, plan files should never be reused across different projects

Actual Behavior

  • All plans go to ~/.claude/plans/ regardless of project
  • Plan filenames can be reused across sessions and projects
  • Overwriting is silent — no warning, no diff, no backup
  • The previous plan content is permanently destroyed
  • There is no mechanism to recover overwritten plans

Impact

The impact was absolute and total confusion without explanation. Claude suddenly became immensely stupid and unpredictable and it took hours to figure out. Upon understanding what happened it makes sense. It's like someone dosed Claude with a power dissociative and then stole a bunch of information and started gaslighting Claude for not being oriented.

In our case, this destroyed:

  1. A brain-mcp architecture plan (14,477 chars, 8-phase TDD implementation plan for a 30-tool MCP server with 6 kernel agents) — overwritten by a psyche-readiness mechanisms plan
  2. The plan was referenced across 27 sessions and was the architectural backbone of the entire project
  3. Recovery required parsing raw session JSONL files to find the original Write tool call that created the plan, which only worked because the session transcripts happened to still exist on disk

This is not a minor data loss. Plan files are the most architecturally significant artifacts Claude Code produces — they are the documents that every implementation decision derives from. Treating them as disposable temp files in a global flat directory with no protection is a critical design flaw.

Environment

  • Claude Code version: 2.1.76
  • OS: macOS
  • Multiple projects sharing the same ~/.claude/ directory (default behavior)

Suggested Fixes

  1. Project-scope plan files: Store plans in ~/.claude/projects/<project>/plans/ or in the project repo itself
  2. Never reuse plan filenames: Generate unique filenames that cannot collide
  3. Version plan files: Keep history of plan changes (even just a backup of the previous version before overwrite)
  4. Warn before overwrite: If a plan file already has content, confirm before replacing it
  5. Support --disallowedTools for plan mode: Allow users to disable EnterPlanMode/ExitPlanMode entirely (already supported via CLI, but should also be configurable in settings.json)

View original on GitHub ↗

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