Token-Efficient Exploration
Goal
Learn just enough to act. Every file read and every line in chat costs tokens.
Search ladder (use in order)
- Grep exact symbol, error string, or route — not broad keywords.
- Glob by filename when you know the artifact (
*auth*,*.test.ts). - Read only the matched file — use
offset/limitfor large files. - Task/explore subagent only when the question spans many modules.
Stop as soon as you can name: file, function, and change.
Read discipline
| Do | Don't |
|---|---|
| Read 30–80 lines around the match | Read 500-line files whole |
| Read one example, infer the pattern | Read every similar file |
Open package.json / imports for deps |
Web-search what the repo already uses |
| Parallel grep on independent symbols | Sequential guess-and-check reads |
Tool hygiene
- Batch independent greps/reads in one turn.
- Never paste large file contents into the user reply.
- Cite code with
startLine:endLine:path— don't duplicate blocks in prose. - Skip reading files you won't edit unless required for correctness.
When stuck
- Narrow the question ("where is X called?" not "how does the app work?").
- Grep callers/callees of the last symbol you found.
- Read tests for the target — tests are often shorter than implementation.
Exit criteria
Proceed to implementation when you can answer:
- What file(s) change?
- What function(s) change?
- What existing pattern to mirror?
If not, one more targeted grep — not another broad read.