mach10 icon indicating copy to clipboard operation
mach10 copied to clipboard

Prevent issue-plan from entering plan mode and attempting implementation

Open LeanAndMean opened this issue 9 months ago • 2 comments

Summary

The issue-plan command frequently triggers Claude's plan mode behavior, where Claude switches to plan mode, asks the user if they want to execute the plan, and then attempts to implement the plan directly. This violates the mach10 methodology, which requires planning and implementation to occur in separate CLI sessions.

Current Behavior

When running /mach10:issue-plan <issue-number>, Claude often:

  1. Explores the codebase and drafts a plan (correct)
  2. Switches to plan mode via EnterPlanMode (incorrect)
  3. Asks the user if they want to execute the plan (incorrect)
  4. Attempts to implement the plan in the same session (incorrect)

This collapses the plan and implement steps into a single session, defeating the purpose of staged implementation and session boundaries.

Proposed Behavior

The issue-plan command should:

  1. Explore the codebase and draft a staged plan
  2. Present the plan for user approval via AskUserQuestion
  3. Post the approved plan as a comment on the issue
  4. Create the feature branch
  5. Direct the user to /clear then /mach10:issue-implement for a fresh implementation session

Claude should never enter plan mode or attempt implementation during this command.

Acceptance Criteria

  • The issue-plan command explicitly instructs Claude not to use EnterPlanMode or implement any code changes
  • The allowed-tools list for issue-plan excludes EnterPlanMode, Edit, Write, and NotebookEdit
  • The command instructions contain a clear prohibition against implementing the plan within the same session
  • After posting the plan, the command directs the user to start a new session for implementation

Technical Notes

  • The current allowed-tools list (Bash, Read, Grep, Glob, Task, AskUserQuestion) does not include EnterPlanMode, but Claude may still attempt to enter plan mode as a default behavior for complex tasks
  • Adding an explicit instruction to the command body prohibiting plan mode and implementation may be sufficient, but the allowed-tools exclusion of Edit and Write provides a hard guardrail
  • Related files: commands/issue-plan.md

LeanAndMean avatar Feb 24 '26 21:02 LeanAndMean

Implementation Plan

Created by: /mach10:issue-plan This comment guides staged implementation via /mach10:issue-implement.


Stage 1: Add plan mode and implementation guardrails to issue-plan command

What it accomplishes: Adds explicit prohibitions against entering plan mode or implementing code, providing both behavioral instructions (in the markdown body) and confirmation that the tool-level guardrails (allowed-tools exclusion) are in place.

Files modified:

  • commands/issue-plan.md

Changes:

  1. Add a guardrail section after the opening paragraph (before Step 1) with clear prohibitions:
    • Do NOT use EnterPlanMode or enter plan mode
    • Do NOT implement any code changes -- no file edits, no file writes
    • This command is strictly for planning; implementation happens in separate sessions via /mach10:issue-implement
  2. Verify allowed-tools remains Bash, Read, Grep, Glob, Task, AskUserQuestion (already correct -- excludes EnterPlanMode, Edit, Write, NotebookEdit)

Testing approach: Manual -- run /mach10:issue-plan on a test issue and verify Claude does not attempt to enter plan mode or implement changes.

Dependencies: None.

LeanAndMean avatar Feb 24 '26 21:02 LeanAndMean

Progress Update -- Stage 1

Branch: feature/issue-19-prevent-plan-mode Commit: 572e37e

What was done

Implemented stage 1 of the implementation plan: added plan mode and implementation guardrails to the issue-plan command.

Changes to commands/issue-plan.md:

  • Added a ## Guardrails section between the opening paragraph and Step 1
  • Three explicit prohibitions: no EnterPlanMode, no file edits/writes, no in-session plan execution
  • References /mach10:issue-implement as the correct path for implementation
  • Verified allowed-tools already excludes EnterPlanMode, Edit, Write, and NotebookEdit (no change needed)

All four acceptance criteria from the issue are satisfied by this change.

LeanAndMean avatar Feb 24 '26 22:02 LeanAndMean