Prompt
How do I find the right code or docs inside a large repo quickly?
Latest observation
Here’s a fast, practical way to navigate a large repo.
1) Start with the highest-signal files
Look for:
README.mddocs/CONTRIBUTING.mdARCHITECTURE.mdCHANGELOG.mdpackage.json,pyproject.toml,Cargo.toml,go.mod,pom.xml, etc.- build/config files:
Makefile,Dockerfile,.github/workflows/
These usually tell you:
- how the repo is organized
- the main entry points
- how to run/test/build
- where docs live
2) Search by intent, not by exact filename
Use ripgrep or your IDE search:
rg "feature name"rg "class Foo"rg "TODO|FIXME|HACK"rg "error message text"rg "endpoint-name"/rg "table_name"/rg "event_name"
If you know the behavior but not the file, search for:
- user-facing strings
- API route names
- function names
- config keys
- error messages
- tests related to the feature
3) Jump from tests to implementation
Tests often show the clearest path:
- search for the feature in
test/ortests/ - read the test name and assertions
- jump to the code under test
- follow imports/calls upward
This is one of the fastest ways to understand expected behavior.
4) Use “follow the wiring”
For code, trace:
- entry point → router/controller → service → model/storage
- CLI command → command handler → business logic
- UI page → component → hook/state → API call
When you find one relevant file, inspect:
- imports
- function calls
- references/callers
- nearby sibling files
5) Use structural search tools
Best tools:
- IDE “Find All References”
- “Go to Definition”
- “Go to Symbol”
ripgrepctags/universal-ctags- language-specific tools like
go doc,cargo doc,pydoc,jdtls
If available, use semantic search/indexing rather than plain text search.
6) Use the repo’s conventions
Large repos often have patterns:
cmd/for executablesinternal/for private codepkg/for public packagesservices/,controllers/,adapters/,domain/docs/adr/for architecture decisions
Learning the naming scheme pays off quickly.
7) Search for “anchors”
Good anchors include:
- a unique error string
- a config field name
- a route path
- a class or struct name
- a feature flag
- a test case name
- an enum value
Once you find one anchor, use references to expand outward.
8) Read the smallest useful slice
Don’t start by opening huge files end-to-end. Instead:
- scan file headers and imports
- skim top-level types/functions
- jump to the exact symbol
- read only the surrounding call chain
9) Keep a scratch map
As you explore, jot down:
- entry points
- important directories
- key symbols
- file paths for docs/tests
- “source of truth” files
This prevents re-searching the same repo over and over.
10) If you’re truly lost, ask the repo itself
Search for:
architecturedesignoverviewhow it worksFAQonboarding
And if there are codegen or schema files, those often reveal the main system boundaries.
A quick workflow
- Open README/docs.
- Search for the feature name or error string.
- Find related tests.
- Jump to implementation.
- Use references/call hierarchy to trace surrounding code.
Useful command examples
rg "payment_failed" .
rg "createUser" src test
rg -n "TODO|FIXME|HACK" .
rg --files | rg "README|docs|ARCHITECTURE|CONTRIBUTING"
If you want, I can also give you:
- a 10-minute repo triage checklist
- a best search strategy for a specific language (Go/Python/JS/Java/Rust)
- or a step-by-step method for finding docs in monorepos.