Documentation

Docs / Evidence

Agent benchmark: method

This benchmark measures whether coding agents answer questions about a codebase more correctly, and with fewer tokens, tool calls and less time, when the Graphvein MCP server is attached. Every agent answers the same frozen questions twice: once with its own file tools only (base mode) and once with the Graphvein MCP server added (mcp mode). Answers are graded by a script against facts verified from the source code. No language model judges any answer.

The driver is scripts/benchmark/run.sh with its Go helper scripts/benchmark/gvbench. How to run it: README.md. Results of the first full run: results-2026-11-24.md.

Agents, harnesses and models

Agent id Harness Model Billing
claude Claude Code (claude -p) claude-opus-5-5 (default of --model-claude) API billing: ANTHROPIC_API_KEY set, runs with --bare, cost = Claude Code's reported total_cost_usd, hard cap below. Without the key: subscription sign-in, and the cost column is the CLI's own list-price estimate, not a bill
codex Codex CLI (codex exec) gpt-6.2-sol (default of --model-codex, from the Codex CLI 0.171.0 model catalog; fallback gpt-6.1-sol) ChatGPT sign-in; the CLI reports no cost
codex-visible Codex CLI (codex exec), mcp mode only as codex as codex; a variant that shows Codex the Graphvein tools (see "Agent settings")
opencode opencode (open source, MIT) deepseek/deepseek-v4.1-flash-1017 on OpenRouter billed per token by OpenRouter; hard cap below

Naming rules for every published result:

Questions and corpora

questions.jsonl holds 21 rows, BQ-1 to BQ-21, frozen: the second benchmark point reuses the same rows and corpus commits so the two points compare. Each row has the question, the answer schema, the expected answer, the evidence it was verified from and its grading rule.

Workspace

Graphvein index and MCP server

The index is built once per corpus before any run, with graphvein index <workspace> --repository <corpus> and GRAPHVEIN_SQLITE_PATH pointing at a store outside the workspace, so file tools cannot read it. Its wall time is recorded in the manifest and never added to per-question time. In mcp mode each agent starts the MCP server itself over stdio from its own configuration; the command (default graphvein mcp) and its arguments come from the driver's flags and are passed through unchanged, with GRAPHVEIN_SQLITE_PATH set to the corpus store.

Prompt

Identical for every agent and both modes; the only difference between modes is the attached server:

You are answering a question about the repository in the current directory. Do not modify files.
Use any tools available to you.

<question>

End your reply with exactly one fenced ```json block containing an object with these keys and value shapes: <answer schema>
Write file paths relative to the repository root, and routes as the HTTP method followed by the full path including every router prefix.

gvbench prompt --questions docs/evidence/benchmark/questions.jsonl --id BQ-n prints the exact text of a row.

Agent settings

Every run is a fresh process and a fresh session, run in the workspace, read-only, with no permission prompt possible:

Limits and outcomes

Outcome Meaning Graded
answered the run ended and its final message was graded yes
no_answer the final message has no parsable ```json object scores 0
timeout killed at the wall-clock limit scores 0
turn_limit the CLI reported its turn limit scores 0
cost_cap killed at the per-run ceiling scores 0
agent_error non-zero exit or a CLI-reported error; error_kind rate_limit stops the agent's remaining runs scores 0
invalid workspace modified; MCP server not connected in mcp mode (where the CLI reports it); an MCP server present in base mode; a web tool used; a configured tool denied (the row's detail keeps the first denial's error text, paths shortened; an opencode path refused by the external_directory rule is expected and does not count) retried at most twice
not_run_cap never started: the total cap could not cover its worst case not a failure
not_run_rate_limit never started: the agent hit a rate limit earlier; --resume continues later not a failure
not_run_preflight never started: the CLI or its sign-in failed the preflight not a failure

Preflight, before anything runs: each CLI path is given by a flag or an environment variable and never looked up on PATH; its --version is recorded; Claude's claude auth status and Codex's codex login status are classified (subscription, API key, not signed in, or "unconfirmed" when the output cannot be placed, which stops the agent unless the run passes --accept-unconfirmed-signin). A failure stops that agent only.

Metrics

Metric Claude Code Codex opencode
Input tokens (uncached) usage.input_tokens input_tokens − cached_input_tokens Σ tokens.input over steps
Cache read usage.cache_read_input_tokens cached_input_tokens Σ tokens.cache.read
Cache write usage.cache_creation_input_tokens not reported Σ tokens.cache.write
Output usage.output_tokens (thinking separately where reported) output_tokens (+ reasoning_output_tokens separately) Σ tokens.output (+ tokens.reasoning separately)
Cost total_cost_usd: the run's API cost on API billing (booked at a worst case when missing, see below); a list-price estimate, not billed, on a subscription none billed: the OpenRouter key's usage delta over the run; opencode's own estimate kept as harness_cost_usd
Tool calls tool_use blocks; MCP = mcp__graphvein__* completed tool items; MCP = mcp_tool_call on graphvein tool_use events; MCP = graphvein_*
Turns num_turns turn.completed events step_finish events
Wall time measured by the driver from process start to exit, the same way for every agent same same

MCP result sizes. For every MCP tool result the transcript shows, the row records the bytes the agent received (mcp_result_bytes), split into a text copy and a structured copy, and counts results that carried both (mcp_both_copies). A structured copy is a structured_content field, a non-text content block, or, in a text-only transcript, a JSON-object text block next to a plain-text block. This shows whether a client feeds a model both copies of the same result.

A metric a CLI does not report stays 0 and is named in the row's unreported list, so a zero is never read as a measurement.

Grading

The grader reads the last ```json block of the final message. Atoms are normalised before matching:

Matching is one-to-one. Call-site locations match when the file is equal and the lines differ by at most 2; a handler matches when its line is within the row's decorator-to-def range. Each key gets precision, recall and F1; an empty expected set is matched only by an empty answer; a missing key, a wrong value type or a duplicate atom counts against the answer. A run is correct only when every key has F1 = 1; the mean key F1 is reported as the score alongside.

Repetitions and order

Three repetitions per agent by default. An agent run on a subscription can be given fewer (--agent-reps codex=1) to stay within that plan's usage limits; the manifest records plan.reps and plan.agent_reps, the summary shows how many runs of each agent started, and the results page states the counts. More repetitions of that agent can be added later with --resume and a higher count; runs already recorded are skipped. Agents run one after another, never concurrently. Within a repetition, all (question, mode) pairs of the agent run in a seeded shuffle (the seed is in the manifest), so the two modes of a question are not always adjacent and rate-limit or time-of-day effects fall on both modes. The summary reports correctness as k/n per row and the median (min-max) of every metric per agent and mode.

OpenRouter cost control

Serving provider

Each OpenRouter row records serving.provider, serving.endpoint, serving.quantization and the evidence they rest on:

served_elsewhere is set when a reported provider is not a preferred endpoint's, or when price evidence matches no preferred endpoint.

Claude API cost control

Applies when ANTHROPIC_API_KEY is set (or the CLI's own sign-in is an API key allowed with --allow-api-billing).

Graphvein identity

Results are produced in Graphvein's private development repository, whose commit ids never become public: the public repository is built from snapshots of it (scripts/public-snapshot.sh). The manifest therefore records, beside the private commit (graphvein.commit, an internal reference only):

A published result names the public commit whose tree id (git rev-parse <commit>^{tree}) equals the recorded public_tree, once the public repository exists. If the binary was built from uncommitted changes, the tree id names the commit, not those changes. The ids match only if the public commit keeps the snapshot's files byte for byte, including the executable bit (a commit made on Windows with core.fileMode false records every file as non-executable).

Re-running selected runs

--rerun LIST runs only the listed run ids (* matches any text, e.g. codex-visible-mcp-*); every other planned run is left out, and a pattern that matches no planned run stops the driver. Runs of an earlier label are re-run under a new label that holds only them (for the first full run: 2026-11-24-r2), so the original rows, grades and summary stay as recorded and the new runs are reported beside them, never merged into them. The manifest records the list (plan.rerun).

What is committed

Per run label, under docs/evidence/benchmark/runs/<label>/:

Raw transcripts stay in the work directory on the machine that ran the benchmark; their hashes in runs.jsonl let anyone holding them check that they are the ones graded.

Stand-in mode

--standin replaces every agent CLI with the helper's stand-in, which prints canned transcripts in each CLI's output format, picks a scenario per question and mode (correct, wrong, malformed, hang, rate limit, a cost stream that crosses the per-run ceiling, a run billed at a non-preferred endpoint, a Claude result without total_cost_usd, a transcript that contains the API key), and serves OpenRouter key usage from a local file. Like Claude Code, the stand-in refuses --bare without ANTHROPIC_API_KEY and then reports the key as its credential, so the test sees which auth path the driver chose. It tests the driver, the parsers, token capture, grading, the timeout, the per-run ceiling and the total cap with no CLI, no sign-in, no network and no spend (bash scripts/benchmark/test-run.sh, part of scripts/test.sh).

Provisional details

These come from the CLIs' documentation, help output and released code, not yet from a signed-in run, and are checked by one real run of BQ-1 in each mode per CLI before the full run (the canned transcripts are replaced by sanitised captures of those runs):

Report a problem with this pageSource: docs/evidence/benchmark/method.md