/codebase-mapper:refreshfrom codebase-mapper
Refreshes stale codebase map cards by running a status script, identifying stale/empty/oversize cards, and re-deriving them from current code.
Ships in codebase-mapper. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Cards go stale one at a time. Each card says the commit it was last checked at (verified-at), so only the cards whose area changed need work.
If there is no .claude/rules/codebase-map.md and no card under .claude/rules/map/, there is no map yet. Use map instead.
Run the status script.
node "${CLAUDE_SKILL_DIR}/../../scripts/map-status.mjs"
It prints JSON: one entry per card with status (fresh or stale), the number of commits under that card's globs since its verified-at that did not also change the card (or since the last commit that moved the stamp when the stamp is not on this history; countedFrom says which), a reason when it cannot tell or could not use the stamp, emptyGlobs (globs that match no file), neverLoaded (./ patterns the host never loads) and oversize. Beside the cards, indexMissing is true when cards exist and .claude/rules/codebase-map.md does not.
Decide what needs work.
indexMissing: the map lost its index. Bring it back from git when it was deleted by accident: git restore .claude/rules/codebase-map.md while the deletion is not committed, else from the commit before the one git log -1 -- .claude/rules/codebase-map.md names. Otherwise write it again from the cards and the code: what the system is in two or three lines, one line per area with its card, the three to five key flows, 40 lines at most, no frontmatter. Say which you did.stale with commits: the area changed. Re-derive the card.stale with a reason and no commits counted (no verified-at, a stamp that is not a commit id, no usable paths, a pattern git could not count): fix the frontmatter, then re-derive.fresh with the reason that verified-at is not a commit in this repository: the stamp is a commit this clone never got, usually a branch commit that was squashed away. Leave the card. Its next refresh replaces the stamp.emptyGlobs: the area moved or was deleted. Fix the glob, or drop the card, or fold it into another.neverLoaded: drop the ./. README.md loads at any depth, /README.md only in the top folder.oversize: shrink it. Cut what a file name already says.Also look at the index. If areas were added, removed or renamed, or a key flow changed, it needs an edit too. The script does not watch the index, so check it against the stale cards.
Re-derive each stale card from the code. Read the files under its globs (and git log --oneline <verified-at>..HEAD -- <globs> for where to look first). Then rewrite the card from what the code says now. Do not patch it from a diff: a diff cannot show a line that was already wrong before the change. A card is small, so rewriting it is cheap.
For several stale cards in a large repo, you may send read-only scouts, one per card. If Sidequest is installed, tag each spawn [route:explore]. A scout returns what it found about the area. It never writes the map. You write.
Stamp the card. Set verified-at to the current git rev-parse HEAD. Only on a card you actually re-read. Never stamp a card you did not check. The stamp counts before the commit and for a map git does not track, and it vouches for every commit before it. A commit that changes the card together with its area vouches for itself only. Fixing the wording alone does not vouch for anything.
Re-run the status script. Every card you touched should be fresh with no empty globs.
Show the diff (git diff). Leave the files in the working tree and do not commit. Keep paths free of negation: the status script does not read it. Braces are fine (src/**/*.{ts,tsx}).
Refresh when the session line says cards are stale and you are about to work in that area, or before a release, or when asked. It is never needed after every change. A card that is a few commits behind and still accurate is fine: re-read it, change nothing but verified-at if it is still true, and say that you only confirmed it.
CLAUDE.md..claude/rules/guides/. People write those files, and nothing here checks them.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub eigenwise/eigenwise-toolshed --plugin codebase-mapper2 skills in this plugin
Other plugins' skills for the same job