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.
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
/reflectskill works fineCan't open file '/scripts/capture_learning.py'Impact on Users
/reflectskill manually when neededHook Definitions Affected
Next Steps
Waiting for Claude Code team to fix hook executor to set
${CLAUDE_PLUGIN_ROOT}properly.