Files
Trevin ChowandClaude Opus 4.7 0903b2e345 fix(ce-update): derive cache dir from CLAUDE_PLUGIN_ROOT parent
CLAUDE_PLUGIN_ROOT points at the currently-loaded plugin version directory
(~/.claude/plugins/cache/<marketplace>/compound-engineering/<version>), not
the plugins cache root. Appending /cache/<marketplace>/compound-engineering/
onto it produced a path that never exists, so the cache probe always failed
and emitted __CE_UPDATE_CACHE_FAILED__ on healthy installs.

Derive the cache dir via dirname "${CLAUDE_PLUGIN_ROOT}" instead. Guard with
a case shape-check that only emits the path when it matches
*/cache/*/compound-engineering, so malformed env values collapse to the
sentinel rather than producing a dangerous rm -rf target. Works for any
marketplace name, which removes the earlier hardcoded-segment footgun.

Add tests/skills/ce-update.test.ts as a regression guard so the
${CLAUDE_PLUGIN_ROOT}/cache/... antipattern cannot reappear.

Fixes #556.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-22 01:45:25 -07:00
..