Skip to content

Analysis Coding

Better context, not more: pointing a coding agent at the right code

By Sheela ·

A developer fixing a bug doesn’t read the whole repository first. They search, follow references, read the few files that matter, change them and run the tests. Coding agents work better the same way. The tools below help at different stages.

Start with what you already have

Before adding anything, use deterministic tools. git diff shows what changed, git log and git blame show why, and the compiler, linter and test runner find errors more reliably than a model can. Give the model their output, not the job of guessing it.

Pack it: small repos and one-off questions

  • Repomix (4.3) packs a repository into one AI-ready file with token counts, secret filtering and optional compression. It is the default for this job, until the codebase outgrows the model’s context window.
  • code2prompt (3.8) does the same with templates and git diffs. Repomix has more safeguards and releases more often.
  • Riflet (3.5) is a point-and-click desktop app for people who won’t use a terminal. It is an early, closed-source beta.

Search it: let the agent find code by meaning

  • Serena (4.4) gives agents symbol-level tools backed by language servers.
  • Semble (4.1) and grepai (3.7) run semantic code search locally. Both are young, and their token-saving claims come from their authors.

Map it: relationships between files

  • Graphify (4.1) builds a local knowledge graph that an agent queries instead of grepping. Its documentation pass may send content to a remote model by default.
  • code-review-graph (4.0) and GitNexus (3.9) answer “what does this change affect?”. GitNexus needs a paid licence for commercial use.

Hosted options

  • DeepWiki (4.0) writes free wikis for public GitHub repos and has an MCP server. Good for orienting in an unfamiliar project, but its pages can lag behind the code.
  • Greptile (4.1) reviews pull requests against a map of the whole codebase. Deeper review modes use more credits.
  • Sourcegraph (4.2) is the proven option for search across many repositories, from a $16,000 minimum annual contract.

Which to use

Small project: git, ripgrep and Repomix are enough. Medium: add a project instructions file (CLAUDE.md or AGENTS.md) and one semantic search tool. Large or multi-repo: symbol tools, a code graph, and organisation-wide search. Whatever you pick, a short prompt that names the relevant files, the constraints and the known failure beats a huge one.