If you use plan mode in Claude Code (Shift+Tab), your completed plans are still on disk right now.

The Problem

Plan mode writes the plan to ~/.claude/plans/{random-name}.md. After the plan is executed, the file stays on disk - there’s no way to mark it complete. On future session continuations (especially after context compaction), Claude Code re-injects the stale plan with an instruction to “continue working on it if relevant.”

This caused Claude to start working on a task that had already been completed days earlier, wasting time and causing confusion.

How It Breaks

  1. Enter plan mode -> Claude writes plan to ~/.claude/plans/{random-name}.md
  2. Exit plan mode -> plan is presented for approval, then executed
  3. Plan file stays on disk for 30 days (cleanupPeriodDays default)
  4. On next session (or after compaction), system prompt re-injects the plan file
  5. Claude sees “continue working on it” and acts on stale context

Why Compaction Makes It Worse

With full conversation history, Claude has enough context to know the plan was already completed. After compaction, the conversation is summarized down but the plan file is re-read fresh from disk - so the “continue working on it” instruction carries more weight relative to the reduced context.

Known Issues

  • #12838 - Stale plans bleed across sessions
  • #19537 - Project-level plansDirectory setting is ignored (plans are global by default)

Workaround

  • Periodically check ~/.claude/plans/ and delete completed plans
  • Safe to delete files when no session is actively using plan mode
  • ls ~/.claude/plans/ to see what’s there
  • Can also set cleanupPeriodDays: 0 in settings to purge all session data immediately (nuclear option)

Future Fix

Setting plansDirectory: "./.claude/plans" in .claude/settings.json would scope plans per-project, but the bug at #19537 means this is currently ignored.