How many tokens do CLAUDE.md, AGENTS.md and MCP tools add to every request?
Run npx github:henrikdukefoss/contexttax in a repo. It measures the instruction files, skill descriptions and MCP tool schemas that Claude Code, Codex, Cursor and five other coding agents load into every request, lists the largest first and prices them per 1,000 requests.
$ npx github:henrikdukefoss/contexttaxSource on GitHub ↗Node 18 or newer, no dependencies. Nothing uploaded.
Made by Standard Compute. Plans from $19/mo →
$ npx github:henrikdukefoss/contexttax --probe-mcp
CONTEXT TAX sample-app contexttax 0.1.0
Cursor adds an estimated 3,313 tokens of instructions, tool schemas and
descriptions to every request in this repo, before your prompt. That is 3.3%
of a typical coding-agent request.
AGENT TOKENS SHARE OF A TYPICAL REQUEST
Cursor 3,313 3.3%
OpenCode 3,298 3.3%
Claude Code 2,148 2.2% + 1 MCP server not measured
GitHub Copilot 429 0.4%
Codex CLI 384 0.4%
Gemini CLI 67 0.1%
Aider 19 <0.1%
Cline 18 <0.1%
LARGEST FIRST TOKENS LOADED BY
MCP tracker (18 tools) 2,867 OpenCode, Cursor
.mcp.json, .cursor/mcp.json, opencode.json, probed
Claude Code: 181 tokens per request, tool search loads the schemas on demand
docs/architecture.md 1,193 Claude Code
@-imported by CLAUDE.md
AGENTS.md 384 Claude Code, Codex CLI,
OpenCode, Cursor, Copilot
@-imported by CLAUDE.md
CLAUDE.md 163 Claude Code
.claude/skills (2 skills) 91 Claude Code
plus 1 that loads on demand only
.claude/rules (1 rule) 55 Claude Code
plus 1 that loads on demand only
.claude/agents (1 subagent) 54 Claude Code
docs/style-guide.md 47 OpenCode, Gemini CLI
instructions in opencode.json
@-imported by GEMINI.md
.github/copilot-instructions.md 45 Copilot
.cursor/rules (2 rules) 44 Cursor
plus 1 that loads on demand only
.claude/commands (1 command) 27 Claude Code
GEMINI.md 20 Gemini CLI
CONVENTIONS.md 19 Aider
only when passed with --read
.clinerules (1 rule) 18 Cline
.cursorrules 18 Cursor
MCP docs-search ? Claude Code
.mcp.json, remote (http), not probed
COST PER 1,000 REQUESTS (CURSOR, 3,313 TOKENS EACH)
MODEL CACHE READ UNCACHED
claude-opus-5-5 $0.66 $13.25
claude-sonnet-5-5 $0.33 $6.63
gpt-6-sol $0.66 $6.63
gpt-6-luna $0.03 $0.33
glm-5.3 $0.86 $4.64
List prices for input tokens. Cache read: the prefix is served from the
provider cache. Uncached: a cold start or a changed prefix.
WHAT TO DO
1. The tracker MCP server adds 2.9K tokens to every OpenCode and Cursor
request (18 tools). If this repo rarely needs it, remove it from
.cursor/mcp.json and opencode.json. Claude Code already loads it on demand
with tool search.
2. docs/architecture.md is @-imported by CLAUDE.md and adds 1.2K tokens to
every Claude Code request. Mention the path without the @ and the agent
opens it only when it needs it.
3. AGENTS.md and CLAUDE.md repeat about 67 tokens of the same lines, and
Claude Code loads both. Keep one copy.
Token counts are estimates: about 3.7 characters per token for text and 3.0
for JSON schemas. The agent's own system prompt and built-in tools come on
top.
Typical request: 99,554 input tokens, the median coding-agent request.
Source: Standard Compute, The Agent Burn Index, October 2026,
standardcompute.com/agent-burn-index
Prices: LiteLLM (bundled), 2026-10-13. Read on this machine; nothing was
uploaded.
contexttax, made by Standard Compute (standardcompute.com)
What does it read for each agent?
Only what an agent loads into every request. A file several agents load, such as AGENTS.md, is one row with all of them listed.
| Agent | Counted as loaded with every request |
|---|---|
| Claude Code | CLAUDE.md, .claude/CLAUDE.md and CLAUDE.local.md in this folder and every folder above (or, when there are none, AGENTS.md and .claude/AGENTS.md), ~/.claude/CLAUDE.md, @path imports up to four hops, .claude/rules without paths:, the first 200 lines of auto memory MEMORY.md, skill, command and subagent descriptions, MCP servers from .mcp.json and ~/.claude.json |
| Codex CLI | AGENTS.md (or AGENTS.override.md) from the repo root down to this folder, ~/.codex/AGENTS.md, MCP servers from ~/.codex/config.toml and .codex/config.toml |
| OpenCode | AGENTS.md (or CLAUDE.md when there is none), the global AGENTS.md, files listed in instructions, MCP servers from opencode.json |
| Cursor | .cursorrules, AGENTS.md, .cursor/rules with alwaysApply: true, descriptions of rules without globs, MCP servers from .cursor/mcp.json and ~/.cursor/mcp.json |
| Gemini CLI | GEMINI.md from this folder up to the repo root, ~/.gemini/GEMINI.md, @path imports, MCP servers from .gemini/settings.json |
| Cline | .clinerules, a file or a folder of rules without paths: frontmatter |
| GitHub Copilot | .github/copilot-instructions.md and AGENTS.md from the repo root down to this folder |
| Aider | CONVENTIONS.md and files under read: in .aider.conf.yml, which Aider loads only when passed with --read or listed there |
Claude Code follows its memory, skills, subagents and MCP docs, GitHub Copilot GitHub's custom instructions reference. Subfolder CLAUDE.md files, path-scoped rules, Cursor rules with globs and full skill bodies load on demand and are not counted. Not supported yet: plugins, Claude.ai connectors, Cline's global rules, Windsurf, Amp, Goose and Continue.
How does Claude Code's MCP tool search change the count?
Claude Code sends only the tool names with each request and loads a full schema when a tool is needed. The other agents send every schema every time.
Tokens per request for the sample's tracker server, 18 tools. Tool search is on by default in Claude Code (Claude Code MCP docs); with ENABLE_TOOL_SEARCH=false in the environment or .claude/settings.json, contexttax counts the full schemas for Claude Code too.
Why a few thousand tokens matter
The median coding-agent request on our gateway carries 99,554 input tokens, and 87% of coding-agent input is cache reads. Context you add is paid on every one of those requests, mostly at the cache-read price, and at the full input price after a cold start or an edited prefix. Source: The Agent Burn Index, October 2026.
Put the number in your README
The badge shows tokens per request for the agent that loads the most, from the repo's own files and MCP config. Your user-level setup is left out.
$ npx github:henrikdukefoss/contexttax --probe-mcp --badgeSample badges for the same synthetic repo. Commit the SVG and run it again after you trim.
What leaves your machine?
- Your files
- Read in place. Nothing is copied or uploaded.
- Network
- One request for LiteLLM's public price list, cached for a day.
--offlinemakes none. - MCP servers
- Listed, never run, unless you pass
--probe-mcp. Then only the stdio servers in your own config, on your machine. Remote servers are never contacted. - The output
- The report shows file paths and MCP server names, so read it before you paste it.
--jsonleaves out MCP arguments and environment values. The badge holds one number.
How exact are the counts?
- Tokens
- Estimates, with no tokenizer bundled: about 3.7 characters per token for text, 3.0 for JSON and one per CJK character. Each model family tokenizes differently, so your exact count will differ.
- Not counted
- The agent's own system prompt and built-in tools, which come on top.
- Share of a request
- Divided by the median coding-agent request from the Agent Burn Index, quoted above.
- Cost
- Tokens times each model's LiteLLM list price for cache reads and for uncached input.
Options
| Option | What it does |
|---|---|
--probe-mcp | Start each configured stdio MCP server locally, ask it for its tools, stop it, and count the tool schemas |
--probe-timeout <s> | Seconds to wait for each server (default 20) |
--badge [file] | Write an SVG badge (default context-tax.svg in the repo root) and print the Markdown to paste |
--badge-theme <name> | calm (default) or navy |
--json | Print everything as JSON |
--agent <id> | One agent only: claude-code, codex, opencode, cursor, gemini-cli, cline, copilot, aider |
--models <ids> | Models for the cost table, comma separated |
--repo-only | Leave out your user-level config (~/.claude, ~/.codex, ...) |
--offline | Use the bundled price table and make no network request |
--no-color | Plain terminal output |
Questions
Does Claude Code read AGENTS.md?
Yes, from v2.1.277: when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in this folder or above it, Claude Code reads AGENTS.md instead. With a CLAUDE.md it reads AGENTS.md only through an @AGENTS.md import, as in the sample report above. contexttax counts both cases, follows @path imports up to four hops and lists each imported file as its own row. Codex CLI, OpenCode, Cursor and GitHub Copilot read AGENTS.md directly. Claude Code memory docs ↗
How do I make my CLAUDE.md add fewer tokens?
Mention long docs by path without the @, so the agent opens them only when it needs them. Keep one copy of lines that AGENTS.md and CLAUDE.md both carry. Remove MCP servers a repo rarely uses from agents that send full tool schemas. The report's What to do list names the changes for your repo.
Why does the count differ from what my agent shows?
contexttax estimates without a tokenizer, at about 3.7 characters per token for text and 3.0 for JSON schemas, and leaves out the agent's own system prompt and built-in tools. An agent counting with its model's tokenizer, with its system prompt included, shows a different and usually larger total.
Does --probe-mcp run my MCP servers?
Yes, the stdio servers in your config, with the command, arguments and environment your agent would use. contexttax sends initialize and tools/list, counts the schemas and stops each server. Remote http and sse servers are never contacted. Without --probe-mcp nothing is executed.
What number does the badge show?
Tokens per request for the agent that loads the most, counting only files in the repo. Your own ~/.claude and ~/.codex setup is left out, and without --probe-mcp the repo's MCP tool schemas are not included. In the calm theme the value is green below 5K, brass up to 20K and brick red above.
Who makes contexttax
Standard Compute, an API for coding agents on flat monthly plans with a compute budget you can see in the dashboard. The measuring in contexttax works the same whichever provider you use.