Justin Bartak · AI Org · · 5 min read
Context Is the New Codebase.
TL;DR
Prompt engineering optimized a sentence. Context engineering governs everything a model sees, and I measured what that actually costs: across 35 sessions, my agents read 285 times more context than they wrote, with the average turn re-reading 504,141 tokens. The written artifacts agents consume every turn are source code now. Version them, test them, and budget them like it.
Prompt engineering optimized a sentence. Context engineering governs everything a model sees, every turn, and it is where agent behavior actually comes from. I measured mine, and the number that reorganized my thinking is this: my agents read 285 times more context than they write. The prompt was never the product. The environment is, and the environment is a codebase.
Why did the prompt stop being the unit?
Because a prompt is one turn, and an agent system is thousands of turns inside a standing environment.
What a working agent actually sees on any turn: its constitution file, the conversation so far, the specs, the tool results, the tests it just ran. The prompt you typed is a rounding error inside that. I made the argument that the prompt is dead once the loop became the unit of engineering; this post is about what replaced it, measured.
You do not program an agent with a sentence. You program it with everything it is allowed to see.
What did I actually measure?
One month of my own operation on Orbyt, 35 working sessions, instrumented in July 2026. Three numbers.
285 to 1. My agents produced 59.9 million output tokens against 17.07 billion context reads. Everything people optimize, the elegant output, the clever generation, is the 1. The economy is the 285, and it is almost entirely re-reading.
504,141 tokens per turn. That is what the average turn re-read, because every turn carries the whole conversation forward. Cost is context size times turn count. Nothing else is close, which is why three long sessions over 6,000 turns produced 60% of the month's entire consumption.
47% was heavy artifacts. 76 image reads consumed roughly 9.4 million tokens of tool-result volume, about 123,660 tokens each, and each one was then re-read on every later turn of its session. One glance at a screenshot, priced like a novella, billed nightly.
Why is context a codebase and not a cache?
Because the written artifacts agents consume are the source code of their behavior, with everything that implies.
A constitution file is loaded before every piece of work, so one rule written today governs every agent tomorrow: that is code, deployed. A spec that says what "done" means is an interface. Tests are executable requirements an agent iterates against, the spec itself. And a context bug, a stale rule, a bloated file, a contradiction between documents, is a behavior bug that every agent inherits simultaneously, which makes it worse than most code bugs.
So the disciplines transfer directly. My constitution files carry distilled rules with the one-line why, never narratives. They are updated in the same session a lesson lands. They get extracted and split when they outgrow their budget, exactly like a module. The full setup around them treats every written artifact as versioned infrastructure, because that is what it is.
What are the four disciplines?
Curate what enters. The main loop carries judgment; everything heavy gets quarantined. Images, giant files, and exploratory sweeps go to subagents that return a paragraph, so the expensive artifact never enters the context that persists. This one rule addressed the largest measured waste in my system.
Batch what is independent. Four sequential tool calls at a 500,000-token context cost four full re-reads; the same four in one turn cost one. The single highest-frequency lever, and it is entirely behavioral.
Compress what remains. Every standing sentence is a recurring cost and a recurring instruction, so rules earn their place by load-bearing content. "Distilled rules, not session narratives" is written at the top of my constitution, about itself.
Version and test the artifacts. Context files get reviewed like code because they are code. My registry of tracked phrasings fails the build when a pattern goes dead, and the same standard applies to any standing instruction: if nothing would notice its drift, it is not governance, it is decoration.
What to do Next
Measure your ratio. One month of usage data, reads versus writes, per session. If you cannot get the number, that is finding number one: you are running an economy with no ledger.
Find your heavy artifacts and quarantine them to subagents. In my measurement that was nearly half of everything, recoverable with one habit change.
Then put your constitution under version control with an owner, and rewrite it once, ruthlessly, to distilled rules. Read it the way an agent will: every sentence either changes behavior or costs money for nothing.
Your agents are only as good as what they read, and you are paying for every word of it 285 times. Edit accordingly.
Related reading:
-
The Prompt Is Dead. Long Live the Loop. the argument this post measures
-
My Stack of Terminals, Documented. the setup these disciplines run inside
-
Your Tests Are the Spec Now. the most load-bearing context of all
-
830 Agents. One Session. the scale that makes the economy visible
-
Claude Code Is Like No One Saying No to You what happens when the model never pushes back
Originally published on orbytlabs.ai on Sep 17, 2026.
Frequently asked questions
What is context engineering?
The discipline of governing everything a model sees: the standing instructions, specs, files, tool results, and memory that surround every request. Prompt engineering tuned one turn's wording. Context engineering designs the environment all turns run inside, which is where agent behavior actually comes from, and it is an engineering practice with budgets, versions, and tests.
Why does context cost more than output?
Because every turn re-reads the whole conversation. My measurement across 35 working sessions: 59.9 million output tokens against 17.07 billion context reads, a 285 to 1 ratio, with the average turn re-reading 504,141 tokens. Optimizing what the model writes tunes a rounding error. The economy of an agent system is read-side, and almost nobody budgets it.
What belongs in a CLAUDE.md or agent constitution file?
Distilled rules with the one-line why, never session narratives: conventions, protected surfaces, known anti-patterns with the lesson attached. It is loaded into every turn, so every sentence is a recurring cost and a recurring instruction. Write it like code: reviewed, versioned, updated the same session a lesson is learned, and extracted when it grows past its budget.
What is the single biggest context waste?
Heavy reads in the main loop. In my measurement, 76 image reads consumed about 9.4 million tokens, 47% of all tool-result volume, averaging 123,660 tokens each, and each one is then re-read every turn for the rest of the session. The fix is quarantine: send heavy artifacts to a subagent that returns a summary, so the main context never carries them.




