Feature: PlanCreated hook event for terminal plan mode

Resolved 💬 3 comments Opened Apr 7, 2026 by driggstitle2020 Closed Apr 11, 2026

Problem

When using Claude Code in the VS Code terminal (CLI), plan mode writes the plan to a file in ~/.claude/plans/ but there's no way to automatically open it in a VS Code editor tab. The VS Code extension panel has this behavior built in — it auto-opens the plan as a markdown document for inline commenting — but terminal users get no equivalent.

This matters because many users prefer the terminal interface for its speed and flexibility, but lose the interactive plan review experience that makes plan mode genuinely useful.

Proposed Solution

Add a PlanCreated (or PlanModeEnter) hook event that fires when Claude writes a plan file during plan mode. The hook payload should include:

  • plan_path — absolute path to the plan .md file
  • session_id — current session ID

This would let terminal users set up a hook like:

{
  "hooks": {
    "PlanCreated": [
      {
        "type": "command",
        "command": "code \"$PLAN_PATH\"",
        "timeout": 5000
      }
    ]
  }
}

Which auto-opens the plan in a VS Code tab, giving terminal users the same review-and-comment workflow that the extension panel provides natively.

Alternatives Considered

  • FileChanged hook — doesn't reliably fire for files outside the working directory, and ~/.claude/plans/ is global
  • fswatch/inotify — external file watcher is clunky and requires additional tooling
  • Switching to the VS Code extension panel — works but forces users off their preferred interface

Additional Context

The 27 existing hook events cover session lifecycle, tool use, permissions, subagents, tasks, compaction, and worktrees — but nothing for plan mode transitions. Given that plan mode is a first-class feature with dedicated UI in the extension, a hook event for it seems like a natural addition.

View original on GitHub ↗

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