Learning on Web Dev Open is free for all.

Build First > Meet your AI toolsContext is everything
Phase 00Meet your AI tools12 of 434

Context is everything

A model has a fixed amount of context. When that space gets crowded, you may see it forget earlier details, contradict itself or bring back code you already removed.

Concept18 minAI pair

A model can only hold a fixed amount at once. Your files, your chat, its own replies and your rules file all compete for that same space.

When that room fills, the oldest material falls out. Not the least important. The oldest.

This single fact explains almost every mystifying agent behaviour a beginner meets.

It re-adds code you told it to delete, because the instruction to delete it is gone. It contradicts a decision from an hour ago, because the decision is gone. It invents a function signature, because the file it read at the start is gone and it is filling the gap from memory of similar code.

Load the window below until it overflows. The panel underneath does not just say the model is confused; it shows the specific kind of failure each missing item can cause.

What the model can still see

2.9k / 200k tokens

Costs are realistic orders of magnitude, not measurements. The proportions are the point.

Put something in
In the window · oldest at the top

Everything fits. The model can see all of it, and will behave consistently. Keep adding: the interesting part is what happens when it does not fit.

Fill it past capacity and watch what drops out. A full context does not make the model less capable; it simply leaves it with fewer of the facts you gave it.

Two habits help a lot here. Start a fresh session when you move to a new task instead of dragging a four-hour conversation along with you. If a session starts behaving oddly, restate the few facts it needs or start a clean session.

You should now be able to

  • Explain what a context window is and what falls out of it first
  • Predict which failure you will get when it overflows
  • Keep a long session useful instead of watching it degrade
Ask the community

Loading…