Systematic Codebase Exploration
Start with the big picture
codemap .: project tree with file counts and top extensions
codemap --deps .: dependency flow showing how packages connect
- Hub files: these are the most important files to understand first
Trace a feature
- Find the entry point (CLI command, API route, event handler)
codemap --importers <entry-file>: who calls this?
codemap --deps .: follow the import chain
- Read hub files in the chain first: they define the shared types/interfaces
Understand a subsystem
- Check
.codemap/config.json for routing subsystems: they define logical boundaries
- Each subsystem has paths, keywords, and associated docs
- Read the subsystem's docs first, then trace the code
Find what you're looking for
| Question |
Command |
| Where is X defined? |
codemap find "<words from its name>" |
| Where is this bug? |
codemap find "<symptom words>" scores names first, then body text ((body) hits); grep for the exact symptom text |
| Who uses X? |
codemap --importers <file> |
| What's the architecture? |
codemap --deps . → look at hub files |
| What changed recently? |
codemap --diff |
| What was I working on? |
Check working set in prompt-submit output |