Plugin hooks fail: CLAUDE_PLUGIN_ROOT not injected at hook execution time

Resolved 💬 4 comments Opened Apr 4, 2026 by mattlibbey Closed Apr 17, 2026

Description

Plugin hooks that use ${CLAUDE_PLUGIN_ROOT} in their command strings fail because the environment variable is not set when the hook command executes. The variable resolves to empty, causing paths like "${CLAUDE_PLUGIN_ROOT}/hooks/session-start-seen-skills.mjs" to become "/hooks/session-start-seen-skills.mjs" — which doesn't exist.

Affected hooks

All three hook event types show errors:

  • SessionStart:startup hook error
  • UserPromptSubmit hook error
  • PostToolUse:Bash hook error

Affected plugins

Every plugin that defines hooks using ${CLAUDE_PLUGIN_ROOT} is affected:

  • vercel@claude-plugins-official (SessionStart, UserPromptSubmit, PostToolUse:Bash)
  • superpowers@claude-plugins-official (SessionStart)
  • explanatory-output-style@claude-plugins-official (SessionStart)
  • vercel-plugin@vercel-vercel-plugin (SessionStart, UserPromptSubmit, PostToolUse:Bash)

Reproduction

  1. Enable any of the above plugins
  2. Start a new session
  3. Observe SessionStart:startup hook error immediately
  4. Send a message → UserPromptSubmit hook error
  5. Run any Bash command → PostToolUse:Bash hook error

Manual verification

Running a plugin hook manually with CLAUDE_PLUGIN_ROOT set works fine:

CLAUDE_PLUGIN_ROOT="/path/to/plugin/root" node "$CLAUDE_PLUGIN_ROOT/hooks/session-start-seen-skills.mjs"

Without it:

Error: Cannot find module '/hooks/session-start-seen-skills.mjs'

Environment

  • Claude Code version: 2.1.92 (latest)
  • macOS Darwin 25.4.0
  • Node.js v22.22.1
  • Plugin cache location: ~/Library/Mobile Documents/com~apple~CloudDocs/claude-config/plugins/cache/

Impact

Cosmetic — plugin skills and tools still work. Only the hook-based features (telemetry, skill injection, session profiling) are broken. The errors appear on every session start, every prompt submit, and every Bash tool use, which is noisy.

View original on GitHub ↗

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