Plugin hook paths break when cache updates during long-running sessions

Resolved 💬 3 comments Opened Mar 19, 2026 by mmenefee Closed Mar 22, 2026

Description

Plugin hook registrations use absolute paths that include a version hash from the plugin cache directory. When Claude Code updates (which appears to happen daily), the cache gets a new version hash and the old directory is cleaned up. However, long-running sessions still hold the old path in memory, causing every hook invocation to fail.

Error

Stop hook error: Failed with non-blocking status code: /bin/sh: /home/user/.claude/plugins/cache/claude-plugins-official/ralph-loop/205b6e0b3036/hooks/stop-hook.sh: not found

Steps to Reproduce

  1. Start a Claude Code session with a plugin that has hooks (e.g., ralph-loop)
  2. Leave the session open for 24+ hours
  3. Claude Code updates in the background, rotating the plugin cache to a new version hash
  4. The old cache directory (e.g., 205b6e0b3036) is cleaned up
  5. The session's hook still references the old path
  6. Every subsequent hook invocation fails with "not found"

Expected Behavior

Hook paths should either:

  • Be resolved at invocation time (lookup the current cache path) rather than at registration time, OR
  • Long-running sessions should detect cache invalidation and re-resolve plugin paths, OR
  • Old cache directories should not be cleaned up while sessions that reference them are still running

Environment

  • OS: FreeBSD 15.0-RELEASE
  • Sessions routinely run for multiple days
  • Plugin: ralph-loop (from claude-plugins-official), but this would affect any plugin with hooks

View original on GitHub ↗

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