Plugin cache: CLAUDE_PLUGIN_ROOT points to stale version after plugin update

Resolved 💬 5 comments Opened Dec 29, 2025 by Zate Closed Feb 28, 2026

Description

When a plugin version is updated, new Claude Code sessions may still use the old cached version's scripts. The CLAUDE_PLUGIN_ROOT environment variable appears to resolve to a stale cache directory despite installed_plugins.json showing the correct updated version.

Steps to Reproduce

  1. Install a plugin from a local directory marketplace (e.g., devloop from cc-plugins)
  2. Make changes to the plugin and bump the version (e.g., from 2.4.4 to 2.4.7)
  3. Commit and push the changes
  4. Start a new Claude Code session in a different project
  5. Invoke a plugin command that uses ${CLAUDE_PLUGIN_ROOT} in script paths

Expected Behavior

The new session should use scripts from the latest cached version (2.4.7):

/home/user/.claude/plugins/cache/cc-plugins/devloop/2.4.7/scripts/...

Actual Behavior

The new session uses scripts from an old cached version (2.4.4):

/home/user/.claude/plugins/cache/cc-plugins/devloop/2.4.4/scripts/...

Evidence

installed_plugins.json shows correct version:

{
  "devloop@cc-plugins": [{
    "scope": "user",
    "installPath": "/home/user/.claude/plugins/cache/cc-plugins/devloop/2.4.7",
    "version": "2.4.7",
    "lastUpdated": "2025-12-28T10:57:20.745Z",
    "gitCommitSha": "f42d089..."  // <-- This SHA is from v1.0.0, 211 commits behind!
  }]
}

Session log shows mixed version references:

  • 1× reference to devloop/2.4.4 path
  • 6× references to devloop/2.4.7 path

Cache directory contains multiple versions:

~/.claude/plugins/cache/cc-plugins/devloop/
├── 2.4.4/  (Dec 27)
├── 2.4.5/  (Dec 27)
├── 2.4.6/  (Dec 28)
└── 2.4.7/  (Dec 28)  <-- Should be used

Analysis

  1. The version field in installed_plugins.json updates correctly to 2.4.7
  2. The installPath field points to the correct 2.4.7 cache directory
  3. However, the gitCommitSha is severely stale (points to v1.0.0, 211 commits behind)
  4. When resolving CLAUDE_PLUGIN_ROOT, something causes the old version's path to be used

Possible Root Causes

  1. Environment variable CLAUDE_PLUGIN_ROOT is cached/inherited incorrectly
  2. The stale gitCommitSha causes incorrect cache lookup
  3. Race condition when multiple sessions access the plugin cache
  4. Plugin resolution uses a different mechanism than installed_plugins.json

Workaround

Manually delete old cache versions:

rm -rf ~/.claude/plugins/cache/cc-plugins/devloop/2.4.{0,1,2,3,4,5,6}

Environment

  • Claude Code version: 2.0.76
  • OS: Linux (WSL2)
  • Plugin source: Local directory marketplace
  • Plugin: devloop from cc-plugins

Impact

This causes plugin updates to be silently ignored, leading to:

  • Users running outdated plugin scripts
  • Confusion when fixes don't take effect
  • Inconsistent behavior between sessions

View original on GitHub ↗

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