Understand code
Read-only. Don't change code unless the user asks.
Size it
- One question ("where is X handled?"): search, read the hits, answer with file:line.
- One area: entry point → main path → data stores → tests, in about a page.
- Whole repository: the full map below. For very large repos, send parallel read-only explorers (one per top-level area) and merge their conclusions; don't read every file yourself.
Map
- Shape: languages, build and test commands, top-level folders and what each owns (from manifests, README, AGENTS.md, CI config).
- Entry points: binaries, servers, routes, jobs, UI roots.
- Core flow: follow one real request or command end to end, with file:line at each hop.
- State and boundaries: databases, caches, external APIs, queues, auth.
- Conventions: error handling, tests, naming, how features are usually added (git log).
- Risks: hotspots (most-changed files), missing tests, dead code, surprising coupling.
Output a compact map with a diagram (Mermaid, or ASCII if Mermaid won't render) and links, not a
file dump. Optional tools when installed: graphify builds a code graph locally (its docs/media
pass calls a model, so it needs approval); never install them unasked.