token-bench · white paper · October 2026

The Context Tax

What a long AI chat costs in Claude Code, GitHub Copilot CLI and a RAPP Brainstem, measured with the same model on the same business questions.

The short version

Brainstem, /chat: 135,460 tokensBrainstem, /chat135.5kClaude Code, skill + script: 725,219 tokensClaude Code, skill + script725.2kClaude Code, agent.py tools: 997,840 tokensClaude Code, agent.py tools997.8kClaude Code, skill: 1,166,247 tokensClaude Code, skill1.17M
Input tokens to answer the same 15 business questions, median of 3 runs, Claude Haiku 5.5 on every host. Each setup answered 44 to 45 of 45 questions right; details below.

What we measured

We wrote five small business tasks that each need real rules: a tiered sales commission with clawbacks and a quarterly cap, overtime pay with holiday and Sunday rates, a reorder point with safety stock, late fees with a minimum and a cap, and a check for invoices paid twice. The data is synthetic: about 30,000 rows across nine CSV files.

Each task was packaged three ways from one Python implementation, so every setup carried exactly the same logic:

Three hosts answered the same questions: Claude Code (claude -p), GitHub Copilot CLI (copilot -p), and a RAPP Brainstem, a small local server that loads agent.py files and answers on POST /chat. Claude Code and Copilot received the agent.py files as MCP tools. All three ran Claude Haiku 5.5.

A session asked 15 questions in a row, such as "what commission does Casey earn for 2026-Q2?". Copilot sessions asked the first 5, because each Copilot turn took much longer. Every setup ran 3 times, and every answer was graded against the exact figure, to the cent. We counted input tokens: everything sent to the model on every call, cached or not, as each host reports it. Caching lowers the price of repeated context, but the context is still sent, still fills the window and still takes time to read.

The host charges before you ask

Each host sends its own instructions and tool definitions with every model call. We measured that charge with one trivial question.

Brainstem, five agents: 2,805 tokensBrainstem, five agents2.8kBrainstem, as used (22 agents): 8,716 tokensBrainstem, as used (22 agents)8.7kClaude Code, fresh setup: 15,176 tokensClaude Code, fresh setup15.2kClaude Code, as used: 32,295 tokensClaude Code, as used32.3kCopilot CLI, fresh install: 23,014 tokensCopilot CLI, fresh install23.0kCopilot CLI, as used: 33,719 tokensCopilot CLI, as used33.7k
Input tokens for "reply with just the number 7", median of 3 runs (1 run for the author's own Brainstem). Solid bars: a fresh setup. Striped bars: the same host as the author uses it every day, with its plugins, MCP servers, skills and memory.

A fresh Claude Code sends 5.4 times as much as a Brainstem, and a fresh Copilot CLI 8.2 times as much. Nobody keeps a fresh install for long. Every plugin, MCP server, skill and memory file you add is sent again on every call, and a long-used install pays for all of it: 32,295 tokens for Claude Code and 33,719 for Copilot CLI as the author uses them. The author's own Brainstem, with 22 agents loaded, sends 8,716.

Every question pays it again

A host runs several model calls per question: it reads the question, calls a tool, reads the result, and answers. Each call sends the host's instructions plus the conversation so far.

010.0k20.0k30.0k40.0k50.0k60.0k151015question numberClaude Code, question 1: 47,395 tokensClaude Code, question 2: 50,842 tokensClaude Code, question 3: 54,610 tokensClaude Code, question 4: 57,898 tokensClaude Code, question 5: 39,814 tokensClaude Code, question 6: 62,129 tokensClaude Code, question 7: 42,742 tokensClaude Code, question 8: 43,562 tokensClaude Code, question 9: 44,276 tokensClaude Code, question 10: 44,966 tokensClaude Code, question 11: 45,746 tokensClaude Code, question 12: 46,581 tokensClaude Code, question 13: 47,310 tokensClaude Code, question 14: 48,086 tokensClaude Code, question 15: 48,866 tokensClaude CodeBrainstem, question 1: 6,030 tokensBrainstem, question 2: 6,629 tokensBrainstem, question 3: 7,233 tokensBrainstem, question 4: 7,056 tokensBrainstem, question 5: 8,035 tokensBrainstem, question 6: 8,469 tokensBrainstem, question 7: 8,780 tokensBrainstem, question 8: 9,076 tokensBrainstem, question 9: 9,587 tokensBrainstem, question 10: 9,790 tokensBrainstem, question 11: 10,410 tokensBrainstem, question 12: 10,764 tokensBrainstem, question 13: 10,983 tokensBrainstem, question 14: 11,330 tokensBrainstem, question 15: 11,636 tokensBrainstem
Claude Code, skill + scriptBrainstem, /chat
Input tokens spent on each question in one 15-question session, median of 3 runs.

The Brainstem's cost per question grows slowly, from about 6k to 12k tokens over 15 questions, because it keeps only the plain text of earlier questions and answers. Tool output never piles up in its history. In a chat that re-sends everything, each new message pays for all the messages before it, so the total grows with the square of the chat's length. That is steep but not exponential. Prompt caching lowers the price of the repeated part. It does not shrink it.

Rules belong in code

How you package the rules mattered less than which host ran them. Rules written only as instructions were the most expensive setup on both hosts, because the model re-reads them and redoes the arithmetic for every question. That arithmetic went wrong on 4 of 120 answers, by 1 to 180 dollars. Our first wording of the rules was also ambiguous about rounding, and the models filled the gap their own way (see the corrections at the end). Code leaves no such gap.

SetupTokens, whole chatRightSeconds / answer*Agent tool used
Brainstem, /chat (15 questions)135.5k45 of 453.8 s
Brainstem, new chat per question90.4k45 of 452.0 s
Claude Code, skill + script725.2k45 of 457.0 s0 of 45
  new chat per question714.9k45 of 458.2 s0 of 45
Claude Code, agent.py tools997.8k45 of 4512.3 s13 of 45
  new chat per question1.32M39 of 4513.0 s23 of 45
Claude Code, agent.py listed up front1.08M45 of 4510.4 s44 of 45
  new chat per question1.02M45 of 4510.3 s43 of 45
Claude Code, skill (instructions only)1.17M44 of 458.1 s0 of 45
  new chat per question879.9k43 of 4511.4 s0 of 45
Copilot CLI, agent.py tools (5 questions)244.8k15 of 153.9 s
  new chat per question261.6k15 of 154.0 s
Copilot CLI, skill + script354.8k15 of 155.1 s0 of 15
Copilot CLI, skill (instructions only)490.4k15 of 1510.2 s0 of 15
Copilot CLI as used, agent.py tools1.12M15 of 1552.2 s

* Seconds per answer in this table come from runs where up to 18 sessions shared the machine; the clean timing comparison is below. Copilot sessions asked 5 questions, the others 15.

Where agent.py won and where it did not

In Copilot CLI, agent.py tools were the cheapest setup: 244.8k tokens for 5 questions, against 354.8k for skill plus script and 490.4k for instructions only, with every answer right. In the runs where we recorded its tool calls, Copilot called the agent.py tool on 5 of 5 questions.

In Claude Code, a skill with a bundled script was cheaper than agent.py tools. By default Claude Code hides MCP tools until the model searches for them, and it called the agent.py tool on only 13 of 45 questions; on the rest it read the files and worked the answer out itself. Listing the tools up front made it use them on 44 of 45, but every call then carried 31,177 tokens of overhead instead of 15,176.

The same agent.py files inside a Brainstem answered all 15 questions for 135.5k tokens, 45 of 45 right. The format of the file is not what saves tokens. The host that runs it is.

Lock it in, then clear the chat

Once the rules live in code, the conversation history carries little value. Starting a new chat for every question cut the Brainstem's total from 135.5k to 90.4k tokens with every answer still right. In Claude Code and Copilot the saving was small, because their fixed overhead per call dwarfs the history of a 15-question chat. With instructions-only skills, clearing the chat did not fix accuracy (43 of 45 right in Claude Code, 14 of 15 in Copilot), and with Claude Code's default tool search it fell to 39 of 45: in a new chat, Claude Code answered 6 questions from the raw files without calling the agent.py tool, and all of them were wrong.

Call /chat. Use MCP only when you must.

A Brainstem can also be reached from Copilot CLI through the brainstem-mcp plugin. We asked the same questions both ways against the same Brainstem.

Brainstem, /chat: 18,736 tokensBrainstem, /chat18.7kCopilot CLI + plugin, when it routed: 133,271 tokensCopilot CLI + plugin, when it routed133.3k
Input tokens per answer from the same Brainstem: called directly, or through Copilot CLI and the plugin (counting only the questions Copilot actually sent to the Brainstem).
Path to the same agentsCopilot called the BrainstemRight
Copilot CLI (fresh install) + brainstem-mcp 0.2.00 of 153 of 15
Copilot CLI (fresh install) + brainstem-mcp 0.2.18 of 1511 of 15
Same, against the author's own Brainstem11 of 1514 of 15
Copilot CLI as the author uses it + 0.2.10 of 102 of 10
The Brainstem's /chat, called directlyevery question14 of 15 (1 upstream error, no answer)

Every routed answer still paid Copilot's own overhead several times over, and Copilot often did not route at all. The plugin as shipped (0.2.0) described itself only as "a local AI Brainstem", and Copilot never called it. Version 0.2.1, released during this study, names the Brainstem's agents in its tool description; Copilot then routed 8 of 15 questions on a fresh install. On the author's own install, with many other tools loaded, it routed none. Anything that can make an HTTP request should call POST /chat. The plugin is for hosts that can only speak MCP.

Time per answer

Brainstem, /chat: 4 secondsBrainstem, /chat4.0 sCopilot CLI, agent.py: 4 secondsCopilot CLI, agent.py3.7 sClaude Code, skill + script: 5 secondsClaude Code, skill + script4.7 sClaude Code, agent.py listed: 4 secondsClaude Code, agent.py listed3.5 sCopilot CLI as used, agent.py: 56 secondsCopilot CLI as used, agent.py55.9 s
Median seconds per answer over 5 questions, with one session on the machine at a time. Striped: Copilot CLI exactly as the author uses it, with the same agent.py tools.

On fresh installs, with the rules locked into code, the three hosts answered at about the same speed: 3.5 seconds for Claude Code with agent.py tools, 3.7 for Copilot CLI and 4.0 for the Brainstem. On a fresh install the Brainstem's advantage is tokens, not seconds: 34.7k for those five questions, against 245.3k for Copilot CLI and 322.9k for Claude Code.

Speed is where setup weight shows. The same Copilot CLI as the author uses it every day, with the same agent.py tools and nothing else on the machine, took 56 seconds per answer and 820.3k tokens for the five questions. Claude Code also slowed down whenever it worked an answer out itself instead of running the code.

The cost of ownership

Token prices are the sticker price. The rest of the cost is keeping a setup working. Everything that broke or surprised us while running this study is listed here, including our own mistakes, so the hosts are not blamed for them.

HostWhat broke or surprised usError shown?Whose fault
Claude CodeGiven an MCP server in another host's config format, it connected nothingNoOurs (wrong format), host silent
Claude CodeHides MCP tools until the model searches for them; it called the agent.py tool on 13 of 45 questionsNoHost default
Claude CodeListing MCP tools up front doubles the tokens of every call (15k to 31k)NoHost design
Claude CodeReplaces $0, $1, ... inside a SKILL.md with the skill's arguments, so dollar amounts in rules turned into file pathsNoHost design, undocumented for this case
Copilot CLIThe usage file is a running total for the session, not per questionNoOurs (assumed per question), undocumented
Copilot CLIYour own MCP servers and plugins load into every session; each server must be turned off by nameNoHost design
Copilot CLISkipped the Brainstem plugin's single 'chat' tool on 15 of 15 questions (plugin 0.2.0)NoPlugin (fixed in 0.2.1)
Copilot CLIOn a long-used install it skipped the plugin on 10 of 10 questions and took about a minute per answerNoHost with the owner's setup
Copilot CLIFrom an empty home folder the plugin could not find its environment and offered only a setup toolNoOurs (test setup), plugin
Copilot CLIThe plugin connection failed once with 'rejects the protocol version'; 10 direct handshakes all workedIn the answerUnknown
Brainstem/chat does not report token usage; measuring it needed a 15-line countern/aKernel (measurement only)
BrainstemOne upstream connection reset came back as HTTP 500 (1 of 30 questions); it does not retryYesModel provider; no retry
Our benchThe grader matched numbers inside other numbersn/aOurs
Our benchFour task rules were ambiguous in plain words, including whether to round each late feen/aOurs
Our benchA renamed lane skipped its MCP confign/aOurs

Driving one question through each host from a script took 13 lines of code for the Brainstem (one HTTP request), 29 lines and 8 command-line flags for Claude Code, and 54 lines and 9 flags for Copilot CLI. The Claude Code session that ran this study is itself a long chat: by the end of the measurements it had made 261 model calls and sent 81.74M tokens of context, about 313.2k per call.

Why the Brainstem stays small

Best practices

  1. Measure your host's idle cost. Ask it one trivial question and read the input tokens. That number is charged on every model call you make.
  2. Put repeated work in code. If you ask for the same calculation twice, turn it into an agent.py (or a skill with a script). Instructions make the model redo the work and sometimes get it wrong.
  3. Keep chats short. Finish a job, keep the answer, and start a new chat. Spend grows with the square of the chat's length.
  4. Unload what you do not use. Every plugin, MCP server and skill rides along on every call, whether the question needs it or not.
  5. Call a Brainstem's /chat directly. Use the MCP plugin only for a host that cannot make an HTTP request.
  6. Give each agent its own named tool. A single generic "chat" tool hides what the agents do, and hosts skip it.
  7. In Claude Code, prefer a skill with a bundled script for repeated work. Its MCP tools are found by search, and turning search off doubles the overhead of every call.

What this does not show

Corrections made along the way

A reviewer and our own checks caught errors in the first runs. All are fixed, and the runs they spoiled are kept in the repository, marked invalid:

Run it yourself

The bench, the tasks and every run behind this paper are at github.com/kody-w/token-bench. It measures your own setup, as you use it, in one command.