Add hook or customization point for Plan Mode exit/plan delivery

Resolved 💬 2 comments Opened Jan 29, 2026 by SharadKumar Closed Feb 28, 2026

Problem

When Plan Mode exits and the user accepts a plan, Claude Code sends the plan to the agent with hardcoded text like:

Implement the following plan:
[plan content]

This bypasses any custom workflows that projects may have set up via hooks. For example:

  • A PreToolUse hook on ExitPlanMode can inject additionalContext with governance instructions
  • But the agent receives the plan as a direct prompt with "Implement the following plan:"
  • The agent focuses on implementation and may skip the governance steps in the advisory context
  • Result: Plans get implemented but GitHub issues aren't updated, acceptance criteria aren't checked, etc.

Current Behavior

  1. User enters Plan Mode (Shift+Tab)
  2. Agent creates a plan
  3. User accepts the plan
  4. Claude Code sends plan to agent with hardcoded "Implement the following plan:" instruction
  5. Any PreToolUse hooks on ExitPlanMode provide only advisory additionalContext
  6. Agent may ignore advisory context and jump straight to implementation

Requested Solution

One of:

Option A: New Hook Event

Add a hook event like PlanAccepted or PostPlanMode that fires when a plan is accepted, allowing projects to:

  • Transform or augment the plan delivery prompt
  • Inject mandatory steps before implementation begins
  • Trigger external workflows (GitHub issue creation, etc.)

Option B: Customizable Plan Delivery Template

Allow projects to customize the text sent with the plan via settings:

{
  "planMode": {
    "deliveryTemplate": "Before implementing, update GitHub issue #{{issue_number}} with this plan. Then implement:\n\n{{plan_content}}"
  }
}

Option C: Make ExitPlanMode Hook Output More Actionable

Currently additionalContext is advisory. Consider allowing hooks to specify requiredActions or preConditions that the agent must complete before proceeding with implementation.

Use Case

Our project uses GitHub Issues as the source of truth for plans. When Plan Mode exits, we need to:

  1. Create/update a GitHub issue with the plan content
  2. Run validators (plan-validator, issue-scoper)
  3. Add ready label if Definition of Ready passes
  4. Only then proceed with implementation

Currently, we have an exit-plan-mode.ts hook that injects these instructions, but they're often skipped because the agent sees "Implement the following plan:" and jumps to coding.

Environment

  • Claude Code version: Latest
  • OS: macOS

View original on GitHub ↗

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