Kode Rex · Line of inquiry 04 of 04

Context engineering

Not whether the agent has instructions, but whether it receives what it needs to decide reliably.

§01

The question

An agent’s decision is bounded by what it can see when it makes it. I treat that as an engineering problem rather than a writing one: what goes into the context, in what order, from where, and what is deliberately left out. A harness bounds a run through its context, tools, permissions and budget, and context is the part most often handled as an exercise in phrasing.

§02

Why it matters now

Every token is rented memory, and the context window is the heap. Agents now run for a long time, call tools and carry history, so what is in the window is assembled by a system, not typed by a person. When it goes wrong it looks like the model got worse, when the model never had what it needed. Vocabulary drift is a quiet version of the same failure: one word carrying two meanings, and the system disagreeing with itself while every test passes.

§03

The landscape

The term moved into common use in 2025. Dex Horthy’s 12-Factor Agents argues for owning your prompts and your context window rather than leaving them to a framework, and Anthropic’s “Effective context engineering for AI agents” treats context as a finite resource to curate over long-running work. The research backs the caution: Liu et al., “Lost in the Middle”, found models use information at the start and end of a long context better than in the middle. Retrieval-augmented generation (Lewis et al., 2020) and the Model Context Protocol are two of the main ways systems now feed an agent what it sees.

§04

What I’m testing

My hypothesis is that many reliability problems blamed on the model are context problems: the purpose of the work was not stated precisely enough for a worker who was not in the conversation, or the agent was handed everything instead of what mattered. The questions I am working: can you test a context the way you test code, so a change to what an agent sees fails a build when it makes decisions worse? Where is the line between memory a system should carry and context it should rebuild each run? And does making vocabulary structural, so the build fails when a load-bearing concept is called by a stranger word, measurably cut errors?

Related

Apr 2025

AI Coherence: a theory of utility in large language models

Mar 2025

2,500 ChatGPT conversations: a case study

2025

The Value of LLMs

LambdaConf — why ‘stupid’ machines are smarter than you think

2025

The Coherence Trap

AI Engineer World’s Fair — why LLMs feel smart but are not thinking

← All lines of inquiry