My coding agent is great at writing code and pretty bad at knowing where it is. Ask it to change one function and it greps, opens six files, guesses, and sometimes edits the wrong thing.
So I went through the open-source tools people use to fix that. Here are the nine I'd actually point a friend to, what each one is good at, and how to try it in a couple of minutes.
Quick disclosure: I work on Graphify, which is #1 here. Every tool on the list earns its spot. (If Graphify ends up useful to you, a ⭐ on GitHub genuinely helps.)
TL;DR: "context" means three different things for an agent: the structure of your code, the docs of other people's libraries, and plain fast search. Pick one tool per job instead of one tool for everything.
Star counts were checked on GitHub on Nov 9, 2026.
Your own codebase: structure and relationships
1. Graphify: a knowledge graph of your repo
Graphify (Apache-2.0, ~145k ⭐) turns a codebase, plus its docs, SQL schemas, configs and PDFs, into a queryable knowledge graph. Parsing is local and deterministic (AST, no embeddings, no vector store), and every edge is tagged EXTRACTED (read straight from the source) or INFERRED (resolved by Graphify), so you can see why two things are connected.
pip install graphifyy
graphify path "FastAPI" "ModelField"
graphify explain "APIRouter"
You get a graph.json, an interactive graph.html, and a GRAPH_REPORT.md with the most-connected "god nodes" and Leiden communities (your subsystems). It runs as a /graphify skill in Claude Code, Cursor, Codex and Gemini CLI, and there's an MCP server via graphifyy[mcp]. If you'd rather not run anything locally, the hosted version is at app.graphify.com.
Use it when the question is "how does X connect to Y?" or "what breaks if I touch this?"
2. Serena: IDE-grade symbol tools over MCP
Serena (~31k ⭐) gives your agent the things your IDE already knows: find symbol, file outline, find references. It does this by driving real language servers (LSP), and the README lists support for over 40 languages. Licensing is per component: the SolidLSP client is MIT and the Serena app is GPL-3.0-or-later.
Use it when you want symbol-level navigation and edits instead of text search.
3. Aider's repo map: the idea worth stealing
Aider (Apache-2.0, ~50k ⭐) is a terminal pair programmer, but the part I keep coming back to is its repo map. It builds a graph where files are nodes and dependencies are edges, ranks it, and sends the model only the most-referenced symbols that fit a token budget (--map-tokens, 1k by default).
Use it when you live in the terminal, or just read the doc. It's one of the clearest explanations of why structure beats dumping files.
4. Repomix: pack the whole repo into one file
Repomix (MIT, ~29k ⭐) packs a repository into a single AI-friendly file. The --compress flag uses Tree-sitter to keep signatures and drop implementation details, and --mcp runs it as an MCP server.
npx repomix@latest --compress
Use it when you're pasting a small or medium repo into a chat model, or handing a snapshot to someone else's agent.
Search: finding the right lines fast
5. ast-grep (+ its MCP server): search by syntax, not text
ast-grep (MIT, ~16.5k ⭐) is a Rust CLI for structural search, lint and rewrite. You write patterns that look like code, and it matches syntax trees instead of strings. The official ast-grep-mcp server exposes it to agents:
uvx --from git+https://github.com/ast-grep/ast-grep-mcp ast-grep-server
Use it when "find every call to X with two arguments" is the real question.
6. Probe: AST-aware search with zero indexing
Probe (Apache-2.0, ~740 ⭐) is the smallest project on this list and punches well above its size. It combines ripgrep speed with Tree-sitter parsing, takes Elasticsearch-style boolean queries ranked with BM25, and returns whole functions instead of random line fragments. No embedding model, no index step.
{ "mcpServers": { "probe": { "command": "npx", "args": ["-y", "@probelabs/probe@latest", "agent", "--mcp"] } } }
Use it when you want better-than-grep results without running a database.
7. Claude Context: semantic search over your code
Claude Context (MIT, ~13k ⭐) from Zilliz is an MCP server that indexes your codebase into a vector database (Milvus or Zilliz Cloud) so the agent can search by meaning. It's the most "classic RAG" pick here, and it needs a vector DB and an embedding provider to run.
Use it when your questions are fuzzy ("where do we handle retries?") and you're fine running a vector store.
Other people's code: docs and libraries
8. Context7: up-to-date library docs
Context7 (MIT, ~64k ⭐) from Upstash fixes the "the model learned an old version of this API" problem. Its MCP tools (resolve-library-id, query-docs) pull current, version-specific docs into the prompt. Setup is one command:
npx ctx7 setup
Then add "use context7" to a prompt, or tell your agent to always use it for library questions.
Use it when the bug is the agent using a deprecated API.
9. GitMCP: any GitHub repo as an MCP server
GitMCP (Apache-2.0, ~8.5k ⭐) is a free, remote MCP server. Point your agent at https://gitmcp.io/{owner}/{repo} and it can read that project's docs and code, even if the model has never seen it. There's also a generic gitmcp.io/docs endpoint for switching between repos.
Use it when you're working against a niche library with no docs in the model's training data.
How I'd combine them
- One structure tool for your own repo: Graphify for relationships across code and docs, or Serena for symbol-level navigation.
- One search tool: ast-grep for exact syntax, Probe for ranked results, Claude Context if you want semantic search.
- One docs tool: Context7 for popular libraries, GitMCP for everything else.
Repomix and Aider's repo map are worth knowing either way, if only to understand what "giving the agent context" actually means.
If you try Graphify, the fastest path is app.graphify.com, or pip install graphifyy and run graphify on a repo you know well. A ⭐ on GitHub helps a lot, and I'd love to hear what it finds in your repo in our Discord.
What's in your agent's context stack right now? Anything I missed that should be on this list?
Top comments (0)