Context Is the Hidden Cost of Building Software
· 12 min read
Why the future of efficient development depends less on how much intelligence we can summon and more on how intelligently we manage what it needs to know.
Imagine hiring an extraordinary software engineer.
They can write code, understand complex systems, debug difficult problems, and work at remarkable speed. They never tire, and you can hire dozens of identical engineers almost instantly.
There is just one problem.
Every time they begin working, you have to explain what they are building.
Not necessarily everything. Perhaps they remember the most recent conversation. Perhaps you can hand them a lengthy document. Perhaps they can explore the codebase themselves.
But somehow, before producing useful work, they must acquire enough understanding to make the right decisions.
And every time they acquire that understanding, someone pays.
In traditional software development, context was primarily a human productivity problem. Developers spent time onboarding, searching documentation, attending meetings, and reconstructing the reasoning behind old decisions.
With AI-assisted development, context becomes something more interesting: a measurable engineering resource that we consume, preserve, retrieve, compress, and sometimes waste.
The companies and individuals who understand this distinction may discover that their greatest efficiency gains don't come from more powerful models.
They come from needing those models less.
1. What Are We Actually Paying For?
When an AI coding agent works on a project, its costs extend well beyond generating code.
It needs to understand the task, inspect the repository, identify dependencies, decide what to change, implement those changes, and verify the result.
Often, it repeats parts of this process several times.
Suppose an agent is asked to change a user authentication flow. It might begin by reading the repository structure, authentication configuration, API handlers, middleware, database models, tests, and previous implementation notes.
Only then does it change a few lines.
The actual modification may represent less effort than understanding what to modify.
And when another agent needs to make a related change tomorrow, the entire process may happen again.
We can think about the true cost of an AI development task as:
Total cost = context acquisition + reasoning + execution + verification + coordination + rework.
Token costs are one component. Developer time, elapsed time, tool execution, and the expense of mistakes also matter.
This reveals an important distinction between two kinds of efficiency:
Execution efficiency: How cheaply and quickly can we perform the work?
Context efficiency: How cheaply and reliably can we determine what work needs to be performed?
An organization can become extraordinarily efficient at executing poorly understood tasks.
That is not necessarily progress.
2. More Context Is Not Always Better
It seems obvious that an intelligent system should perform better when given more information.
But that assumption has limits.
A model asked to implement a feature in a 500-file repository does not necessarily benefit from reading all 500 files.
Most of them may be irrelevant. Some may contain obsolete patterns. Others may introduce instructions that conflict with the current task.
The additional information costs money to process, but it can also complicate the decision.
This is not purely theoretical.
The 2024 research paper Lost in the Middle found that language models could perform significantly worse at retrieving relevant information depending on where that information appeared in a long input.
More recent models have improved, but the underlying warning remains useful: the ability to accept information does not guarantee that all of it will be used equally well.
More surprisingly, a 2026 ETH Zürich study evaluating repository instruction files such as AGENTS.md found no significant improvement in task success rates, while inference costs increased by more than 20% on average.
That does not mean repository instructions are useless. It means instructions can create work without creating corresponding value.
This gives us a more sophisticated objective:
Provide the minimum sufficient context for making the correct decision.
Not the minimum context, period.
A missing security requirement could make a small context window disastrously inefficient. An additional architecture document might prevent days of rework.
What matters is the marginal value of the next piece of information.
Does it change the decision?
Does it prevent a likely mistake?
Does it allow us to verify correctness?
If not, why are we paying to process it?
3. Context Has Different Lifespans
One of the biggest architectural mistakes in AI development is treating all information as though it belongs in the same place.
Consider four kinds of project context.
Permanent context
This includes the identity of a product, its fundamental principles, security requirements, ownership rules, architectural boundaries, and definitions of success.
These facts should change relatively rarely.
An application that promises customers ownership of their content, for example, should not need to rediscover that principle every time someone implements a database feature.
Structural context
This includes the current architecture: data schemas, service interfaces, API contracts, dependency relationships, test commands, and important implementation patterns.
It changes as software evolves, but much of it can be represented in compact, machine-readable forms.
Task context
This is the immediate assignment.
What needs to change? Why? Which files are likely involved? What constraints apply? What constitutes completion?
It should be small enough for an agent to understand without reconstructing the entire project's history.
Temporary context
This includes debugging output, raw logs, intermediate hypotheses, failed attempts, exploratory searches, and discarded plans.
It can be valuable during an investigation and almost worthless afterward.
The mistake is forcing all four categories into an ever-growing conversation.
A better system stores durable knowledge durably, retrieves structural information when needed, and discards temporary details after extracting whatever lasting knowledge they contain.
Context management is fundamentally an information-lifecycle problem.
4. The Great Opportunity Is to Stop Relearning
Consider a developer who discovers that three related applications need the same authentication integration.
The first implementation requires research, architectural decisions, experimentation, debugging, and testing.
The second implementation should be easier.
The third should be easier still.
But there are two very different ways this can happen.
In the first, the developer tells an AI agent what happened previously. The model reads the old implementation and creates another variation.
This is somewhat efficient, but the system continues paying to understand and reproduce the same work.
In the second, the developer converts the original solution into something reusable: a shared package, a stable interface, a setup script, a tested template, or a documented installation procedure.
The next application calls the existing capability rather than asking an AI to recreate it.
This distinction is enormous.
Remembering how to solve a problem is useful. Eliminating the need to solve it again is better.
An agent's learning should ideally progress through several stages:
Discovery becomes understanding.
Understanding becomes a documented decision.
A documented decision becomes a tested implementation.
A tested implementation becomes a reusable capability.
And a reusable capability becomes something the next project barely needs to think about.
This is how software development efficiency compounds.
5. The Most Valuable Context May Be Executable
Traditional documentation explains how a system is supposed to work.
Tests, schemas, and interfaces can go further: they help establish what the system actually permits and requires.
Suppose a company operates a publishing platform and promises that authors can export their complete work to another provider.
A paragraph explaining data portability is useful context.
But consider what happens when that principle becomes an executable contract.
An automated test creates an example publication, including articles, metadata, authorship, relationships, and media references.
It exports the publication, imports it into a clean environment, and verifies that the reconstructed content matches the original.
Now an AI agent changing the publishing system does not have to reconstruct the philosophical meaning of portability from a long conversation.
It has an explicit requirement and a repeatable way to evaluate whether its changes preserve that requirement.
The test does not capture every possible legal or business interpretation of data ownership. Human judgment still establishes the policy.
But once the rule is translated into an appropriate invariant, the system can enforce it repeatedly.
The broader principle is that some of the best context is context we can compile into constraints, contracts, and tests.
That information is not merely remembered.
It is operationalized.
6. Context Switching Is Now an Architectural Problem
When humans work across several projects, context switching introduces familiar costs.
A developer leaves a sports application to work on a storefront, then returns to discover that they must reconstruct the mental model of the original codebase.
AI agents have a different but related problem.
They can operate across projects with little emotional or cognitive resistance. But each new working session still requires an appropriate information state.
Spawning five agents does not automatically create five productive engineers.
It may create five separate processes independently reading the same files, discovering the same conventions, and making conflicting assumptions.
Parallelism multiplies work capacity.
It can also multiply redundant context acquisition.
Effective parallel development therefore requires clear boundaries.
An agent working on a checkout integration should receive the checkout contract, relevant service interfaces, necessary security requirements, and acceptance tests.
It should not need the history of a disc golf rating algorithm operating elsewhere in the company.
Similarly, the agent improving a rating system should not have to read the publication platform's editorial guidelines.
Shared concerns belong in shared contracts. Project-specific concerns should remain close to their projects.
That is a form of software architecture, but it is also context architecture.
Good modularity reduces not only code dependencies but knowledge dependencies.
7. The Context Economy Has Three Important Mechanisms
Modern AI systems increasingly distinguish between retrieving context, remembering context, and reusing the computational work of processing context.
These are related but separate efficiencies.
Retrieval means storing information outside the active prompt and loading what is relevant when required. A coding agent can inspect a specific schema or test file rather than consuming the whole repository.
Memory and compaction mean preserving useful facts and decisions while removing unnecessary conversational history. The challenge is to avoid compressing away critical exceptions, failed approaches, or requirements.
Prompt caching means reusing previously processed, sufficiently stable prompt prefixes. This can lower the monetary and computational cost of repeated model calls, depending on the provider and model.
Caching is particularly interesting because the same piece of context may be costly when first processed but inexpensive to reuse across subsequent calls.
There is a catch: rearranging or rewriting a prompt can undermine that reuse.
And caching does not make irrelevant information relevant. It simply reduces the price of processing eligible repeated information.
The ideal architecture therefore balances three sometimes competing goals:
1. Keep stable context stable enough to reuse.
2. Load variable information only when needed.
3. Keep irrelevant information out of the active reasoning process.
A well-designed system uses each technique for the problem it actually solves.
8. AI Agents Should Leave a Project More Intelligent Than They Found It
This may be the most important idea.
Today, many developers evaluate an AI agent primarily by the work it finishes.
Did it implement the feature?
Did the tests pass?
Did it produce the article, animation, or application?
Those are necessary questions, but they are incomplete.
Imagine an agent spends several hours investigating a recurring deployment failure. It identifies an environment variable mismatch, repairs the configuration, and successfully deploys the application.
Excellent.
But what happens the next time a similar application is deployed?
If the process begins with another lengthy investigation, much of the original learning was lost.
A better outcome would include a validated configuration check, a preflight script, or a deployment template that prevents the problem.
The original task produced two outputs: a working deployment and a permanent reduction in future work.
That second output deserves to be measured.
We might call it reusable learning yield: the amount of future effort eliminated by knowledge or automation produced during the current task.
This need not mean every feature should spawn another abstraction, document, or framework.
That would introduce a new form of waste.
Instead, repeated work should trigger a question:
Is this a problem we are paying to solve again because we failed to convert the earlier solution into reusable infrastructure?
Sometimes the answer is no. The cases really are different.
But when the answer is yes, the repeated AI reasoning may be a symptom of a missing software capability.
9. A Network of Projects Changes the Economics
This becomes particularly powerful for a business operating multiple related products.
Consider the Alludio ecosystem: a music archive, an article library, a sports platform, and potentially a local publication and other experiences built around shared infrastructure.
Each product has distinct needs.
But they may share authentication, media handling, publishing pipelines, user management, notifications, analytics, deployment tooling, and data export capabilities.
The naive approach is to treat each product as a separate AI development assignment.
The more sophisticated approach is to discover which work genuinely belongs to the product and which work should become an ecosystem capability.
Suppose the first publishing application requires a media optimization pipeline.
An agent evaluates image formats, writes processing logic, handles failures, tests output quality, and deploys the result.
If another publication requires the same capability, much of that earlier reasoning should already be embedded in a reusable service.
The same principle applies to generating articles, producing animation, publishing social media content, or onboarding a new customer organization.
The objective is not to force every product onto one enormous abstraction.
That can make individual products harder to understand and compromise their independence.
Instead, it is to identify stable, genuinely shared capabilities with explicit interfaces and portable data.
A shared service should save more coordination and implementation work than it introduces.
When that condition holds, the benefits extend beyond saving AI tokens.
There are fewer implementations to maintain, fewer inconsistencies to debug, and fewer decisions to rediscover.
The system becomes less expensive to operate because its architecture has absorbed previous learning.
10. Measuring Efficiency Properly
A development process that reduces token consumption by 70% but doubles defects is not necessarily more efficient.
Neither is one that uses a cheaper model but requires three times as many attempts.
The meaningful unit of measurement is not tokens consumed.
It is cost per accepted, maintainable outcome.
A useful evaluation should account for total model spending, elapsed time, tool calls, attempts, human review, regressions, and subsequent maintenance work.
It should also measure reuse.
Did the task introduce a reusable capability? Did it eliminate repetitive configuration? Did future tasks become easier because of it?
This suggests experiments worth running across real projects.
Give similar tasks to agents operating under different context strategies.
One receives broad repository documentation. Another receives a brief task-specific context packet. A third relies on targeted retrieval.
Hold the acceptance criteria and testing standards constant.
Then compare total cost, task completion, defects, and human intervention.
An especially valuable metric would be the percentage of context that materially contributed to a decision or verification step, though measuring that reliably is difficult.
The objective is not to prove that shorter prompts always win.
It is to determine which information actually improves outcomes for a particular class of work.
Evidence should determine the architecture.
11. The Endgame: Intelligence on Demand, Not Intelligence on Repeat
There is a natural temptation to solve every engineering problem with increasingly intelligent AI agents.
When an agent struggles, give it a bigger model.
When it forgets something, give it more memory.
When the project becomes complicated, supply more documentation.
When progress slows, deploy more agents.
All of those responses can be appropriate.
But they are not always the best response.
Sometimes an agent is struggling because the system itself has never made an important decision explicit.
Sometimes a larger context window is compensating for poor modularity.
Sometimes expensive reasoning is repeatedly performing work that a deterministic program could accomplish faster, more cheaply, and more reliably.
The ideal role of AI in software development is not to remain permanently involved in every step.
It is to help discover, design, and implement systems that reduce the amount of intelligence required for routine execution.
Use expensive reasoning to resolve genuine uncertainty.
Convert the outcome into stable software when appropriate.
Then let inexpensive, predictable mechanisms handle what is already understood.
The next time something changes, bring intelligence back to the boundary of the unknown.
This is not about replacing AI with ordinary software.
It is about using AI to create better ordinary software.
And it may be the difference between a development organization whose costs grow alongside the volume of work and one whose accumulated knowledge makes each subsequent project easier.
Conclusion: Build a System That Needs Less Explanation
The next great productivity breakthrough in software development may not be an AI model that can understand a million more tokens.
It may be an engineering system that rarely needs to send them.
A system where product principles are explicit, architectures are navigable, decisions survive individual conversations, tests preserve important requirements, and repeated work becomes reusable infrastructure.
Where agents receive only the context they need, discover the rest when necessary, and leave behind something better than a completed task.
Where knowledge does not disappear when the conversation ends.
The fundamental question changes from:
How much can this AI do for us?
To:
How much of what this AI just did will we never have to pay for again?
That is where context engineering becomes more than prompt optimization.
It becomes the architecture of compounding efficiency.
Research references
Anthropic, Effective Context Engineering for AI Agents, September 2025.
Liu et al., Lost in the Middle: How Language Models Use Long Contexts, 2024.
Gloaguen et al., Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?, 2026.
Anthropic, Context Engineering: Memory, Compaction, and Tool Clearing, March 2026.
OpenAI, Prompt Caching.
Did this change how you think about it?
About this piece
- Kind
- Argument. A reasoned case. The logic is the evidence; check it.
- Evidence
- Moderate
- Research
- Standard, 0 sources
- Reviewed
- Development
- Developed in one recorded pass, beginning in November 2026. How it is judged
- Record
- sha256:9fe61ea2e6b139614b6ecb82dce8e463bbf919a367f7d3d4aa7d6c71ff5abb27