---
name: map
description: Create the codebase map as native rules, an index plus one card per area. Use to map, onboard or document a repo, or to start a map for a new project.
---
# Map the codebase
The map is plain Claude Code rules, so Claude Code loads it for you. Nothing here is injected by a hook.
```
.claude/rules/codebase-map.md the index, always loaded, 40 lines at most
.claude/rules/map/.md one card per area, loads when a file in the area is first touched
```
Never edit `CLAUDE.md`. Never write anything outside `.claude/rules/`.
A third kind of file exists only when an older map held guidance a person wrote: `.claude/rules/guides/.md`. See step 1.
## The files
**Index** (`codebase-map.md`), no frontmatter:
- What the system is, in two or three lines.
- The areas, one line each: name, what it owns, its card.
- The three to five key flows, each as a chain of areas or files ("request -> router -> billing -> ledger").
- Where the commands live (build, test, run), if the repo does not say so already.
**Card** (`map/.md`), about 2 KB at most:
```markdown
---
paths:
- "src/billing/**"
verified-at: