Run /context in your next Claude Code session before you type anything. Look at the breakdown: system prompt, tool definitions, MCP schemas, CLAUDE.md, memory files. That's your idle spend. You're paying for it, in dollars and in model attention, on every single turn, before the agent has done one useful thing.
If you've ever opened a client's AWS bill and found a fleet of forgotten m5.2xlarge instances running a service nobody remembers, you already understand context engineering. Same discipline, new resource. The context window is a budget. Most engineers are blowing theirs on the equivalent of unattached EBS volumes.
"Context engineering" became the term of 2026. Martin Fowler's site defines it as "curating what the model sees so that you get a better result." Two years ago the skill was prompt engineering: writing the right instruction. Now the models are good enough that the instruction is rarely the problem. The problem is everything else the model is looking at while it reads your instruction.
Why "more context" makes agents worse
The intuition says: bigger context window, stuff more in, agent knows more, agent does better. The intuition is wrong twice.
First, cost. Every input token is billed on every turn. A session that starts 40K tokens deep pays those 40K tokens on turn one, turn ten, and turn fifty. Long agentic sessions multiply the waste. I broke down the mechanics in the token limits post, and the tokenizer differences between providers make it worse if you're multi-model.
Second, attention. Models get measurably worse at using information as the context fills with irrelevant material. An agent with your entire wiki loaded doesn't act like a well-read employee. It acts like an on-call engineer being read the full runbook archive over the phone while the site is down. More is not signal. More is noise with a billing line.
The goal is not a big context. The goal is the smallest context that contains everything relevant. Right-sizing, exactly like compute.
The FinOps loop, applied to context
Cloud cost optimization has a standard loop: audit → right-size → schedule → isolate → monitor. Every step has a direct context equivalent.
Audit: find out what you're actually loading
/context is your Cost Explorer. Typical waste, in the order I usually find it:
- MCP servers you forgot about. Installed for one task months ago, loading their schemas ever since. (I wrote a full decision framework for MCP vs. skills; the short version: if it's not live data or credentials, it shouldn't be a server.)
- A bloated CLAUDE.md. It grew by accretion: every incident added a paragraph, nobody ever deleted one. It's the config file equivalent of a security group with 200 rules.
- Stale memory and rules files describing code that was refactored two quarters ago. Wrong context is worse than no context: the agent trusts it.
Right-size: put knowledge on the cheapest tier that works
Not all context deserves the always-loaded tier. Match each piece to its access pattern, like storage classes:
| Tier | Storage equivalent | What belongs there |
|---|---|---|
| CLAUDE.md | Hot / always-on | Universal, always-true conventions. Build commands, non-negotiable rules. Keep it brutally short. |
| Scoped rules | Warm | Conventions that apply to specific paths (*.tf rules load only when touching Terraform). |
| Skills | Cool / on-demand | Procedures: deploy flows, incident runbooks, migration guides. One description line until invoked. |
| Scripts + docs the agent can read | Cold | Anything the agent can fetch itself when needed. docs/runbooks/ it can grep beats content it must carry. |
The test for CLAUDE.md residency is simple: is this true and relevant in every single session? If not, demote it a tier. My CLAUDE.md guide goes deep on the always-on tier; the one-line summary is that every sentence in that file is a tax on every future session.
Schedule: decide who loads context, and when
Fowler's taxonomy has a dimension most people miss: who decides when context loads. It maps cleanly to automation maturity:
- LLM-driven: the agent decides a skill is relevant and loads it. Flexible, occasionally wrong. This is autoscaling.
- Human-triggered: you invoke a slash command when you know it's needed. Reliable, requires you. This is manual scaling.
- Deterministic: a hook injects context on an event, every time, no judgment involved. This is a cron job.
The failure mode is using the wrong trigger for the stakes. Anything that must always happen, like "check the AWS profile before mutations", cannot be LLM-driven, because LLM-driven means probabilistic. That's hook territory. Meanwhile, hard-wiring rarely-used procedures into always-loaded files is paying reserved-instance prices for a workload that runs monthly.
Isolate: subagents are separate VPCs for attention
The biggest context wins don't come from trimming files. They come from architecture. When a task requires reading 30 files to answer one question, don't do it in your main session. Dispatch a subagent. It burns its own context on the exploration and returns only the conclusion. Your main session pays for the answer, not the search.
This is the same reasoning as not running your batch jobs on the production database: isolate the expensive, messy work; keep the primary lean. Research from across the industry now converges on this: multi-agent "harness engineering" exists precisely because complex tasks exceed what a single context window handles well.
Monitor: make it a habit, not a project
Context bloat is not a one-time cleanup, because it regrows the same way cloud spend does: one reasonable-sounding addition at a time. The maintenance loop that works:
- Run
/contextat the start of a heavy session. If startup overhead crept up, find out what changed. - When a session goes sideways, check what the agent was looking at before blaming the model. Misleading context produces confident, wrong agents.
- Every time you add something to CLAUDE.md, remove something. Zero-based budgeting for tokens.
- Quarterly: delete MCP servers, skills, and memory files that no session used. Untagged resources get terminated.
Takeaways
- The context window is a budget with an idle-spend problem. Audit it with
/contextthe way you'd audit a cloud bill. - Right-size by access pattern. Always-true → CLAUDE.md. Path-specific → scoped rules. Procedural → skills. Fetchable → leave it on disk.
- Match the loading trigger to the stakes. Must-always-happen → hooks. Usually-relevant → skills. Know-when-I-need-it → slash commands.
- Isolate expensive exploration in subagents. Pay for conclusions in your main session, not searches.
- Wrong context beats no context at being dangerous. A stale runbook loaded confidently is worse than an agent that admits it doesn't know.
Prompt engineering asked "how do I phrase this?" Context engineering asks "what is the model looking at, and does every token earn its place?" One of those is a writing skill. The other is an operations discipline, and if you've done FinOps, you already have it.