The AI context window, explained: why bigger isn't better
Every AI model has a context window. It's how much it can take in at once. Your instructions, the files you attach, the whole conversation so far, and the results of any tools it uses all have to fit inside it.
It's measured in tokens. A token is roughly a piece of a word. Windows have grown fast, and the newest models can hold a lot. So it's tempting to fill them up.
Don't.
Models miss what's in the middle
A 2023 research paper called "Lost in the Middle" tested this directly. The researchers hid the useful information at different spots in a long input and asked models to find it.
The models did best when the information was near the start or the end. They did worse when it was buried in the middle. And they got worse overall as the input got longer, even models built for long inputs.
So a bigger window doesn't mean a model reads everything equally well. It means there's more room for the important thing to get lost.
Long sessions drift
The same thing happens over a long working session. The rules you set at the start get buried under everything that came after. The AI doesn't forget them on purpose. They just lose against a context that keeps filling up.
That's why an agent that behaved perfectly for the first hour can start doing things you told it not to. It's also why a guess it made early can turn into a "fact" it builds on later.
The model didn't get dumber. The room got bigger.
What to do instead
One job, one session. Start fresh when the job changes. Don't carry yesterday's conversation into today's task.
Put what matters first. The key instruction and the key facts go at the top. Repeat the most important rule at the end if the input is long.
Summarize, don't paste. Give it the two paragraphs that matter, not the hundred page manual.
Trim tool output. If a search returns fifty results, pass along the five that count.
Make the important rules walls. If a rule must hold for the whole session, enforce it in the system, not in the prompt. Prompts fade. Permissions don't.
If this is new, start with what context engineering is.
Sources: Liu et al., "Lost in the Middle: How Language Models Use Long Contexts," 2023. Anthropic, "Effective context engineering for AI agents".
Get each new post by email.
One email when a post is out. Unsubscribe anytime.