CHAPTER 05 · Context Engineering and Memory · 2 / 11
The context window is a budget
Every token you put in context costs money and latency, and crowds out other tokens. So treat the window as a budget to allocate, not a bucket to fill. The instinct to "give the model everything just in case" is wrong: it's expensive, it's slow, and, counterintuitively, it often degrades quality, because important details get diluted among irrelevant ones (the "lost in the middle" effect). Curate ruthlessly.