Your AI coding agent starts every session blind. Ask Claude Code, Cursor, or Codex a question about your repo and it does the same thing a new hire would: grep, glob, open a file, read 800 lines, open another file, repeat. That discovery loop burns tokens, wastes time, and still misses cross-file relationships that don't show up in a text search.
Codebase context tools fix this. They index your code once into something queryable (a knowledge graph, a vector index, or a virtual filesystem) and expose it to your agent, usually over MCP. The agent asks a targeted question and gets the exact code back instead of scanning for it. Fewer tokens, fewer tool calls, better first-attempt answers.
Below are seven open-source options, grouped by how they actually work. Each entry covers what it does, how it works, where it shines, and where it stops. Star counts are approximate and as of writing.
Code knowledge graphs
These parse your source into symbols and relationships (calls, imports, inheritance) and let the agent walk the graph.






