Skip to content

fix(ce-update): replace cache sweep with claude plugin update#656

Merged
tmchow merged 3 commits intomainfrom
fix/ce-update-skill-dir-substitution
Apr 23, 2026
Merged

fix(ce-update): replace cache sweep with claude plugin update#656
tmchow merged 3 commits intomainfrom
fix/ce-update-skill-dir-substitution

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Apr 22, 2026

Summary

/ce-update now recommends claude plugin update compound-engineering@every-marketplace instead of sweeping the plugin cache directly. The bespoke cache handling (listing ~/.claude/plugins/cache/<marketplace>/compound-engineering/, comparing version folder names, rm -rfing stale ones) is gone. Claude Code's own CLI subcommand already handles version comparison, marketplace refresh, and install updates in one call.

The refactor surfaced via a bug fix. /ce-update had been silently returning "no marketplace cache found" for everyone, even when stale versions were piled up in the cache, because the pre-resolution used ${CLAUDE_PLUGIN_ROOT:-} inside $(dirname ...) and Claude Code's skill-body substitution does not recognize the ${VAR:-} form (only bare ${VAR} is in the documented substitution set). Fixing the detection by switching to ${CLAUDE_SKILL_DIR} (commit 1) made it clear that the whole cache-walking approach was unnecessary: delete it and call the right command instead (commit 2).

Net change: 3 pre-resolved values instead of 4, no path-derivation of plugin cache or marketplace name, no rm -rf in the skill, and the recommended action is a single copy-paste command.

Test plan

  • Marketplace cache path: normal launch (no --plugin-dir), run /ce-update. Should report current vs. latest and either "up to date" or the claude plugin update recommendation.
  • Dev checkout path: claude --plugin-dir <repo>/plugins/compound-engineering, run /ce-update. Should report the skill directory path and explain no action for this session.

Compound Engineering
Claude Code

tmchow added 2 commits April 22, 2026 16:20
The pre-resolution commands used ${CLAUDE_PLUGIN_ROOT:-} inside $(dirname ...),
which silently expanded to empty because Claude Code substitutes bare
${CLAUDE_PLUGIN_ROOT} tokens at skill-load time but does not recognize the
${VAR:-} form. Result: the cache-directory discriminator always fell through
to the error sentinel, telling users "no marketplace cache found" even when
the cache was present with multiple stale versions.

Switch to ${CLAUDE_SKILL_DIR}, which is a Claude Code documented skill-body
substitution and reliably resolves. Derive plugin cache dir, cached version
folders, and currently-loaded version from this single source. Anchor the
pattern on $HOME/.claude/plugins/cache/ so the skill cleanly distinguishes
marketplace installs from --plugin-dir / dev-checkout sessions.

Also: friendlier no-marketplace message explaining --plugin-dir mode and that
the marketplace install (if any) is untouched; drop self-referential prose
that was itself getting substituted when the skill rendered.
Claude Code ships `claude plugin update <name>@<marketplace>` which
handles version comparison, marketplace refresh, and install updates in
one command. Replace the skill's bespoke cache-sweep logic (rm -rf of
stale version folders, advisory `/plugin marketplace update`, restart)
with a single recommendation to run that command.

Drop the pre-resolution of plugin cache directory and cached version
folders — no longer needed. Only the currently-loaded version is still
derived from ${CLAUDE_SKILL_DIR}, used to compare against the latest
release.

The marketplace name is hardcoded as `every-marketplace` rather than
derived from the skill path. That is the fixed publish destination for
this plugin; deriving it added complexity without flexibility.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d501f62a49

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/ce-update/SKILL.md Outdated
Comment thread plugins/compound-engineering/skills/ce-update/SKILL.md Outdated
@tmchow tmchow changed the title fix(ce-update): detect marketplace cache via CLAUDE_SKILL_DIR refactor(ce-update): replace cache sweep with claude plugin update Apr 22, 2026
Address two correctness issues from code review on PR #656:

P1: hardcoded marketplace name. The recommended update command used
`compound-engineering@every-marketplace`, but the marketplace name is not
fixed across users. The marketplace manifest declares the name as
`compound-engineering-plugin`, which is what the README install flow
(`/plugin marketplace add EveryInc/compound-engineering-plugin`) produces.
Only the Every-internal install uses `every-marketplace`. Derive the
marketplace name from the skill path instead so the recommended command
targets the user's actual install.

P2: cache-root prefix too narrow. The case pattern anchored on
`${HOME}/.claude/plugins/cache/`, so any non-default cache root (such as
a CLAUDE_CONFIG_DIR relocation, or container/CI layouts) was treated as
"not a marketplace install" and skipped. Broaden the pattern prefix to
`*/plugins/cache/` so any parent location matches while still rejecting
dev checkouts (they lack the `plugins/cache/` segment).

Both fixes share the same case pattern and derivation mechanics.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ae6f4d124

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/compound-engineering/skills/ce-update/SKILL.md
@tmchow tmchow changed the title refactor(ce-update): replace cache sweep with claude plugin update fix(ce-update): replace cache sweep with claude plugin update Apr 23, 2026
@tmchow tmchow merged commit b9ae6b7 into main Apr 23, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant