What Claude Code really costs: tokens per session across thousands of runs

Tokens and list-price cost per finished Claude Code session, from thousands of my own sessions: what fills the context window, why most of the bill is re-reading, and the changes that took one tier from $32.86 to $1.75 a session.

Every Claude Code session I run is recorded when it closes: how many requests it made, how many tokens it wrote, how many it re-read, and what that would cost at list price. The whole setup is in How I run thousands of Claude Code sessions. This note goes deeper on the tokens: where they go in a session, why most of the cost is the model reading its own conversation again, and what I changed to cut it.

The prices below are API list prices per finished session. They are for comparing sessions, not a bill.

The numbers

These are the sessions opened between 28 October and 9 November 2026, after I capped effort, counting only sessions that finished their task. All figures are medians per session.

Sessions Cost Requests Tokens written Tokens re-read
Opus 1,648 $6.53 78 55,000 7.0 million
Sonnet 2,892 $1.03 34 15,000 1.5 million

A typical Sonnet session writes about 15,000 tokens and reads one and a half million. That ratio is the whole story of this note. When someone asks how many tokens Claude Code uses per day, the honest answer is that almost all of them are the same conversation being read again.

Why a session re-reads everything

Claude Code sends the whole conversation with every request: the system prompt, the tool definitions, your files, every tool result and every thought so far. Step 60 carries the 59 steps before it.

Prompt caching makes this affordable. A cached token costs a tenth of a fresh one: $0.50 per million on Opus instead of $5, $0.30 on Sonnet instead of $3. But you pay it on every step, so the cost of a session grows much faster than its length. Twice as many steps means roughly four times as much re-reading.

At the median, re-reading is 45% of a Sonnet session's list price and 59% of an Opus session's. In my first weeks it was 74%, and in the crew note I described one bill where it was 76%.

The tier that cost $32.86

In the first weeks I ran some sessions on Sonnet at maximum effort, on the theory that more thinking would mean fewer mistakes. Here is what that tier looked like before and after I changed it:

Sonnet, high-effort tier Sessions Cost Requests Tokens written Tokens re-read
Opened before 18 October 220 $32.86 216 277,000 82 million
28 October to 9 November 1,116 $1.75 53 21,000 3.1 million

The model is the same in both rows. The sessions in the first row thought more, wrote more and ran four times as many steps, and each of those steps re-read a longer conversation. A check of the work found no measurable gain in quality for the extra cost.

The drop came in two steps. From 18 October a session could only use this tier if its brief gave a written reason, and the median fell to $5.30. From 28 October its effort was capped one step lower, and it fell to $1.75.

In the crew note I gave $2.27 for this tier. That figure covered a longer window. With the records up to 9 November the median is $1.75.

What fills the context window

The cost follows the context window, so I measured what fills it.

Before the brief. In late October, a fresh session had used 71,000 to 76,000 of its 200,000 tokens before it read its task. Most of that was things it never used: tool definitions, a list of skills, a list of agent types and a long memory file. That left about 124,000 tokens of working room.

After start-up. In eight sessions I took apart, the model's own output, most of it thinking, was about 46% of everything that came after start-up. Tool output, mostly files and command results, was about a third.

Effort. Across 1,243 sessions over four days, Sonnet at maximum effort thought about 1,000 tokens per request. One step down, at high, it thought about 90. At maximum its context grew 1.7 times faster per request, so it hit 200,000 tokens after about 69 requests instead of about 120.

Reading. In fifteen long sessions, reading files took 27% of the first 150,000 tokens on average, and searching took another 11%. A session that took over from another one spent 50 to 87% of its file reading on files the previous one had already read.

What I changed

Each change targets one of those parts.

Effort set to high, not maximum. Every working session now runs one step below maximum, and a brief has to ask for more by name. Only planning sessions keep maximum.

A smaller start. Working sessions start with the skills list and the slash commands turned off, which saved about 8,500 tokens in a test, and without plugins they don't use. A trimmed session started at 28,000 to 32,000 tokens instead of 71,000 to 76,000. Now a fresh session costs about 20,000 tokens on its first turn.

One task per session, and a handoff at 150,000. A session that grows long pays for its length on every step. So each session does one job, and at around 150,000 tokens it finishes the step it is on, writes a handoff file and closes. The next one starts small. How the handoff works is in Running many coding agents at once.

Facts in the brief, not pointers. Because successors re-read so much, a brief now carries the facts a session needs, with the file and line, instead of a page to go and read.

Read ranges, not files. Sessions find the lines with grep -n and read only that range. A turn that reads several whole files at once costs 14,000 to 24,000 tokens. Screenshots are shrunk to 800 px wide, because a 1440 px one costs about 8,000.

Pick the model by the task. Opus costs about six times more than Sonnet per session at the median. My rule is one question: is there judgement in this task? If yes, Opus. If no, Sonnet.

Check your own sessions

Claude Code keeps every session as a file under ~/.claude/projects/. Each reply from the model carries a usage block with four counts: fresh input, tokens written to the cache, tokens read from the cache, and output. This script adds them up per session and prints the medians:

import glob, json, os, statistics

PRICE = {"opus": (5, 10, 0.5, 25), "sonnet": (3, 6, 0.3, 15), "haiku": (1, 2, 0.1, 5)}
KEYS = ("input_tokens", "cache_creation_input_tokens", "cache_read_input_tokens", "output_tokens")

sessions = []
for path in glob.glob(os.path.expanduser("~/.claude/projects/*/*.jsonl")):
    s, seen = {"steps": 0, "out": 0, "read": 0, "usd": 0.0, "read_usd": 0.0}, set()
    for line in open(path, errors="ignore"):
        try:
            m = json.loads(line).get("message") or {}
        except (ValueError, AttributeError):
            continue
        u, model = m.get("usage"), m.get("model") or ""
        price = next((p for f, p in PRICE.items() if f in model), None)
        if not u or not price or m.get("id") in seen:
            continue
        seen.add(m.get("id"))
        n = [u.get(k, 0) for k in KEYS]
        s["steps"] += 1
        s["out"] += n[3]
        s["read"] += n[2]
        s["usd"] += sum(t * p for t, p in zip(n, price)) / 1e6
        s["read_usd"] += n[2] * price[2] / 1e6
    if s["steps"]:
        sessions.append(s)

print("sessions", len(sessions))
for k in ("steps", "out", "read", "usd"):
    print("median", k, round(statistics.median(s[k] for s in sessions), 2))
print("median re-read share", f"{statistics.median(s['read_usd'] / s['usd'] for s in sessions if s['usd']):.0%}")

The prices are dollars per million tokens: fresh input, cache write, cache read, output. My sessions write to the one-hour cache, which costs twice the input price; if your usage blocks show the five-minute cache instead, make the second number 1.25 times the first. One reply can appear on several lines of the file, so the script counts each reply once. On my 300 newest sessions it printed a median of 50 requests, 2.8 million tokens re-read, $2.61, and 51% of that re-reading.

If your re-read share is high, your sessions are too long. That is the first thing to fix, before any setting.

More posts

All posts →
  1. 21 Nov 2026

    Same agent, rebuilt workspace, a quarter of the bill: what EnvOpt showsA new arXiv paper leaves the model and the harness alone and lets another AI rebuild the workspace the agent works in. On 200 test tasks, the same Claude Haiku 4.5 agent cost $42.36 before and $11.55 after, and passed more tasks.

    AI · 7 min
  2. 21 Nov 2026

    CLAUDE.md vs AGENTS.md: which one Claude Code reads, and why I keep only oneWhen a repository has both files, Claude Code reads CLAUDE.md and leaves AGENTS.md alone unless you import it. I found five of my repositories set up the wrong way round: the real instructions in AGENTS.md, and a CLAUDE.md that only pointed at it.

    How I build · 5 min
  3. 20 Nov 2026

    Running several Claude Code agents at once: worktrees, handoffs and one check per phaseWhat broke when I put many Claude Code agents on the same repositories, and the four rules that stayed: one worktree per agent, small file-disjoint jobs, a rewritten handoff, and one full check per phase.

    How I build · 5 min