Systematic Codebase Exploration
Start with the big picture
codemap .— project tree, file counts, top extensionscodemap --deps .— how packages and files connect- Hub files (from HUBS: section) — understand these first, they define shared types/interfaces
Trace a feature
- Find the entry point (CLI command, API route, event handler)
codemap --importers <entry-file>— what calls this?codemap --deps .— follow the import chain downstream- Read hub files in the chain first
Find what you're looking for
| Question | Command |
|---|---|
| Where is X defined? | codemap --deps . → scan the output |
| Who uses X? | codemap --importers <file> |
| What's the architecture? | codemap --deps . → look at hubs |
| What changed recently? | codemap --diff |
| What was I working on? | Check working set in prompt-submit hook output |
Subsystems (if .codemap/config.json has routing)
Check codemap config show — routing subsystems define logical boundaries with associated docs and keywords. Read subsystem docs before tracing code.