Skip to content

Hooks fail due to CLAUDE_PLUGIN_ROOT not set by Claude Code #17

@rexplx

Description

@rexplx

Hooks fail due to CLAUDE_PLUGIN_ROOT not set by Claude Code

Summary

All claude-reflect hooks (UserPromptSubmit, PostToolUse, SessionStart, PreCompact) fail because Claude Code's hook executor doesn't set the ${CLAUDE_PLUGIN_ROOT} environment variable.

Related Issue

This is a Claude Code bug, not a claude-reflect bug. Filing here for awareness.

Claude Code issue: anthropics/claude-code#24529

Current Status

  • /reflect skill works fine
  • ❌ All hooks fail with: Can't open file '/scripts/capture_learning.py'

Impact on Users

  • No auto learning capture after tool use
  • No commit reminders after Bash commands
  • No session start reminders
  • Workaround: Use /reflect skill manually when needed

Hook Definitions Affected

"UserPromptSubmit": [
  {"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/capture_learning.py\""}
],
"PostToolUse": [
  {"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/post_commit_reminder.py\""}
],
"SessionStart": [
  {"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/session_start_reminder.py\""}
],
"PreCompact": [
  {"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/check_learnings.py\""}
]

Next Steps

Waiting for Claude Code team to fix hook executor to set ${CLAUDE_PLUGIN_ROOT} properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions