Plugin hooks in settings.json not updated when plugin version changes

Resolved 💬 5 comments Opened Jan 16, 2026 by CybotTM Closed Apr 22, 2026

Description

When a plugin with hooks is updated to a new version, the hook commands in ~/.claude/settings.json retain the old versioned path, causing hooks to fail when the old version is cleaned from cache.

Steps to Reproduce

  1. Install a plugin with hooks (e.g., coach@netresearch-claude-code-marketplace)
  2. Plugin hooks get written to settings.json with expanded paths like:

``
python3 ~/.claude/plugins/cache/.../coach/2.2.1/scripts/detect_signals.py
``

  1. Plugin updates to newer version (e.g., 2.2.4)
  2. installed_plugins.json updates correctly to new path
  3. Old version cache directory (coach/2.2.1/) is cleaned up
  4. Hook fails with: No such file or directory

Current Behavior

  • Plugin's hooks.json uses ${CLAUDE_PLUGIN_ROOT} variable
  • At install time, this is expanded to absolute versioned path
  • On plugin update:
  • installed_plugins.json is updated ✓
  • Old cache is cleaned up ✓
  • settings.json hooks are NOT updated

Expected Behavior

When a plugin is updated, hooks in settings.json should be re-processed to use the new version path.

Suggested Fix

Option 1: Re-expand on update

  • When a plugin version changes, re-read hooks.json from new version
  • Update settings.json with newly expanded paths

Option 2: Runtime resolution

  • Don't expand ${CLAUDE_PLUGIN_ROOT} at install time
  • Resolve it at runtime when executing hooks
  • Look up current path from installed_plugins.json

Option 3: Symlink approach

  • Create plugins/cache/.../coach/current symlink pointing to active version
  • Use symlink path in hooks
  • Update symlink on version change

Workaround

The coach plugin has implemented a workaround: scripts auto-install a stable launcher to ~/.claude-coach/bin/ and update settings.json on first execution. See: https://github.com/netresearch/claude-coach-plugin/pull/3

Environment

  • Claude Code CLI (latest)
  • Linux (WSL2)
  • Affected plugins: Any plugin using hooks with ${CLAUDE_PLUGIN_ROOT}

View original on GitHub ↗

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