NEWCloud agents are live.See how

Models

Context window

The maximum amount of text, measured in tokens, that a model can consider at once, counting the system prompt, the conversation, the files it has read, and the reply it is generating. Everything outside the window is invisible to the model, which is why long sessions get summarized or trimmed.

At a glance

Measured in
Tokens
Includes
System prompt, history, files, tool output, reply
Set by
The model
When full
The harness trims or summarizes
Persists between sessions?
No

How it works

Every request to a model resends the whole conversation, and all of it must fit in the window. In a chat that is mostly your messages. In an agent session it fills much faster: the system prompt and tool definitions, the agents file, every file the agent reads, every command output, and every edit it proposes. One large source file or an unfiltered test log can outweigh the whole conversation around it. The reply counts too: providers cap output tokens separately, but input and output share the window.

The API rejects a request that does not fit, so harnesses manage the window before that point by dropping old tool output, summarizing earlier turns, or asking for a new session. Whatever is removed is gone for the model. If a decision lived only in an early message, the agent no longer knows it, which is why durable rules belong in files.

Why it matters

A large window is not the same as good recall across it. The 2023 paper "Lost in the Middle" found that models use information at the start and end of a long input more reliably than information in the middle. Filling the window also costs more and slows responses; prompt caching reduces the cost, not the attention problem. So the practical question is rarely whether something fits, but whether it is worth the space.

Context window vs. context engineering

The window is a fixed property of the model: how much it can take in. Context engineering is how you spend that budget. A smaller window used well usually beats a larger one stuffed with whatever was nearby.

It is also different from the output limit. A model may accept a very long input but still cap how much it writes in one reply, which is why agents produce large changes as a series of edits rather than one huge response.

Common mistakes

  1. Treating the window as memory, when nothing in it survives into the next session unless the harness loads it again.
  2. Pasting whole files and full logs when the relevant function or failing test would do.
  3. Assuming a model recalls everything in a long input equally well, wherever it sits.

Frequently asked questions

Is the context window measured in words?

No, it is measured in tokens. For English text a token averages roughly four characters, and code with lots of symbols and whitespace usually takes more tokens per line than prose.

Does the context window include the model's answer?

Yes. The system prompt, conversation, tool results and the reply being generated all share the same window.

Does a model remember things after the context window resets?

No. The window is the model's only working view, so anything that must persist should live in a file the agent can read again.

Sources

Know the words. Run the work.