← All posts

Context Engineering Beats Prompt Engineering: A Field Guide to the Model's Window


What your agent knows at inference time is decided by context engineering, not prompts. Compaction, retrieval, and window hygiene for LLM agents.

Prompt engineering reorders what is already in the window. Context engineering decides what gets in. Only one of those changes what the model is able to know at the moment it answers.

What the window holds

Treat the context window as a working set under a budget: everything admitted displaces something else, and the cost of admitting noise is paid on every subsequent turn of the loop.

01 · Retrieval

Precision over recall

A retriever tuned for recall fills the window with near-misses. At [agent](/posts/what-is-an-agent-harness/) scale, the near-misses are what the model reasons from.

02 · Compaction

Summaries are lossy edits

Compaction is an editorial decision made by a model. Decide what must survive it, and check that it did.

03 · Ordering

Position is policy

Where a fact sits in the window changes how strongly it is weighted. Stable slots beat clever phrasing.

"The model does not know what you know. It knows what fit in the window."
— from Context Engineering Beats Prompt Engineering

The experiment: fixed prompts, fixed model, retrieval policy as the single variable — measured on task completion, not on retrieval metrics.

For a durable design beyond the active window, see Memory Architectures for Long-Running Agents: working state, scoped facts, evidence-backed episodes, and expiry rules each belong in a different layer.