Skip to content

[BUG] File editing operations are not blocked in plan mode #2467

Closed as duplicate

Description

@BJM-sgoto

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • Other:
  • Claude CLI version: 1.0.31 (Claude Code)
  • Operating System: macOS Darwin 23.3.0
  • Terminal: Terminal App

Bug Description

File editing tools (Edit, Write, MultiEdit) can be executed even when in plan mode, which should only allow read-only operations.

Steps to Reproduce

  1. Start a conversation with plan mode active (user uses /p or similar)
  2. Claude attempts to use Edit or Write tools during planning phase
  3. The tools execute successfully and modify files instead of being blocked

Expected Behavior

  • In plan mode, all write operations should be rejected with an error
  • Only read-only tools (Read, LS, Grep, Glob, etc.) should be allowed
  • System should prevent file modifications until exit_plan_mode is approved

Actual Behavior

  • Edit, Write, and other modification tools execute normally
  • Files are actually modified despite being in plan mode
  • No error or warning is shown when attempting write operations
  • The system-reminder about plan mode is present but not enforced

Additional Context

This defeats the purpose of plan mode, which is meant to prevent unintended modifications while planning tasks. The system-reminder clearly states "you MUST NOT make any edits, run any non-readonly tools"
but the tools still execute when called.

Example: During plan mode, I was able to:

  • Create new files with Write tool
  • Edit existing files with Edit tool
  • These changes persisted even though the user hadn't approved the plan

Activity

  1. added
    bug
    on Jun 23, 2025
  2. added
    has repro
    platform:macos
    on Jun 23, 2025
  3. github-actions commented on Aug 16, 2025

    @github-actions

    Found 2 possible duplicate issues:

    1. BUG: Task Tool Agents Bypass Plan Mode Write Restrictions #5406
    2. Plan Mode Violation - Agent Executes Plan After User Explicitly Selects "No, keep planning" #5527

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  4. added
    duplicate
    and removed
    bug
    has repro
    platform:macos
    on Aug 21, 2025
  5. github-actions commented on Aug 21, 2025

    @github-actions

    This issue has been automatically closed as a duplicate of #5406.

    If this is incorrect, please re-open this issue or create a new one.

    🤖 Generated with Claude Code

  6. github-actions commented on Aug 29, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  7. locked as resolved and limited conversation to collaborators on Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions