By JaySeptember 2026

Where Your Context Window Actually Goes

View as Markdown

Most agent CLIs give you exactly one signal that context is getting tight: things suddenly start getting worse. No breakdown, no receipt, just a vague sense the agent's forgetting things it knew ten minutes ago. A /context command we run locally does the opposite: on demand, it renders exactly what's sitting in the context window right now, broken down by source.

Cold start: the only fair comparison

We use these four tools differently, load different skills into each, and none of that overlaps enough to compare. What does compare cleanly is the number before any of that: a fresh session, no personal config, the same one-word reply. That number is the harness's own cold start cost - the base context window allocation its default tool definitions and system prompt claim before you've done anything at all:

HarnessTokens usedContext window% of windowModel
Claude Code2,1001,000,0000.21%claude-sonnet-5
Codex2,030272,0000.75%gpt-5.6-luna
Pi Agent2,029262,1440.77%Qwen3.6-35B-A3B-UD-Q4_K_XL
OpenCode7,487262,1442.86%Qwen3.6-35B-A3B-UD-Q4_K_XL

Fresh session, "reply with just the word hello," zero personal config.

Anyone can run this themselves and get the same shape of answer - that's what makes it worth publishing. A "with my real setup" number, by contrast, is true for exactly one person's machine on one day. We measured our own anyway, as a data point worth having even though nobody else's setup would reproduce it:

We're not running that as a fair "us versus them" for Pi Agent though - it's the one we load up the most, and putting our own most-customized setup next to someone else's bare install would be a stacked deck.

The pair worth staring at is Pi Agent and OpenCode: 2,029 tokens against 7,487, hitting the exact same model on the exact same server. Nothing about the model changed between those two numbers. That gap is pure harness scaffolding - the tool definitions and system prompt each one ships with by default, before you've installed or configured a single thing.

Pi's own README says why directly:

Pi is a minimal terminal coding harness... Pi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask pi to build what you want or install a third party pi package that matches your workflow.

That's a stated design choice, not an accident, and the cold-start number is exactly where it shows up: a smaller default surface, with everything else opt-in.

Hooks and commands: the correct way to extend Pi Agents

Most harnesses teach an agent a new technique by loading a file. Claude Code's own skills documentation describes a more careful version of that pattern than the stereotype: only a skill's name and description sit in context by default, and the full SKILL.md body loads only once you actually invoke it. Even that smaller piece is a real, standing cost that sits in context on every single turn whether that turn needs it or not - Claude Code's own real setup pays it directly, 1.9k tokens for skill descriptions alone, before a single one of them has done anything. That's not a flaw, it's just what registering a skill costs, even done as carefully as Claude Code does it.

Pi Agent gets the same result a different way. An extension can register a slash command or a lifecycle hook instead of a loaded file, and neither one is ever shown to the model as something to read. A command only runs when you type it. A hook only reacts to an event that's already happened. Either way, nothing about it sits in context waiting to be relevant, which means you can teach the agent a real, permanent habit without ever touching its standing token cost.

That's not a theory, it's measurable. We loaded a real setup's extensions one at a time against a real backend, bare otherwise, and measured the real reported token count each time - not a guess:

Bare harness: 2,029 tokens - full real setup: 6,630 tokens
pi-web-access (real cost)3,277 tokens
AGENTS.md + MEMORY.md418 tokens
3 other extensions, measured individually0 tokens

pi-loop-police, pi-context-filter, and pi-startup-header - three extensions we use daily - add up to 8,568 bytes on disk, a byte-count estimate of roughly 2,142 tokens. Real measured cost, each loaded alone and checked against the ground-truth token count: zero. Every one of them registers a slash command or a lifecycle hook, not a tool - intercepted by the harness before it ever reaches the model, or reacting to events after the fact. Each one teaches Pi Agent a real habit - filtering noise out of context, catching a runaway loop, formatting a startup header - permanently, without a single token of standing cost.

pi-web-access is the one extension in our setup that costs anything, and it costs exactly because it does something different: it registers an actual tool, a capability the model can choose to call. That's the only thing Pi Agent charges for, and it charges by the size of the tool's declared name, description, and parameters, not by the size of the file behind it - 149,033 bytes of implementation, 3,277 tokens of schema. The same rule that makes hooks free is the rule that keeps a real tool's cost small and fixed.

File size measures code. Only two things measure context cost: does it register a tool (its schema is shown to the model, whether or not it's ever called), and does it get loaded as text (a memory file, an instruction file, an AGENTS.md). Everything else - hooks, commands, however much implementation code backs them - is free.

That's the correct way to build on top of Pi Agent: teach it techniques through commands and hooks, which cost nothing standing, and reserve real tool registration for capabilities the model genuinely needs to invoke, which cost a small, fixed amount regardless of how much code sits behind them. A SKILLS.md file that grows every time someone has a good idea is the pattern to avoid, not because the idea is bad, but because loaded text is the one mechanism here that bills you on every turn whether or not it's needed.

The part worth noticing: CLAUDE.md at 0%

The real version of this breakdown carries one more line most people wouldn't think to check: a project's CLAUDE.md, explicitly excluded via a context filter rule, sitting at 0.0% on purpose. Not missing by accident, filtered out by a rule that's visible in the same breakdown that shows everything else. A tool that only shows you what's included can't show you that distinction. One that shows the whole accounting can. Claude Code's own docs walk through the same idea from their side, an interactive breakdown of exactly what loads and when. We've tested that mechanism directly before, in a deep dive on what actually survives a Claude Code compaction versus what the docs promise.

Why bother with a receipt

It's the same principle behind every token-shaped decision on this blog, just pointed at the tool doing the building instead of the site being built: don't trust a claim about efficiency, look at the actual numbers. AGENTS.md and MEMORY.md are static costs paid on every single turn, whether or not that turn needs them - and a static overhead line is exactly the kind of number that creeps upward quietly, one reasonable-looking addition at a time, until a command like this is the only thing that catches it.

We hold the agents we build for clients to the same standard: not a promise that it's efficient, a number that shows it.

Get in touch