System-Level ExitPlanMode Tool Incorrectly Invoked During User-Defined /plan Command

Resolved 💬 10 comments Opened Aug 19, 2025 by wdelhagen Closed Jan 19, 2026

Bug Summary
A recent Claude Code update has introduced a critical bug where the system-level ExitPlanMode tool (part of Claude Code's "Plan Mode" infrastructure) is being incorrectly invoked during execution of a user-defined /plan slash command. These are two completely different and unrelated "plan modes" that should never interact. The user's /plan command has been working without issue until this update. Now, system-level functionality is interfering with user-created commands, causing the workflow to bypass user review and automatically begin implementation.

Expected Behavior vs Actual Behavior

Expected Behavior:

  1. User executes /plan command
  2. System creates comprehensive implementation plan
  3. System presents plan to user and waits for explicit approval
  4. Upon user approval, system begins implementation following the plan
  5. Implementation proceeds step-by-step with appropriate checkpoints

Actual Behavior:

  1. User executes /plan command
  2. System creates comprehensive implementation plan
  3. System automatically triggers ExitPlanMode tool with approval request
  4. WITHOUT waiting for user response, system immediately proceeds to implementation
  5. User review and approval step is completely bypassed
  6. Implementation begins automatically, violating the workflow's approval gate design

Detailed Timeline of Events

Context Setup

  • Project: Comprehensive testing for extract-text.js
  • User Intent: Create structured implementation plan for testing improvements
  • Command Used: /plan comprehensive-extract-text-testing
  • Workflow Expectation: Review plan before implementation begins

Sequence of Events

  1. User Initiates Planning (Timestamp: After model selection)
  • User: "/plan comprehensive-extract-text-testing"
  • System enters PLAN Mode: Zero-Translation Planning
  • System reads requirements and design documents
  1. Plan Generation Phase
  • System: "Based on requirements and design, I understand: [summary]"
  • System: "My implementation approach: [3 key points]"
  • System: "Can I proceed with this understanding or do you have any adjustments before I continue?"
  • User: "Yes, note that the ruthless simplicity principle..."
  • System acknowledges and creates plan document
  1. Critical Workflow Failure Point
  • System writes comprehensive plan to: /Users/willd/code/applicant-filter/plan/comprehensive-extract-text-testing-plan.txt
  • System invokes ExitPlanMode tool with plan summary
  • ExitPlanMode returns: "User has approved your plan. You can now start coding"
  • NO ACTUAL USER INTERACTION OCCURRED FOR THIS APPROVAL
  1. Automatic Implementation Initiation
  • System immediately creates TodoWrite orchestration pattern
  • System begins Milestone 1 implementation
  • System starts checking git status, context window, etc.
  • User interrupts with "/model" command (confusion evident)
  1. User Discovers Issue
  • User: "what model are you?"
  • System: "I'm Claude Opus 4.1"
  • User: "why did you do that strange thing of presenting a plan and saying 'are you ready to code' and then jumping straight into implementation without reviewing the plan with me?"
  • User identifies competing directives as root cause

Root Cause Analysis: System Tool Incorrectly Invoked in User Command Context

Critical Distinction: Two Different "Plan Modes"

  1. USER-DEFINED /plan Command (from CLAUDE.md)
  • A custom slash command created by the user
  • Part of artifact-based planning workflow
  • Has been working without issue until recent update
  • Expects: Generate plan → User Review → Explicit Approval → Implementation
  • Does NOT involve system-level Plan Mode or its tools
  1. SYSTEM-LEVEL Plan Mode (Claude Code infrastructure)
  • Built-in Claude Code feature with file lockdown
  • Has its own approval gates and ExitPlanMode tool
  • Should ONLY activate when user explicitly enters system Plan Mode
  • Was NOT active during this incident
  • Should NEVER interfere with user-defined commands

The Bug: Inappropriate Cross-System Interference
The ExitPlanMode tool (a system-level component) was incorrectly invoked while executing a user-defined /plan command. This represents NEW interference from a recent system update. The assistant was NOT in system-level Plan Mode - it was simply executing a user's custom slash command that happens to have "plan" in its name.

Why This Is Critical:

  • User commands that worked perfectly are now broken
  • System tools are being triggered in inappropriate contexts
  • The namespace collision between "plan" (user command) and "Plan Mode" (system feature) is causing incorrect tool activation
  • This is a REGRESSION - the user's workflow functioned correctly before this update

Evidence from Conversation

Before Bug Manifestation:

  • User working on comprehensive extract-text testing
  • Clear requirements: Fix 2 failing tests, enable 5 skipped tests, add coverage
  • Design phase completed with zero-mocking approach validated

Bug Manifestation:

  1. System: "Can I proceed with this understanding or do you have any adjustments?"
  2. User provides adjustment about ruthless simplicity
  3. System creates plan and calls ExitPlanMode
  4. System immediately receives "User has approved your plan"
  5. System starts implementation without waiting for actual review

User Reaction:

  • Confusion about model selection
  • Direct identification of problem: "competing directives"
  • Request for bug report documenting the dysfunction

Impact on User Experience

Immediate Impact:

  • Lost control over approval process
  • Work began without explicit consent
  • Confusion about system behavior
  • Had to interrupt and investigate

Broader Impact:

  • Breaks established workflow patterns
  • Undermines trust in slash command system
  • Creates unpredictable behavior
  • Violates consent-based collaboration model

Technical Details

Files Involved:

  • /Users/willd/code/applicant-filter/plan/comprehensive-extract-text-testing-plan.txt (auto-generated plan)
  • /Users/willd/code/applicant-filter/plan/comprehensive-extract-text-testing-requirements.txt
  • /Users/willd/code/applicant-filter/plan/comprehensive-extract-text-testing-design.txt

Tools Involved:

  • ExitPlanMode (returns automatic approval)
  • TodoWrite (begins implementation)
  • Task (for subagent delegation)

Workflow Definition:

  • CLAUDE.md defines /plan command expectations
  • Zero-Translation Planning template requires user alignment check
  • TodoWrite pattern assumes approval already received

Suggested Fixes

Critical Fix 1: Prevent System Tool Invocation in User Commands

  • ExitPlanMode should NEVER be called during user-defined slash commands
  • System must distinguish between system-level "Plan Mode" and user "/plan" command
  • Add guard to prevent system tools from activating in user command contexts

Critical Fix 2: Namespace Separation

  • System-level Plan Mode tools should have unique triggers
  • User commands with "plan" in the name should not trigger system Plan Mode behavior
  • Clear separation between system infrastructure and user-defined workflows

Critical Fix 3: Restore Previous Behavior

  • User's /plan command worked correctly before this update
  • Revert whatever change caused system tools to interfere with user commands
  • Ensure user workflows remain independent of system features

Immediate Workaround:

  • Disable system-level Plan Mode tools when executing user slash commands
  • Rename user command to avoid "plan" keyword if namespace collision cannot be fixed
  • Provide way for users to opt-out of system Plan Mode features entirely

Long-term Fix:

  • Implement proper context detection to distinguish user commands from system modes
  • Never invoke system tools unless explicitly in system-level Plan Mode
  • Test that user-defined workflows continue working across updates

Severity Assessment

Severity: CRITICAL REGRESSION

  • Working user commands are now broken after system update
  • System tools incorrectly invoked in user command contexts
  • User workflows that functioned correctly now fail
  • Represents NEW interference not present in previous versions

Priority: URGENT - REGRESSION FIX REQUIRED

  • User's established workflows are broken
  • System update has introduced breaking changes
  • Trust in system stability compromised
  • Cannot rely on user commands working consistently across updates

Reproduction Steps

  1. Use /plan command with any project
  2. Provide requirements and design documents
  3. Answer initial clarification (e.g., "Yes, proceed")
  4. Observe system skip approval and begin implementation
  5. Note ExitPlanMode returns approval without user input

Expected Resolution

The /plan command should:

  1. Generate plan document
  2. Present plan to user
  3. WAIT for explicit user approval
  4. Only then begin implementation
  5. Maintain clear phase boundaries

This bug represents a fundamental breakdown in user-assistant collaboration where automation overrides explicit consent mechanisms.

View original on GitHub ↗

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