Skip to content

Report a plugin cache copy that differs from the code clone at the same version - #55

Merged
gabe4coding merged 1 commit into
claude/eloquent-aryabhata-8f4a35from
claude/plugin-cache-content-check
Oct 13, 2026
Merged

gabe4coding merged 1 commit into
claude/eloquent-aryabhata-8f4a35from
claude/plugin-cache-content-check

Conversation

@gabe4coding

Copy link
Copy Markdown
Owner

Intent

Make kb setup check report when Claude Code's cache copy of the installed version differs from the code clone in bin/, hooks/, skills/ or types/: "same version, content differs: a bump is needed".

Drift

  • Added: types/ is in the list too, and hooks/*.test.tsx is left out. This matches the folders of the version test in tests/test_plugin.py, which now reads them from setup.CACHED_DIRS.
  • Not done: Codex. Its cache is not checked (a separate task is suggested for Codex version drift).

Decisions

  • Only kb setup check reports it, as asked. kb status and the SessionStart brief do not, because the check reads every file of two folder trees.
  • The check runs only when both versions are equal. When they differ, the existing plugin_drift() warning covers it.
  • Known gap: an untracked file in the code clone (for example bin/my-note.txt) is listed too.
  • Door: two-way. The change adds one JSON field and one line in the setup skill.

Evidence

drive.py sandbox with a fake Claude Code install record whose installPath is a copy of this checkout. The command is kb setup check, run from this checkout's bin/kb:

Before (main, from the code, not a run): check() in src/kb/setup.py has no such field, and plugin_drift() compares only versions. So this case is not reported.

After:

cache copy: plugins/cache/retroagent/retroagent/0.11.5
== cache copy equal to the checkout: exit 0, plugin_stale = []
== cache copy with bin/kb-guard changed and a skill missing: exit 0, plugin_stale = ['bin/kb-guard', 'skills/kb-search/SKILL.md']
== install record at another version: exit 0, plugin_stale = []

Reading map

Tests changed or deleted:

  • tests/test_plugin.py:47: CACHED now comes from setup.CACHED_DIRS (the same 4 folders as before).
  • tests/test_setup.py: 1 new test.

Config:

  • .claude-plugin/plugin.json, .codex-plugin/plugin.json: 0.11.4 → 0.11.5.

Public API:

  • kb setup check JSON: new key plugin_stale (list of paths).

Error handling:

  • src/kb/setup.py plugin_stale_files(): an OSError during the walk gives [].

Stack

Step 2/2. Previous: #54 (base of this PR). Next: none.

Merge order: merge #54 first. Then make sure the base of this PR is main before you merge it. GitHub changes the base only when the branch of #54 is deleted on merge. If the base stays on the #54 branch, this PR merges there and never reaches main.

🤖 Generated with Claude Code

plugin_drift() compares only versions. A change to bin/, hooks/, skills/ or types/ that got no new version leaves Claude Code's cache copy (installPath in installed_plugins.json) with the old files, and `claude plugin update` does not copy it again.

`kb setup check` now has "plugin_stale": the files of those folders that differ between the cache copy and the code clone when both have the same version. The setup skill says "same version, content differs: the code repo needs a new plugin version" with the files. Dot files, __pycache__ and hooks/*.test.tsx are left out. A file that cannot be read gives [] and no traceback.

The version test in tests/test_plugin.py now takes its folders from setup.CACHED_DIRS, so the two lists stay the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gabe4coding
gabe4coding merged commit 1bcf0ac into claude/eloquent-aryabhata-8f4a35 Oct 13, 2026
2 checks passed
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.

2 participants