KUN // FIELD MAP
← the map
INTERFACES FOR AGENTS · PAGE 02 OF 11axi · TOON · contextual disclosure · self-reported results

The ten AXI principles, and the benchmark behind them

What each rule asks of a command-line tool, why an agent cares, and how much weight the published numbers can bear.
TL;DR — AXI (Agent eXperience Interface) is a short spec for CLIs that agents drive through a shell. Its ten rules all chase one cost: every token an agent reads, and above all every extra turn it takes. The rules are compact output, small default fields, truncation with a way out, counts up front, explicit zeros, readable errors, context at session start, data before help text, next-step hints, and tight per-command help. Kun's own benchmarks on Claude Sonnet 4.6 put his AXI wrappers cheapest and most reliable. They are one author's runs, one model and his own tasks, so read them as a strong hint, not a verdict.

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.

#PrincipleWhat it asksWhy the agent cares
1Token-efficient outputPrint TOON, not JSON, on stdoutField names are said once per table, not once per row
2Minimal default schemas3–4 fields per list row; --fields for moreEach extra field is paid again for every row
3Content truncationShow a preview of long text, its total size, and a --full flagIt can judge whether the rest is worth fetching
4Pre-computed aggregates"30 of 847 total", "checks: 3/3 passed"No paging or second lookup just to answer "how many?"
5Definitive empty statesSay "0 found" in wordsBlank output looks like failure, so it retries
6Structured errors & exit codesErrors on stdout with a fix; no prompts; idempotent no-ops; reject unknown flagsIt can recover in one turn and never acts on silently ignored input
7Ambient contextAn opt-in session-start hook prints a tiny dashboard; a skill as a second pathIt starts work already knowing the state
8Content firstNo arguments shows live data, not usage textThe first call already returns something useful
9Contextual disclosureEnd output with a few complete next commandsIt learns the tool by using it
10Consistent way to get helpShort per-command --help; fast --version; home view names the binaryLookups 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 benchmark: average cost per task by condition, self-reported avg cost per task (USD) · success rate gh-axi $0.050 · 100% gh (CLI) $0.054 · 86% MCP + Code Mode $0.101 · 84% GitHub MCP + ToolSearch $0.147 · 82% GitHub MCP $0.148 · 87%
GitHub benchmark, average cost per task. Self-reported by Kun: Claude Sonnet 4.6 as agent and judge, 17 tasks × 5 repeats = 85 runs per condition, all on one public repository, dated 2026-03-21. Bars are to scale.

GitHub: 425 runs (17 tasks × 5 conditions × 5 repeats).

ConditionSuccessAvg costAvg durationAvg turns
gh-axi100%$0.05015.7s3
gh (CLI)86%$0.05417.4s3
GitHub MCP87%$0.14834.2s6
GitHub MCP + ToolSearch82%$0.14741.1s8
MCP + Code Mode84%$0.10143.4s7

Browser: 490 runs (14 tasks × 7 conditions × 5 repeats).

ConditionSuccessAvg costAvg durationAvg turns
chrome-devtools-axi100%$0.07421.5s4.5
dev-browser99%$0.07828.6s4.9
agent-browser99%$0.08824.6s4.8
chrome-devtools-mcp-compressed100%$0.09129.7s7.6
chrome-devtools-mcp-search99%$0.09629.4s7.5
chrome-devtools-mcp99%$0.10126.0s6.2
chrome-devtools-mcp-code100%$0.12036.2s6.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.

Caveats.

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.

Next: The AXI shelf: gh-axi, chrome-devtools-axi, quota-axi and friends · Back to the map.