The ten AXI principles, and the benchmark behind them
An agent using a tool works in a loop: run a command, read the output, decide, run the next one. Every pass through the loop re-sends the growing conversation to the model. So the expensive mistake is rarely one long response. It is the extra trip: re-running a command to check that empty output really meant zero, paging to find a total, or reading a manual before doing anything. AXI is Kun's list of ways a tool can save the agent those trips.
The most expensive token cost is often not a longer response — it's a follow-up call.AXI skill spec, §4
The ten rules at a glance
The titles below come from the spec's own principle list. The "why" column is our one-line reading of what each rule buys the agent.
| # | Principle | What it asks | Why the agent cares |
|---|---|---|---|
| 1 | Token-efficient output | Print TOON, not JSON, on stdout | Field names are said once per table, not once per row |
| 2 | Minimal default schemas | 3–4 fields per list row; --fields for more | Each extra field is paid again for every row |
| 3 | Content truncation | Show a preview of long text, its total size, and a --full flag | It can judge whether the rest is worth fetching |
| 4 | Pre-computed aggregates | "30 of 847 total", "checks: 3/3 passed" | No paging or second lookup just to answer "how many?" |
| 5 | Definitive empty states | Say "0 found" in words | Blank output looks like failure, so it retries |
| 6 | Structured errors & exit codes | Errors on stdout with a fix; no prompts; idempotent no-ops; reject unknown flags | It can recover in one turn and never acts on silently ignored input |
| 7 | Ambient context | An opt-in session-start hook prints a tiny dashboard; a skill as a second path | It starts work already knowing the state |
| 8 | Content first | No arguments shows live data, not usage text | The first call already returns something useful |
| 9 | Contextual disclosure | End output with a few complete next commands | It learns the tool by using it |
| 10 | Consistent way to get help | Short per-command --help; fast --version; home view names the binary | Lookups are cheap and scoped to the command in play |
1–3: say less, and say it once
TOON (Token-Oriented Object Notation) is a text format that writes a list of records as a header naming the fields, followed by one comma-separated line per record. JSON repeats every key on every object. The spec claims about 40% savings over equivalent JSON. That figure comes from the format's own documentation. Neither benchmark below measured it. Tools keep JSON internally and convert at the edge, just before printing.
# JSON: keys repeated per row
[{"id":"7","title":"Flaky login test","state":"open"},
{"id":"9","title":"Bump node","state":"closed"}]
# TOON: keys once, rows below
issues[2]{id,title,state}:
"7",Flaky login test,open
"9",Bump node,closed
Rules 2 and 3 apply the same thinking to fields. A list shows only what the agent needs to choose the next step, usually an id, a title and a status, so bodies and descriptions move to the detail view. In that view a long body is cut to a preview of a few hundred characters, followed by its total length and the flag that prints the whole thing. The spec is firm that the field should never vanish. A missing body sends the agent hunting, and a full one wastes thousands of tokens it may not need.
4–5: answer the next question before it is asked
Rule 4 adds a total to every list and inlines cheap derived state such as CI check results or a comment count. Rule 5 turns silence into a fact. Here is the difference for an agent asking whether anything is closed:
# before: exit 0, no output. Wrong filter? Auth problem? Nothing there?
$ tool list --state closed
# after
$ tool list --state closed
issues: 0 closed issues in this repository
The "before" version invites a second and third call to rule out the other explanations. The "after" version ends the line of inquiry.
6: errors the agent can act on
Rule 6 bundles four habits. Errors go to stdout in the same format as data, with a suggested fix, and with the wrapped tool's stack traces translated rather than leaked. Closing something already closed is a no-op with exit code 0, not a failure. Nothing ever waits on an interactive prompt. And an unknown flag is rejected by name, with the valid flags listed inline so the fix takes one turn instead of two. The spec's reasoning on that last point is worth quoting:
A dropped flag is worse than an error: the agent gets plausible-looking output it believes is scoped or filtered, then proceeds confidently on wrong data.AXI skill spec, §6
Exit codes are fixed too: 0 for success including no-ops, 1 for errors, 2 for usage mistakes. Progress chatter goes to stderr, because an agent reading "Fetching..." on stdout will try to treat it as data.
7–8: start with the state, not the manual
Rule 7 is the most architectural. A tool ships a setup command that the user runs on purpose. It registers a session-start hook in Claude Code, Codex or OpenCode, so each new conversation opens with a few lines of current state for this directory. That text loads on every session, so the spec asks for it to be ruthlessly small. As a second, lighter path, the tool ships an Agent Skill: a markdown file the agent loads only when the task matches. It should be generated from the same text as the CLI's home view, so the two never drift. Rule 8 is the same idea for the first command: running the bare tool shows live data with a couple of hints, not a page of usage.
9–10: learn the tool by using it
Contextual disclosure means each list or mutation ends with a few complete, runnable next commands. They carry forward flags like --repo and use placeholders where a value is unknown. A detail view that fully answers the question gets no hints, because there they are noise.
issues[2]{id,title,state}:
"7",Flaky login test,open
"9",Bump node,closed
count: 2 of 41 total
help[2]:
Run `tool view <id> --repo acme/web` for details
Run `tool list --repo acme/web --limit 50` to see more
Rule 10 keeps the fallback cheap. --help on a subcommand covers only that subcommand. The home view prints the binary's path and a one-sentence description. --version answers before the heavy part of the program loads, because harnesses call it constantly and every millisecond is paid at session start.
The benchmarks, as Kun reports them
The AXI repository publishes two studies. Kun designed both, ran both and published both, so everything in this section is self-reported. Each "condition" is one way of giving the agent access to the same service. MCP (Model Context Protocol) is the standard for exposing tools to a model as typed function schemas. "ToolSearch" loads those schemas on demand rather than all up front. "Code mode" has the agent write a script against typed wrappers. In both studies the agent and the grading judge were Claude Sonnet 4.6, with 5 repeats per task.
GitHub: 425 runs (17 tasks × 5 conditions × 5 repeats).
| Condition | Success | Avg cost | Avg duration | Avg turns |
|---|---|---|---|---|
| gh-axi | 100% | $0.050 | 15.7s | 3 |
| gh (CLI) | 86% | $0.054 | 17.4s | 3 |
| GitHub MCP | 87% | $0.148 | 34.2s | 6 |
| GitHub MCP + ToolSearch | 82% | $0.147 | 41.1s | 8 |
| MCP + Code Mode | 84% | $0.101 | 43.4s | 7 |
Browser: 490 runs (14 tasks × 7 conditions × 5 repeats).
| Condition | Success | Avg cost | Avg duration | Avg turns |
|---|---|---|---|---|
| chrome-devtools-axi | 100% | $0.074 | 21.5s | 4.5 |
| dev-browser | 99% | $0.078 | 28.6s | 4.9 |
| agent-browser | 99% | $0.088 | 24.6s | 4.8 |
| chrome-devtools-mcp-compressed | 100% | $0.091 | 29.7s | 7.6 |
| chrome-devtools-mcp-search | 99% | $0.096 | 29.4s | 7.5 |
| chrome-devtools-mcp | 99% | $0.101 | 26.0s | 6.2 |
| chrome-devtools-mcp-code | 100% | $0.120 | 36.2s | 6.4 |
What the numbers show, and what they don't
The clearest signal is MCP versus shell. In the GitHub runs, the three MCP setups averaged 137K–176K input tokens per task against about 46K–47K for the two CLIs, and cost two to three times as much. The study also finds that loading schemas lazily did not pay off. The ToolSearch setup started with a smaller context but spent extra turns finding tools, and each turn re-sends everything. That is rule 4's warning about follow-up calls, showing up in the data.
gh-axi against plain gh is a much narrower result. Cost ($0.050 vs $0.054), turns (3 vs 3) and input tokens are close. The gap is in success. The study credits much of it to tasks where a total count or a hinted next step mattered. On the label-listing task, the plain CLI went 0 for 5 because it could not tell whether it had seen every label. In the browser study, all seven setups landed between 99% and 100% success, with 4 failures across 490 runs. The axi wrapper's edge there is cost and speed, and its lead over dev-browser is small.
- One model. Every published run used Claude Sonnet 4.6, as both agent and judge. The README notes that other models may respond differently to output format.
- His harness, his tasks. Kun wrote the tasks, the condition-specific setup notes each agent received, and the grading criteria.
- Narrow scope. The GitHub tasks all target one repository. The browser report lists its own limits: MCP setups start Chrome on every run (2–5 s of overhead), and schemas take a large share of input tokens.
- Which MCP. The MCP rows are specific servers and configurations (eager, ToolSearch, code mode, a compressed variant), not MCP in general.
- Small samples. 5 repeats per cell, and no confidence intervals are published.
The raw trajectories and grades are in the repository: the GitHub study and the browser report. Kun's longer write-up of the GitHub comparison is his essay I benchmarked GitHub CLI vs MCP vs Tool Search vs Code Mode on Medium. The spec and its catalog live at github.com/kunchenguid/axi.