From codebase-mapper
Refresh an existing codebase map in .claude/.codebase-info/ so it reflects the current code. Detects what changed since the map was last written, updates only the affected atomic docs, and re-records state. Use when the user asks to "update the codebase map", "refresh codebase docs", "sync documentation", "the docs are stale", "update architecture docs", or after a change that affects architecture, structure, dependencies, the data model, entry points, APIs/events, or conventions. If there's no .claude/.codebase-info/ yet, use map-codebase instead.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codebase-mapper:update-codebase-mapThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Bring an existing map up to date with surgical edits — detect changes, touch only the affected
Bring an existing map up to date with surgical edits — detect changes, touch only the affected documents, keep everything internally consistent. This is a refresh, not a full rewrite.
A .claude/.codebase-info/ directory with INDEX.md must already exist. If it doesn't, stop and
use the map-codebase skill to create the initial map.
Read .claude/.codebase-info/.map-state.json to get gitCommit, mappedAt, and the list of
existing documents. Skim INDEX.md to recall what's already covered. (If .map-state.json is
missing — e.g. a map from an older version — fall back to the mappedAt date in INDEX.md, and
plan to write a fresh .map-state.json at the end.)
Git repo (preferred — precise): diff against the last-mapped commit.
git diff --stat <gitCommit>..HEAD # which files changed, added, deleted
git log --oneline <gitCommit>..HEAD # what the changes were about
git diff <gitCommit>..HEAD -- package.json pyproject.toml go.mod Cargo.toml composer.json Gemfile # dependency churn (adjust to the project's manifests)
No git, or no stored commit (fallback): find source files modified since the map was written.
# files newer than the index (skip noise dirs)
find . -type f -newer .claude/.codebase-info/INDEX.md \
-not -path '*/.git/*' -not -path '*/node_modules/*' -not -path '*/vendor/*' \
-not -path '*/dist/*' -not -path '*/build/*' -not -path '*/target/*' -not -path '*/.venv/*'
An update is not only "edit the docs that exist." First re-evaluate which documents this codebase now warrants, because the right set drifts as the project grows. The map should always carry the docs that apply now, no more and no less:
Dockerfile/compose.yaml, so
create docker.md now even though the last map had none. First datastore → add database.md. First
dependency manifest → add dependencies.md. A new major subsystem that no standard doc covers → add
a custom doc (e.g. ml-pipeline.md, realtime.md), the same way map-codebase would. This is the
common case the user cares about: you don't make docker.md until there's Docker, and once the code
is dockerized, the next update is exactly when it should appear.INDEX.md row.Then map the remaining changes onto the existing documents:
| If this changed… | Update… |
|---|---|
| Directory layout (folders added/removed/renamed) | directory-structure.md |
| Components / services / module boundaries | architecture.md, modules.md |
| New/removed routes, CLI commands, jobs, handlers | entry-points.md |
| API contracts, events, queues, integrations | communication.md |
| Schema, migrations, new tables/collections | database.md |
| Dependency manifest (added/removed/upgraded) | dependencies.md, maybe tech-landscape.md |
| Design patterns, error handling, test setup, config | patterns.md |
| Linter/formatter config or naming conventions | coding-style.md |
| Container/compose setup | docker.md |
| Setup steps or common processes | onboarding.md |
| Project name/description, or any doc added/removed | INDEX.md |
Prioritize structural changes (new/removed entry points, components, infra, data model) over cosmetic ones. Skip pure internal refactors that don't change any documented interface, layout, or convention.
For each affected document:
*Last Updated: YYYY-MM-DD* line to today's real date.Then carry out the additions and removals you identified in Step 3:
../map-codebase/references/document-templates.md (or, for a non-standard aspect, follow the same
shape), then add it to INDEX.md and to the documents list in state.INDEX.md row), or
prune the stale sections from a shared doc. Remove orphaned references.Rewrite .claude/.codebase-info/.map-state.json after the final document edits:
mappedAt: today's dategitCommit: current git rev-parse HEAD (or null if not a git repo)documents: the current set of docs (reflecting any added/removed)hashes: SHA-256 hashes of the exact final contents of INDEX.md and every listed documenttool and bump version to match the plugin if neededStage the final document contents first, then atomically replace .map-state.json. A manual edit or
interrupted write can leave hashes stale; that is safe because hooks hash live files and treat the
manifest only as a consistency check.
Then summarize for the user: which docs you updated, created, or removed, and why. Remind them to commit the changes so the team and future sessions stay in sync.
mappedAt/gitCommit in state (or nothing at all).CLAUDE.md. The plugin's hook handles loading; the map lives entirely in
.claude/.codebase-info/. Leave CLAUDE.md (and CLAUDE.local.md) alone.INDEX.md reflects any added/removed docsLast Updated dates current on every touched docCLAUDE.md left untouched.map-state.json rewritten with today's date, current commit, and document listnpx claudepluginhub eigenwise/eigenwise-toolshed --plugin codebase-mapperGenerates and incrementally refreshes a per-directory codemap (a codemap.md in each significant folder) so agents get a cheap, always-fresh structure map before exploring. Only regenerates maps for directories that changed since the last run, tracked via .rc/codemap state. Use to build or refresh the repo's codemaps; read the maps first in any exploration-heavy task to cut token cost. Do not use to analyze a specific bug or trace one flow (use rc-analyze).
Generate a structured, self-maintaining codebase map: a set of atomic Markdown docs in .claude/.codebase-info/ that ground every future Claude session in how the project is built. Use when the user asks to "map the codebase", "document the codebase", "create codebase documentation", "generate architecture docs", "onboard me to this project", "what does this codebase do", "bootstrap codebase docs", "set up codebase-mapper", or "analyze the project structure". Works for any language/stack and for both existing projects and brand-new or empty ones. To refresh an existing map after code changes, use update-codebase-map instead.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.