← ctx-optimize

headless benchmark · three-way · run it yourself

Same model, same questions, one repo — answered three ways.

Don't trust our numbers — run them. This harness clones a small repo, builds both knowledge stores offline (no LLM), and lets the same model answer a set of questions three ways over OpenRouter. Tokens and dollars are OpenRouter's own accounting (usage.include=true), not our estimate.

armtools the model getsstore built with
a · shellrun_shell (grep/rg/find/sed/cat)
b · ctx-optimizequery/card/affected/path/explain + shell for gapsctx-optimize add .
c · graphifyquery/explain/affected/path + shell for gapsgraphify update . --no-cluster

Last CI run — gorilla/mux, openai/gpt-4o-mini

gorilla/mux is a small, well-named repo — plain grep's best case, i.e. the hardest terrain for a graph to win on. Deltas are vs arm a (shell).

metrica shellb ctx-optimizec graphifyb vs ac vs a
tokens15,0789,65918,352−36%+22%
cost$0.0024$0.0016$0.0025−31%+7%
tool calls1148−64%−27%
wall time16.5s11.8s18.7s−29%+13%
Read it honestly. ctx-optimize beats plain shell on every axis and answers most questions in a single query/card call. graphify cuts tool calls too — but its query returns a raw BFS dump of 100+ nodes, so the model burns more tokens wading through it, landing graphify above plain grep on tokens and cost. Head-to-head, ctx-optimize uses about half graphify's tokens, cost, and steps. Both arms answered correctly with file:line citations — a cheaper wrong answer would be a loss, not a saving.

The actual run — raw records, nothing massaged

This table wasn't typed by hand — a GitHub Actions job produced it, headless, on a clean runner. Open the run and read every log line yourself:

▶ Watch this run on GitHub Actions →

The workflow lives in this public repo, so the run is fully viewable and forkable — no private access needed. Below are the exact raw records it wrote, straight from the job's artifact: each file is the model's full transcript for one arm × one question — the tools it called, OpenRouter's token/cost accounting, and the final answer.

fieldvalue
workflowbenchmark.yml · public, forkable
run#29193645340 · commit 9529e8e
date2026-07-12 · conclusion success · headless
modelopenai/gpt-4o-mini via OpenRouter

The 12 raw records (arm × question) + the generated summary — open any one:

SUMMARY.md a·shell q1 a·shell q2 a·shell q3 a·shell q4 b·ctx q1 b·ctx q2 b·ctx q3 b·ctx q4 c·graphify q1 c·graphify q2 c·graphify q3 c·graphify q4

Reproduce it — no source needed

The harness runs on the published CLI. Both stores build offline; only the model calls cost anything (cents on a cheap model).

npm i -g @muthuishere/ctx-optimize   # the store CLI
pipx install graphifyy               # the competitor (arm c; optional)
export OPENROUTER_API_KEY=sk-or-...  # read from env only, never logged

# grab the harness (the five files below) into proof/agent/, then:
bash proof/agent/run-bench.sh        # defaults: gorilla/mux, openai/gpt-4o-mini
# options: --model <slug>  --repo <url> --name <short>  --questions <file>

It prints a per-question table, the totals above, and writes one raw JSON record per run (inspect the answer field and judge quality for yourself). arm c is skipped automatically if graphify isn't installed.

The harness

Every file, plain and readable — nothing hidden:

agent.mjs run-bench.sh summarize.mjs questions.json benchmark.yml (the CI workflow) README.md

We run benchmark.yml on every push; it produces this exact table in the job summary and uploads the raw records as an artifact.

ctx-optimize · headless benchmark · numbers are OpenRouter's own usage accounting