From code-map
How to read code efficiently in a repo indexed by code-map (a `.map-index.json` is present, or a `code-map` / `map-mcp` MCP server is available). Use whenever you inspect, navigate, or pull the body of a function/class/symbol — to choose between grep (search) and code-map `read` (pull exact slices) and to avoid the double-call that wastes tokens on discovery. Triggers: reading a known symbol, batch-reading several symbols, refreshing reads after edits, "where is X", "show me the body of X".
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-map:code-map-retrievalThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
code-map's `read` returns the **exact bytes of one symbol** (a function/method/class body —
code-map's read returns the exact bytes of one symbol (a function/method/class body —
not the whole file), by id or by name / path#name. It is drift-resistant: if the file
moved since indexing it re-anchors on the signature line and flags the result; if the anchor
is lost it says so. It does not search — grep does the finding, read does the reading.
You already know the refs/names (the task names them, or you have them from a prior step)
→ make one read with refs: [all of them]. Do not grep first; do not cat/sed/nl
the bodies. One round-trip, exact slices, still correct after edits.
You must discover where something lives
→ use grep / rg. If grep's output already answers the question, answer from it and stop.
Do not follow up with a read, and do not keep grepping just to assemble refs for a batch read.
grep gave you a name/ref but not the body you need
→ escalate to one read for that symbol. That is the only time discovery should touch code-map.
Never fetch the same target twice — once by grep, once by read. Pick the single cheaper path.
Refreshing reads after the code changed
→ one read with refs: [your working set] and changedOnly: true. It returns current slices
only for symbols whose file changed, plus an unchanged id list — a "git status for your reads."
Don't re-read the unchanged ones; don't re-grep the tree.
read and grep don't answer "who calls X / where is X defined / what implements this"
precisely — grep drowns in name collisions on common method names. If the type-aware sibling
code-oracle is available (an MCP with callers, definition, implementations; engine =
tsgo for TS/JS, ty for Python), route those questions to it instead of grep — but weigh
the one-time warmup against repo size and how common the name is:
createMessage, getModel) →
callers (checker-grade, type-confirmed). Measured: ~31 % fewer files to read overall, 40–75 %
on common names. A distinctive name in a small repo → grep is already precise, stay on grep.definition.implementations (sound over-approx for blast radius).obj[k](), token-only DI) is invisible — read
those by hand; Python (ty) references are currently intra-file only. If code-oracle isn't
installed, fall back to grep (and code-map read for the bodies).read the full
body on top, you pay twice and lose to plain grep. Rule 2 is what keeps discovery a win rather
than a loss. In a 3-arm benchmark, adding exactly this routing flipped discovery from
~break-even/loss to a clear win and improved known-ref efficiency too — same tool, better routing.read resolves a name to one symbol; if a name is ambiguous, pass path#name or a precise id.read when a later read depends on what an earlier one shows.snippet, aim.status: "ambiguous" means your quoted text occurs more than once — don't
target blindly.Coordinates, not meaning: pull the raw slice and judge it yourself.
npx claudepluginhub annyeong844/map --plugin code-mapOffers UI/UX design guidance for web and mobile with 50+ styles, 161 color palettes, 57 font pairings, and 99 UX guidelines across 10 stacks. Use for designing pages, components, color systems, or reviewing UI code.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.