Summary
Every coding agent must answer one question: which subset of the repository does the model see? Because a repo almost always exceeds the model's context window, the agent must budget what it loads. Four families of approaches have emerged for solving this context-budget problem: vector-embedding semantic search, agentic file discovery, symbol-graph ranking, and full-context loading.
Key Points
- Four families of approaches exist; each trades off index cost, retrieval quality, and agent-loop complexity.
- Family 1 — Semantic search: chunk and embed files, embed the prompt, load nearest neighbors by cosine similarity. Used by Cursor, Sourcegraph, and Copilot Workspaces.
- Family 2 — Agentic discovery: the agent runs grep/glob/find, reads the output, and asks for more. Used by Claude Code in agentic mode and OpenAI Codex.
- Family 3 — Symbol-graph ranking: parse the repo to an AST with tree-sitter, turn symbol references into graph edges, and rank with personalized PageRank seeded on files/symbols already in context. Used by Aider, RepoMapper, and several MCP servers.
- Family 4 — Full context: load everything; viable only for small repos.
- A common assumption — that the main gap versus Claude Code is a missing semantic index — is wrong: Claude Code is family 2, not index-based.
Concepts
- Context-budget problem — the problem of choosing which subset of a repository the model sees within its context-window limit.
- Vector-embedding semantic search — chunk-and-embed retrieval over file contents using cosine similarity to the prompt embedding.
- Agentic file discovery — the agent itself drives retrieval by issuing shell-style search commands (grep, glob, find) and iterating on results.
- Symbol-graph ranking — graph-based ranking over AST-extracted symbol references, typically with personalized PageRank.
- map_tokens — Aider's default budget for the repo map, ~1024 tokens.