Check every map card whose area changed since its last check, and bring them in line with the code. Use when asked to refresh or check the codebase map. Sessions keep the cards of areas they work in current by themselves.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Refresh?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/eigenwise-refresh)
---
name: refresh
description: Check every map card whose area changed since its last check, and bring them in line with the code. Use when asked to refresh or check the codebase map. Sessions keep the cards of areas they work in current by themselves.
---
# Refresh the map
Each card says the commit it was last checked at (`verified-at`); this machine may hold a later check. A card with commits under its paths since then is unchecked, not wrong. Most of the time the change leaves it true, so check the diff first and re-derive only what the diff cannot settle. This is the full pass, for when someone asks.
If there is no `.claude/rules/codebase-map.md` and no card under `.claude/rules/map/`, there is no map yet. Use `map` instead.
## Steps
1. **Run the status script.**
```
node "${CLAUDE_SKILL_DIR}/../../scripts/map-status.mjs"
```
It prints JSON: one entry per card with `status` (`fresh`, or `stale` for a card with changes since its last check or one that cannot be checked), the number of `commits` under that card's globs since its last check that did not also change the card and changed more there than dependency manifests, lockfiles or tests (`countedFrom` says where it counted from: `verified-at`, `card-commit` when the stamp is not on this history, or `checked-here` for a later check recorded on this machine), 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`. A card with commits also has `since` (the commit to compare from), `diffStatCommand` and `diffCommand`; both commands are null when the card has more than 12 patterns. Beside the cards, `indexMissing` is true when cards exist and `.claude/rules/codebase-map.md` does not.
2. **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, the line about hand edits below last, 40 lines at most, no frontmatter. Say which you did.
- Commits counted: the area changed since the last check. Do step 3.
- 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 (step 4).
- `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 check 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 under 2.5 KB. Cut what a file name already says.
- Everything fresh and none of the above: say so in one line and stop.
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 changed cards. Keep its last line word for word, replace an older wording of it, and add it when it is missing:
Working in an area that has a card in `.claude/rules/map/`, or editing that card by hand: check the card against `git diff <verified-at> -- <its paths>` yourself, never asking the person; correct only a line that no longer holds and set `verified-at` to `git rev-parse HEAD` in the same commit as your change, under 2.5 KB; a card that still holds is recorded with the codebase-mapper plugin's `record_check` tool and nothing is committed for it; never make a commit only to move `verified-at`, which need not name the commit it sits in; never stamp a card nobody checked.
3. **Check each changed card against its diff.** This is the first path.
1. Run its `diffStatCommand`. If `diffCommand` is null, or the stat shows more than 400 changed lines, the diff is too large to read: re-derive the card (step 4) and say on one line which card and why.
2. Otherwise run `diffCommand` and read it. Compare each claim on the card (entry points, how it works, what it touches, the traps) with it.
3. Every claim still holds: change nothing in the card and record the check with the `record_check` tool (step 5). A claim no longer holds: edit only those lines from the code, reading the files where the diff is not enough, then move the stamp.
4. Say per card what you found: `checked, still true`, or what you edited.
A diff cannot show a line that was already wrong before. If a line looks wrong, re-read that part of the area.
4. **Re-derive a card the diff cannot settle** (no usable stamp, a diff too large to read). Read the files under its globs (`git log --oneline <verified-at>..HEAD -- <globs>` shows where to look first) and rewrite the card from what the code says now. A card is small, so rewriting it is cheap.
For several such cards in a large repo, you may send read-only scouts, one per card. If Sidequest is installed, tag each spawn `[route:explore]`. Scouts return findings and never write the map.
5. **Stamp or record.** A card you edited or re-derived: set `verified-at` to the current `git rev-parse HEAD`. A card you checked and left as it is: call `mcp__codebase-mapper__record_check` with its file name. It writes on this machine only, so nothing is left to commit. Never commit only to move a stamp. Never stamp or record a card nobody checked. The stamp vouches for every commit before it, committed or not; a commit that changes card and area together vouches for itself only, and a wording fix for nothing.
6. **Re-run the status script.** Every card you checked should show no changes since its check and no empty globs.
7. **Show the diff** (`git diff`). Leave the files in the working tree and do not commit.
## Cadence
Run it when asked, or before a release. Day to day, a session that works in an area checks that card by itself, and a change that makes a card untrue corrects it in the same commit. Nobody is asked.
## Limits
- Subagents never write the map.
- Do not touch `CLAUDE.md`.
- Do not add history, lessons or hand-written guidance to a card. A rewrite from the code erases them.
- Never touch `.claude/rules/guides/`. People write those files, and nothing here checks them.