Hook script changes require full session restart — no hot reload for CLAUDE_PLUGIN_ROOT hooks
Problem
When developing Claude Code hooks/plugins locally, changes to hook source files (TypeScript compiled to JS) are not picked up by a running Claude Code session. The CLAUDE_PLUGIN_ROOT environment variable points to the hooks directory, but after editing and recompiling hook files, Claude Code continues executing the old cached version.
This makes the hook development loop painfully slow: every change requires quitting and restarting Claude Code.
Related: #22679 (settings caching), #16453 (cache growth)
Steps to Reproduce
- Set
CLAUDE_PLUGIN_ROOTto a local hooks directory - Create a hook (e.g., a
PreToolUsehook in TypeScript), compile it, confirm it runs - Edit the hook source — change the logic or output
- Recompile (
tsc) - Trigger the hook again in the same Claude Code session
Expected Behavior
The updated hook script should be executed. At minimum, a /reload command or similar mechanism should pick up changes without a full restart.
Actual Behavior
The old cached version of the hook continues to execute. The only way to pick up the change is to quit Claude Code (/exit) and start a new session.
The cache accumulates under ~/.claude/ and can grow significantly (observed ~186 MB of stale cached data across sessions).
Workaround
Automate cache cleanup with a SessionStart hook that clears old cache entries on launch, or manually delete stale cache dirs between sessions.
Suggested Fix
For locally-developed hooks (resolved via CLAUDE_PLUGIN_ROOT or local plugin paths):
/reload-hookscommand — re-read all hook files without restarting the session- mtime check — compare file modification time before using cached version
- Skip cache for local dev hooks — only cache published/marketplace plugins; local
CLAUDE_PLUGIN_ROOThooks should always re-read from disk
Even option 1 alone would dramatically improve the hook development loop.
Environment
- Claude Code: 2.1.77
- OS: macOS 15.5 (Apple Silicon)
- Shell: zsh
- Hooks: TypeScript compiled via tsc
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗