plan-stop-hook

Block Edit, Write, and Bash until a planning gate file is approved.

4|1|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/m2ai-portfolio/m2ai-skills-pack --skill plan-stop-hook
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: plan-stop-hook
Source: https://github.com/m2ai-portfolio/m2ai-skills-pack/tree/main/skills/plan-stop-hook
Command: npx skills add https://github.com/m2ai-portfolio/m2ai-skills-pack --skill plan-stop-hook

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

A planning gate prevents premature coding by enforcing a gating step before edits, ensuring plans survive adversarial review.

Core Features & Use Cases

  • Stop gate blocks Edit, Write, and Bash until the planning loop passes.
  • Configurable gate states and transition flow support structured planning and governance.
  • Gate state persistence in .claude/plan-gate.txt enables resumable work and retrospective traceability.

Quick Start

Install the stop hook, configure the gate states, run a planning loop, and approve the gate by writing APPROVED to .claude/plan-gate.txt.

Frequently Asked Questions about plan-stop-hook

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop Claude Code from editing files before a plan is approved?

A planning gate blocks Claude Code from editing files before a plan is approved by intercepting Edit, Write, and Bash tools until the gate state file indicates APPROVED. This prevents premature coding by enforcing a structured planning loop.

How do I set up a PreToolUse hook to enforce workflow governance in Claude Code?

You set up a PreToolUse hook by registering an entry in the .claude/settings.json file and persisting gate states in .claude/plan-gate.txt. This configuration blocks editing tools until the planning loop passes governance checks.

When should I use a planning gate for coding projects?

Use a planning gate for non-trivial tasks, high-cost migrations, and multi-step plans across coding projects. It ensures your plans survive adversarial review before any code changes are executed, preventing premature edits.

Can I resume work after a planning loop gate is approved?

Yes, gate state persistence in .claude/plan-gate.txt enables resumable work and retrospective traceability. Once you write APPROVED to the file, the gate opens and editing tools are unblocked for the coding session.

Does the stop hook support configurable gate states for structured planning?

Yes, the stop hook supports configurable gate states and transition flow for structured planning and governance. You can define the specific states and transitions needed to manage your workflow approval process.