The Real Cost of an Empty Prompt: Baseline Token Measurements Across Four Coding Agent CLIs

A coding agent CLI's empty prompt actually carries a large prefix, and cross-tool billing rules differ—you must measure baseline cost on your own machine.
The article shows that coding agent CLIs send a prefix before the user prompt, including system prompts, built-in tools, MCP tool definitions, and instruction files. Even empty sessions pay repeatedly, and CI and headless runs count too. Comparing Claude Code, Codex, Copilot CLI, and OpenCode, cache billing rules differ: Anthropic's input_tokens excludes cache, requiring addition of cache_creation and cache_read; OpenAI's already includes cache, so aligning raw numbers misleads. Instruction files cross-load—Copilot CLI merges multiple ecosystem files, and OpenCode reads ~/.claude/CLAUDE.md when its own is missing. MCP loading strategies also vary: Claude Code defers by default, while OpenCode's docs warn of significant context addition. The author provides an empty-repo measurement method and suggests multiplying prefix tokens by session frequency and rates to quantify cost.
The Real Cost of an Empty Prompt: Baseline Token Measurements Across Four Coding Agent CLIs
When you send a coding agent the single word "ping," what it actually reads in is far more than that one word. OpenAI's official documentation shows an example line for codex exec --json: 24,763 input tokens, of which 24,448 are cached, while the output is only 122 tokens. The docs don't say what prompt produced these numbers, but regardless of the original prompt, for every token the model writes, it reads two hundred tokens behind the scenes.
This isn't an isolated case. Claude Code, Codex, GitHub Copilot CLI, OpenCode — every coding agent CLI sends a prefix before your task even begins: the system prompt, built-in tool definitions, tools from configured MCP servers, and every instruction file it finds along the way. New sessions re-send this prefix, and every headless run in CI is no exception.
The original author explicitly states: don't copy anyone's numbers, including the samples quoted above. The prefix varies with CLI version, model, global configuration, and startup directory. The only reliable approach is to measure it yourself on your own machine.

Who's Already on Board Before Your Prompt Departs
The prefix has two parts: the vendor's system prompt and built-in tools; and your own MCP servers and instruction files.
The vendor portion changes with CLI version updates — you can't control it, but you can observe it. Your own portion is where the real cost lies, and it's the most easily overlooked.
MCP Server Loading Strategies Differ Dramatically
Each CLI has a completely different loading strategy for MCP tool definitions, and this is the main source of baseline variation:
- Claude Code defers loading MCP tool definitions by default, loading only "tool names and server instructions" at session startup (per Claude Code MCP docs).
- OpenCode documentation explicitly warns of the opposite: MCP servers "add to context," and some servers (like GitHub MCP) "tend to add a lot of tokens" (per OpenCode MCP docs).
- Copilot CLI has the GitHub MCP server built in (per GitHub docs).
- Codex's MCP documentation doesn't say whether it defers loading — which in itself is reason to measure.
The same MCP configuration can cost an order of magnitude more under different CLIs.
MCP and Tool Definition Bloat: Model Context Protocol (MCP) was open-sourced by Anthropic in 2024 to let models access external tools and data sources through a unified protocol. The cost is that every MCP server describes its tool inventory (names, descriptions, JSON Schema parameters) to the model, and these descriptions are sent as part of the system prompt on every request. A fully-featured server may register a dozen tools, each with definitions running into hundreds of tokens, easily exceeding thousands of tokens when stacked. "Deferred Loading" (Tool Search) is the optimization born to mitigate this: at startup, only server names and metadata load; when the model actually needs a tool, its full definition is dynamically injected. Different vendors have drastically different default strategies for this optimization — which is precisely the technical reason the same MCP configuration costs an order of magnitude more under different CLIs, and the fundamental reason you must measure rather than rely on documentation.
The Instruction File Cross-Loading Trap
Instruction files are the key to why an "empty prompt" is no longer empty. The original article compiles a comparison table that is easily overlooked:
| CLI | Instruction files loaded at startup |
|---|---|
| Claude Code | CLAUDE.md, falling back to AGENTS.md when no project-level CLAUDE.md exists (v2.1.277+), plus auto memory |
| Codex | ~/.codex/AGENTS.md, then AGENTS.md from the git root downward to the current folder, capped at 32 KiB |
| Copilot CLI | AGENTS.md, .github/copilot-instructions.md, ~/.copilot/copilot-instructions.md, CLAUDE.md, and GEMINI.md, all merged |
| OpenCode | AGENTS.md (falling back to CLAUDE.md), plus ~/.config/opencode/AGENTS.md, and when missing, falls back to ~/.claude/CLAUDE.md |
The last two rows deserve re-reading: when there's no global OpenCode file, your ~/.claude/CLAUDE.md follows you into OpenCode; a repository's CLAUDE.md likewise lands in Copilot CLI's prefix. The one-time rules you wrote for Claude may get paid for once in each of four CLIs.
AGENTS.md and the Evolution of Vendor-Specific Files: AGENTS.md is a cross-tool instruction file convention driven by the community in 2024, aiming to give all coding agents a unified "project description" entry point and avoid writing a separate one for each CLI. Claude initially used CLAUDE.md and later gradually became compatible with AGENTS.md (e.g., the v2.1.277+ fallback logic); OpenCode is the opposite, primarily using AGENTS.md and falling back to CLAUDE.md. This "bidirectional compatibility" is precisely the root of cross-contamination: to remain compatible with old users, tools read convention files from other ecosystems, causing rules meant for a single tool to be loaded by multiple parties. Similar cases include GEMINI.md (Google ecosystem) and .github/copilot-instructions.md (GitHub ecosystem). In practice, putting tool-specific rules into skills or on-demand modules rather than stuffing everything into these "everyone reads them" files is the most effective way to control prefix bloat.
The Measurement Method: Running "ping" in an Empty Repository
The original article's approach is straightforward: first create an empty git repository to avoid project files mixing in, but global files still load — which is exactly the baseline you're truly paying right now.
mkdir -p ~/tmp/baseline && cd ~/tmp/baseline
git init -q
Note that Claude Code and OpenCode also search parent directories, so you need to confirm there's no CLAUDE.md or AGENTS.md under ~ and ~/tmp. Codex stops searching at the git root.
Reading Commands for Each CLI
Claude Code uses --output-format json to return usage, total_cost_usd, and a modelUsage breakdown by model:
claude -p "ping" --output-format json > claude-1.json
jq '.usage, .total_cost_usd' claude-1.json
jq '[.usage.input_tokens,
.usage.cache_creation_input_tokens,
.usage.cache_read_input_tokens] | add' claude-1.json
The second command is key. In Anthropic's usage object, input_tokens only counts the portion after the last cache breakpoint — the complete input is the sum of three fields. Looking only at input_tokens, the baseline appears tiny. Also check .num_turns: if the agent invoked a tool to answer "ping," usage covers multiple model requests and the prefix gets counted repeatedly.
Codex uses codex exec --json to stream JSONL output, and the turn.completed event carries token data:
codex exec --json "ping" > codex-1.jsonl
jq -c 'select(.type=="turn.completed") | .usage' codex-1.jsonl
Here the cache count is already included in the input count, so input_tokens is the prefix plus the one-word prompt — provided that turn has only one model call.
Copilot CLI's programmatic reference docs don't document a usage field, and its -s flag suppresses statistics. After launching copilot, type /context to see a layer-by-layer breakdown of System Prompt, Custom Instructions, System Tools, MCP Tools, and Messages.
OpenCode uses opencode run --format json to output raw JSON events, recording input, output, reasoning, and cache.read/cache.write for each step. According to a session record on the OpenCode tracker, one step showed input 209, cache read 18,944 — you must add the cache field to input. If the command produces no output, fall back to opencode stats --days 1 to read from stored sessions.
Token Cache Billing Mechanics: Major LLM providers (Anthropic, OpenAI) support Prompt Caching. The core logic is to cache the unchanging prefix portion, and subsequent requests that hit the cache are billed at a discount. Anthropic's cache has two tiers: cache_creation_input_tokens is the token written to cache for the first time, billed at 1.25× the standard input rate; cache_read_input_tokens is the token that hits the cache, billed at only about 0.1× the standard input price. The cache's validity period is typically 5 minutes (extendable to 1 hour), so the "run twice" strategy works precisely because the second run falls within the cache window, significantly lowering the average cost. OpenAI's automatic caching is triggered implicitly, without separately listing write fees — input_tokens already implies the cache discount. Understanding this mechanism is a prerequisite for correctly attributing baseline costs: similarly, cross-vendor comparisons must first normalize the cache fields into a unified "complete input" measure, or you'll reach wrong conclusions.
Key Tip: Run Twice
Run each command twice within a few minutes. The first run tends to write the prefix to cache, the second reads it back. On Claude models, cache reads can be billed as low as 0.1× the input rate, so a cold-start first session costs far more than a warm repeat.
Summary of the values to record for each CLI:
| CLI | Full input for that turn | Where to read it |
|---|---|---|
| Claude Code | input_tokens + cache_creation_input_tokens + cache_read_input_tokens | .usage in the --output-format json result |
| Codex | input_tokens (cache already included) | turn.completed event |
| Copilot CLI | Sum of all layers | /context in an interactive session |
| OpenCode | input + cache.read + cache.write | step_finish event or opencode stats |
Round Two: Add an MCP Server and an AGENTS.md
With a baseline in hand, add the two things most repositories will grow.
For the MCP server, you can use the official "everything" reference server, or one you actually use. For the memory file, write a short AGENTS.md:
cat > AGENTS.md <<'EOF'
# Project rules
- Run `npm test` before you say a task is done.
- Never edit files under migrations/ without asking.
EOF
Then register that MCP server in each CLI and re-run. Claude Code is worth a controlled experiment: run with default config and with ENABLE_TOOL_SEARCH=false respectively — the gap between the two is the price of that one server's tool definitions in every new session. Claude Code avoids this cost through default deferred loading, while tools like OpenCode bear it directly per the documentation warning.
Converting the Delta into Money
The delta between round one and round two is the additional per-session startup cost of one MCP server plus one memory file. The conversion: prefix tokens × daily new sessions × the model's input or cache-write rate, plus cache reads each time the prefix is re-sent on subsequent turns. Headless runs count, and parallel agents count too.
Bill shape depends on your plan. Under a Claude Pro or Max subscription, the dollar figures in /usage are "unrelated to billing," but tokens still consume your plan limit. On the Copilot side, the plan has shifted to GitHub AI Credits, "calculated based on token consumption, including input, output, and cached tokens." In API key mode, every token is billed.
If the delta is unexpectedly large, the fixes are quite plain: move workflow-specific instructions out of CLAUDE.md into on-demand skills and keep CLAUDE.md under 200 lines; turn off MCP servers you don't use; check global files, because they follow you into every repository.
Conclusions from Multi-Source Cross-Validation
Combining the four official docs and the author's measurement approach, several cross-source consistent facts can be established:
- The prefix is a real, measurable cost — all four CLIs provide some form of token usage reading, indicating vendors themselves see it as something worth observing.
- Cache billing rules differ by vendor — Anthropic's
input_tokensexcludes the cache portion, OpenAI'sinput_tokensincludes it, so directly comparing raw numbers is misleading. - Cross-contamination of global files is a real risk — Claude Code, Copilot CLI, and OpenCode all read each other's instruction files, and this is cross-verifiable in their respective official docs.
The point of divergence is MCP tool loading strategy: Claude Code defers by default, OpenCode's docs warn of direct additions, Codex doesn't specify. This means cross-CLI baseline comparisons must rely on measurement, not documentation inference.
The original author is also the developer of Hermes IDE and provides a conflict-of-interest disclosure in the article. He mentions that Hermes 2.3.4 offers a context meter that directly displays the baseline when sending "ping" as the first session message, and shows per-session context usage, total tokens, and estimated cost in the sidebar. This part is a single-source product claim, and readers should judge it in light of that disclosure.
The core methodology is worth keeping independent of any tool: don't trust anyone's baseline numbers, use a one-word prompt in an empty repository, run twice on your own machine, sum the three cache fields correctly, then multiply by your actual session frequency.
Related articles

Kimi K3.1 Pro Open-Sourced: 2.8 Trillion Parameters Close In on Opus
Moonshot releases the open-source MoE model Kimi K3.1 Pro, with 2.8T total parameters and 104B activated, trailing Opus 5.5 by under 1 point on Terminal Bench 4.0.

Costco Tech Price Guessing: Are Monitors, Keyboards, Mice, and Bose Speakers Worth It?
A YouTube blogger guesses prices of Costco tech products: 2K 180Hz monitor, Logitech keyboard and mouse, Bose speaker, and CyberPower UPS, revealing warehouse-store selection and brand premium.

AT&T Partners with OpenAI to Build AI Legal Workflow: An Intelligent Transformation of 150 Years of Experience
AT&T and OpenAI launch Legal Edge to rebuild legal services with AI: a shared knowledge layer, natural language intake, and decision-making kept with lawyers.