AI Coding Agents
Serena vs Repomix vs Graphify for Codebase Context
Choose Serena for live symbol and reference queries, Repomix when the model needs a portable snapshot of selected files, or Graphify when it needs to explore relationships across a project. Their token costs depend on the actual context sent, including repeated snapshots, search results, and follow-up reads needed to verify an answer.
What each approach gives the agent
| Dimension | Serena | Repomix | Graphify |
|---|---|---|---|
| Unit of context | Symbol, references, outline, or another response from a semantic tool | Files packed into a document or structured export | Relationships returned from a persisted graph |
| Where the work happens | In a project-aware tool backend connected to the agent through MCP | As a packing step before the output is attached, read, or otherwise provided | As a graph build, then queries against the graph |
| Best starting question | Where is this function defined and who references it? | Can you review this exact set of files together? | How does this part of the application connect to another subsystem? |
| Freshness check | Verify the active checkout, language backend, and results against the source | Regenerate or supplement the snapshot after changes | Check the graph’s revision or refresh it, then verify important edges in source |
| Main billable input to count | Tool definitions or discovery plus returned context and fallback reads | The part of the packed artifact and its history that the provider actually receives | Integration instructions, returned subgraphs, and supporting source reads |
Start from the question the agent needs to answer. A relationship may be enough to locate evidence, but a reviewer deciding whether changing a default breaks an old caller needs the relevant source and tests. A matching tool reduces how much unrelated context the agent reads on its way to that evidence. Serena, Repomix, Graphify
Precision when navigating and editing symbols
Serena connects an agent to code intelligence through MCP. Its README describes a language-server backend enabled by default and an alternative JetBrains plugin backend. Both provide symbol lookup, outlines, and references. Backend capabilities differ. The table in the README lists dependency search and type hierarchy for JetBrains, while some implementation lookups through language servers depend on language support. Keep those differences in view when trying it in a mixed-language repository. Serena semantic code tools review
For a cross-file callback rename, begin with the symbol and its callers. Have the agent inspect the definitions around ambiguous references and check the diff after the edit. The cost advantage is plausible when a small set of symbol responses replaces many search-and-read calls. It shrinks if the agent follows every hit by loading entire files. It also shrinks when language-server preparation fails and the agent repeats the investigation using shell tools.
Semantic results need a fallback for behavior beyond what static analysis can resolve. For example, a framework might select a callback by name from config, or a template might refer to the name as a string. Verify those surfaces with ordinary search and targeted checks when they are relevant. An open Serena issue titled “zls: rename_symbol silently omits edits in files that are not open” identifies a specific case to include in a trial using that backend. The title provides no basis for estimating how often it occurs. Serena cross-file rename issue
Reproducibility with a packed snapshot
Repomix combines selected repository files into an artifact with structure and metadata. The README describes XML as the default and also documents Markdown, JSON, and plain-text output. You can filter with includes and ignores or supply a file list. This works well when the consumer has a chat or API interface and the files are already known, or when you want a fixed input to compare across models. Save which revision and selection rules produced it. Repomix packing guide
Use a narrow pack for a concrete review. If a change touches a parser and its public callers, include those files and the relevant tests. An entire monorepo makes the reader and model sort through unrelated projects with every upload. Conversely, filtering only the edited files may hide the behavior the reviewer needs to check. Include the files that define the compatibility requirement, even if they have no diff.
Repomix’s optional Tree-sitter compression extracts essential code structure, such as class and function declarations. Use a compressed view to orient the reader. Include the uncompressed body for the code under review when implementation details determine correctness. Check the output token estimate before attaching it, allowing room for instructions, the reply, and later turns in the target model’s context window. A local packed-file estimate depends on the tokenizer selected. Provider-reported usage tells you what the actual request was billed. LLM context windows
The artifact can be reproduced from its revision and settings, but it only describes the files at pack time. If you use it after editing the working tree, record whether the snapshot represents the starting point or the latest state. A reviewer who sees good evidence from the wrong revision can approve an outdated implementation. For an ongoing review, use a fresh scoped pack or attach the current relevant source alongside the explicitly dated snapshot.
Orientation with a persistent graph
Graphify’s README describes local Tree-sitter parsing for code and an optional semantic pass for documents or media with a model backend. A build yields a JSON graph, an architecture report, and an HTML view in the illustrated setup. Scoped graph queries can find paths or related components without feeding the entire graph to the model. That makes the build useful across sessions when people keep asking architectural questions about the same codebase. Graphify knowledge graph review
For a question about how an endpoint reaches storage, query the relevant path and inspect the location behind each important edge. Graphify labels edges as EXTRACTED or INFERRED in its README examples. Use those labels to decide where to verify the relationship. A path is a map for source inspection. An inferred hop may be useful as a lead, and a missing hop may reflect how the graph was built. A graph query cannot substitute for running the project’s checks when a proposed edit depends on runtime wiring.
Graphify’s code-only build is documented as local and model-free. The billed coding agent can still read graph responses and source files, and a semantic pass over documents or media can add model use. Evaluate both the local CLI and the MCP route by what they return, including how much graph data is in the request. The README distinguishes project instructions that steer the local CLI from the server-provided instructions and tools for an MCP connection. Verify which graph your agent actually queried before interpreting any result.
Freshness affects usefulness. Refresh the graph when the source changes, and ask the agent to verify whether the returned path exists in the current checkout. An open Graphify issue describes node IDs colliding for files that share names while differing by extension or path. Its title gives a concrete fixture for a team whose projects repeat names across directories, without quantifying the scope of any impact. Graphify node ID issue
Privacy and operational boundaries
For Serena, verify the active project before any write and especially when more than one checkout is open. A client-launched server and a shared HTTP server have different operational boundaries. Serena’s evidence includes an open issue about globally shared active-project state on a shared server. Use the host and project configuration appropriate for your trial, and validate the location and diff of an edit. The project’s statement about MCP integration does not define where your agent provider stores the returned data. Serena shared server issue
For Repomix, perform the file selection before packaging and inspect the artifact itself before attaching it. The README describes Secretlint screening for known credential formats, and ignore files give you control over inclusion. A project-specific secret or customer record can still be sensitive even if it resembles ordinary source or text. Treat the packed artifact as a copy of the selected codebase and store and share it under the same rules. The README also describes an MCP sandbox option for scoping file tools to a workspace, which is separate from what the artifact contains.
For Graphify, decide whether indexing may include documents and media and whether the assistant can use a model for that stage. Local code parsing and sending a query result to a hosted agent are separate data movements. Check the storage and sharing rules for the output artifacts themselves, especially if they include source locations and internal design relationships. Assess the hosted and local deployments independently.
Compare total cost across representative queries
Run a reference question, a scoped source review, and an architecture question against the same revision. Begin with your agent’s usual tools as the baseline. Use the same model, effort, permissions, and acceptance checks. For a reference question, score whether the agent finds the real definition and the relevant callers. For a snapshot review, compare its findings against an agreed checklist and the original files. For an architecture question, require source evidence for the path and look for important links the answer missed.
Log all agent calls from setup or attachment through verification, including fallback reads. For Serena, note language-server startup and count tool responses. For Repomix, record packed size, what the client transmitted, and how often the pack was included again. For Graphify, measure initial build and refresh time, any separately billed semantic extraction, and the input size of the returned subgraphs. Record any extra tool or model calls prompted by stale data or incomplete results. Keep the same acceptance bar across all arms. Measure coding agent token savings
Report fresh input, cache reads, cache writes, and output where the provider supplies them. A large stable snapshot may be cheaper on a warm cache than its raw token count suggests. A query-based approach may send few tokens per result while taking several calls to reach the same evidence. Report initial setup and recurring task costs separately so the team can tell how much reuse is needed. The supplied sources do not establish a head-to-head cost ranking for these three tools.
Pick by the evidence your task needs
Pick Serena if you repeatedly need precise symbol navigation in a live checkout. Start with a representative definition and its references in the backend you plan to use. Require source checks for dynamic or cross-language behavior and verify the resulting diff on an isolated change before relying on editing operations.
Pick Repomix if you want to hand a model a reproducible body of source. Filter by the question, record the revision, and check the size before attaching. Use compression when outlines are enough and retain exact bodies where acceptance depends on implementation.
Pick Graphify if the recurring problem is finding relationships among unfamiliar parts of a project. Start with a locally built code graph and a known path you can verify. Add document or media extraction only when it has a clear role in the questions your team asks and its processing is allowed.
You can use a graph to discover where to look and then use a symbol tool or scoped pack to provide exact evidence. Test each stage’s contribution before stacking them. Sending the entire architecture report and full repository pack on every turn can recreate the context problem that a scoped query was meant to solve.
Sources
- Serena README and semantic capability matrix (GitHub, accessed 2026-11-30)
- Repomix README and packing options (GitHub, accessed 2026-11-30)
- Graphify README and query examples (GitHub, accessed 2026-11-30)
- Serena issue on cross-file rename behavior (GitHub, accessed 2026-11-30)
- Serena issue on shared server project state (GitHub, accessed 2026-11-30)
- Graphify issue on node ID collisions (GitHub, accessed 2026-11-30)
How this note was produced
Drafted with AI assistance from committed ByteCosts pricing snapshots and deterministic cost formulas. Figures are grounded in the linked sources (last updated 2026-11-30). Read our editorial & automation policy, inspect the methodology, or report a discrepancy.
Serena vs Repomix vs Graphify for Codebase Context. ByteCosts. Updated 2026-11-30. https://bytecosts.com/blog/serena-vs-repomix-vs-graphify/