Feature Request: Add hook event for plan mode transitions (ExitPlanMode/PlanApproved)
Feature Request
Summary
Add a new hook event that fires when Claude transitions from plan mode to implementation mode (i.e., when a plan is approved and Claude exits plan mode).
Use Case
When working with plan mode, users may want to automatically run validation, review, or processing on the completed plan before implementation begins. Currently, there's no way to programmatically intercept this transition.
Example workflow:
- User enters plan mode
- Claude creates a detailed implementation plan
- User approves the plan
- → Hook fires here ← (proposed feature)
- Custom reviewer/validator runs on the plan
- Implementation begins
Current Limitation
The existing hook events cover:
- Session lifecycle (
SessionStart,SessionEnd) - Tool execution (
PreToolUse,PostToolUse) - Subagent lifecycle (
SubagentStart,SubagentStop) - Response completion (
Stop) - User input (
UserPromptSubmit)
None of these reliably capture the specific moment when a plan is finalized and approved.
Proposed Solution
Add one or more of the following hook events:
ExitPlanMode- Fires when transitioning out of plan modePlanApproved- Fires specifically when a plan is approved by the user
The hook should have access to:
- The plan content/file path
- The conversation context that led to the plan
Workarounds Considered
- Using
Stophook with prompt-based detection (imprecise, fires on every response) - Using
UserPromptSubmitto detect approval keywords (fragile, depends on user phrasing) - Manual skill invocation (loses the automatic workflow benefit)
None of these provide a clean, reliable solution.
Additional Context
This would enable powerful automation workflows like:
- Automatic plan review against project standards
- Plan complexity analysis
- Generating test scaffolds from plans before implementation
- Logging/auditing of approved plans
---
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗