Repository navigation
Description
Problem
Claude Code pins plugin installs to a commit SHA at install time and never auto-updates them. For sequant's plugin channel (/plugin install sequant@sequant-io/sequant, README line ~67) that means every user runs the skills/hooks from whatever version they installed, forever, unless they manually run claude plugin update sequant@sequant — and nothing anywhere tells them to.
Incident (2026-07-18): an installed plugin cache sat at 1.20.3 (installed 2026-03-27, gitCommitSha 173095d) through ~4 months of active use and ~15 releases, while npm and the marketplace were at 2.8.0. In a consumer repo set up with installedVia: "plugin" (which has no local .claude/skills/ fallback — bare and qualified skill names both resolve to the stale cache), /assess produced pre-2.x output: box-drawn command blocks, hardcoded npx sequant run, no CMD_PREFIX resolution (#740), none of the Chain:/Flags:/ACs-column format, pre-#533 spec-skip logic.
Notably, the marketplace clone at ~/.claude/plugins/marketplaces/sequant was current (tracking main, .claude-plugin/marketplace.json said 2.8.0). Only the installed cache under ~/.claude/plugins/cache/sequant/sequant/<version>/ was stale. The drift is therefore detectable locally with zero network.
Why this is worse than a cosmetic format skew
-qflag hazard: 1.20.3 skills emit-qmeaning quality-loop; since fix(cli): -q is short for --quality-loop, not --quiet — silently bypasses quiet-mode rendering #658 the 2.8.0 CLI reads-qas--quietand quality-loop is-Q. A stale skill driving a current CLI silently flips behavior.- Hooks drift too: the running hooks are
${CLAUDE_PLUGIN_ROOT}/hooks/*.shfrom the same cache, so shipped hook fixes (e.g. fix(hooks):^gh (issue|pr)prefix skip disarms all 5 pre-tool guards for compound commands, and re-breaks on anycdprefix #763's guard fixes) are not live for plugin users. - Silent and total: plugin-mode consumer repos have no local copies, no version file cross-check, and no visible signal. Users only notice when output "looks wrong."
Non-options
- Manifest-level version floor: not possible — plugins cannot declare a minimum Claude Code version and unknown manifest fields are silently ignored (verified during fix(hooks):
^gh (issue|pr)prefix skip disarms all 5 pre-tool guards for compound commands, and re-breaks on anycdprefix #763). - Server-side push: the
/releasestep/plugin marketplace update sequant-io/sequantrefreshes the marketplace listing, not anyone's installed plugin.
Proposed fix
Client-side, warn-only drift detection in the plugin's own hooks (they run from the cache on every session, so they are guaranteed present on exactly the affected installs):
On pre-tool (rate-limited), compare the running plugin's version (${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json or package.json) against the local marketplace clone's ~/.claude/plugins/marketplaces/sequant/.claude-plugin/marketplace.json. On mismatch, print one line:
sequant plugin v1.20.3 is stale (marketplace has v2.8.0) — run: claude plugin update sequant@sequant, then restart Claude Code
This check would have caught the incident above with no network access.
Acceptance Criteria
- Pre-tool hook compares the running plugin version against the local marketplace clone's
marketplace.jsonversion; zero network calls; pure shell (grep/sed — no jq dependency), consistent with hook portability constraints. - Warn-only: a single stderr line including the exact remedy (
claude plugin update sequant@sequant+ restart note); the tool call is never blocked and the hook exit code is unchanged. - Rate-limited via a stamp file (at most once per day per install) so the warning does not repeat on every tool call.
- Graceful no-op when: the marketplace clone is missing/unparsable, versions are equal, or the hook is not running from a plugin cache path (repo-local dev copies must not warn).
- README plugin-install section documents that Claude Code does not auto-update plugins and shows the update command.
-
/releaseskill post-release checklist notes that installed plugins update only viaclaude plugin update(distinguishing it from the existing/plugin marketplace updatelisting refresh).
References
- Motivating incident: stale-format
/assesscomments on admarble/ad-motion#76–78 (2026-07-18) - Related: feat: Improve plugin file sync for seamless updates #248 (plugin file sync, pre-2.0), fix(update/sync): sync reports 'up to date' on content drift; update overwrites in-place customizations (constitution) #708/fix(sync): areSkillsOutdated/checkAndWarnSkillsOutdated pre-flight is version-only — misses content drift (sibling of #708) #713 (npm-channel update/sync drift), chore(release): /release pre-flight should regenerate marketplace README + check README 'What's new' freshness #684 (marketplace artifact staleness at release), fix(cli): -q is short for --quality-loop, not --quiet — silently bypasses quiet-mode rendering #658 (
-q→-Qrebind), fix(hooks):^gh (issue|pr)prefix skip disarms all 5 pre-tool guards for compound commands, and re-breaks on anycdprefix #763 (hook-drift observation, manifest fields ignored)
Activity
admarble commentedon Jul 18, 2026
→ PROCEED — Well-specced warn-only hook; the manifest-version-floor non-option was already ruled out during #763.
Workflow: spec → exec → qa
Run:
sequant run 784 -QNotes:
-Q.admarble commentedon Jul 18, 2026
Plan (via /spec)
Complexity: Standard (6 ACs, 3 directories) · Scope:⚠️ SCOPE_WARNING (6 ACs, 3-dir spread) → quality loop enabled
AC Checklist
marketplace.json; zero network; pure grep/sed — Integration Testclaude plugin update sequant@sequant+ restart note); exit code unchanged, never blocks — Integration Test/releasepost-release checklist distinguishesclaude plugin update(installed plugin) from/plugin marketplace update(listing only) — Manual (QA content check)Implementation Plan
Phase A — hook check (AC-1..4) in
pre-tool.sh, mirrored identically acrosshooks/,templates/hooks/,.claude/hooks/:BASH_SOURCE[0]; gate on*/plugins/cache/*(repo-local copies no-op).${SCRIPT_DIR%%/plugins/cache/*}/plugins) — works underCLAUDE_CONFIG_DIRrelocation, no hardcoded~/.claude._LOG_DIRholding today's date; stamp from today → skip; stamp written only when a warning is emitted."version"with sed from the running cache's.claude-plugin/plugin.jsonand<plugins-root>/marketplaces/sequant/.claude-plugin/marketplace.json; empty/missing → no-op.Phase B — tests:
__tests__/plugin-staleness-warning.integration.test.ts, parametrized over all three hook copies (existing pattern), staging each into a tmpplugins/cache/sequant/sequant/<v>/hooks/tree: warn-once matrix + all four no-op scenarios.Phase C — docs (AC-5/AC-6): README install-section note;
/releaseSKILL.md checklist note (3 skill mirrors); sibling fix todocs/internal/plugin-updates.md(its update recipe omitsclaude plugin updateand overstates update notifications — contradicted by the motivating incident).Key Decisions
Open Questions
Workflow: spec → exec → qa (quality loop on; no browser test — hooks/docs only)
admarble commentedon Jul 18, 2026
Exec Complete
Commit: 377462d on
feature/784-feat-hooks-warn-when-the-installed-plugin-cache-ispre-tool.sh(all three mirrors, byte-identical): path-gated to*/plugins/cache/*, stamp-file rate limit (1/day), grep/sed only, warn-only stderr line with exact remedy, exit code untouched.__tests__/plugin-staleness-warning.integration.test.ts— 21 passed (7 scenarios × 3 hook copies); existing hook suite 183 passed; build ✅ lint ✅ lint:skill-calls ✅./releasechecklist distinction (AC-6, 3 skill mirrors),docs/internal/plugin-updates.mdrecipe corrections, CHANGELOG entry.Proceeding to QA.
admarble commentedon Jul 18, 2026
QA Review for Issue #784
AC Coverage
sed -nextraction from both manifests; no jq, no network calls; verified by 21 integration tests parametrized over all three hook mirrors$CLAUDE_PLUGIN_DATA/logs(falls back to~/.sequant/logs); second same-day run emits nothing (tested)*/plugins/cache/*path check onBASH_SOURCEprepare-marketplace.tstemplate) also has a plugin-install section — note added there too (52a6e14)claude plugin updatefrom marketplace-listing refreshclaude plugin update --helpverified the command exists and confirms "restart required to apply"Coverage: 6/6 MET
Quality Metrics
any)Execution Evidence
viteststaleness suitenpm run prepare:marketplaceSkill Command Verification
Release SKILL.md added lines contain
claude plugin update sequant@sequant— verified againstclaude plugin update --help(command exists; help text confirms restart requirement). No gh/npm/git commands added. Passed.Risk Assessment
prepare-marketplace.tshas no direct unit tests (template-only change; verified by regenerating the artifact). Zero-network property is by construction (pure file reads), not asserted by a test.post-tool.shalso runs from the cache but the AC scopes the check to pre-tool; adding it there would double the daily warning. No other cross-file siblings.Adversarial Re-Read
Findings: Ran the implementation against the issue's verbatim fixture (precheck
.checks.fixtures— byte-identical output). Audited evidence claims: all dogfood runs are post-fix validations, not bug repros. Surfaced one real gap — the generated marketplace README's install section lacked the note (feedback_docs_ac_all_locations class) — fixed in 52a6e14 and re-verified via regeneration. Non-Goals ("Non-options" in issue): no manifest version floor attempted, no server-side push — scope held. Status: Clean (after in-PR fix).CHANGELOG
✅
[Unreleased] → Addedentry with (#784).Verdict: READY_FOR_MERGE
All ACs met literally with runtime evidence; the one gap surfaced in review was fixed and re-verified within the PR.
admarble commentedon Jul 18, 2026
/fullsolve Complete
Issue: #784
Status: READY_FOR_MERGE
Summary
Iterations
PR: #787 — 8 CI checks dispatched, MERGEABLE
Ready for human review and merge.
feat(#788): harden plugin-staleness check — scan marketplaces, semver…
docs: sync reference/feature docs for the next release (#792)
feat(#784): warn when the installed plugin cache is stale
docs(#784): add no-auto-update note to the generated marketplace README