Sizing the working memory a model needs for real jobs

Context windows have become a headline feature. Some tools advertise windows of around a million tokens, and when one of them quietly falls back to a smaller limit, heavy users notice within hours and feel stranded. Meanwhile, people working in tools with much smaller windows complain that the assistant forgets files it read a minute ago. It is easy to conclude that bigger is always better.
The reality is more practical. Most individual tasks fit in far less context than the maximum, and filling a huge window has costs in speed, money and sometimes answer quality. This comparison helps you estimate how much context your work actually needs, what each size class is good for, and when a modest window such as 32,000 tokens is entirely sufficient.
Frequently asked questions
What is a context window?
It is the maximum number of tokens a model can consider in one request, counting the system prompt, conversation history, attached documents, tool definitions and the answer it writes. Anything beyond it must be dropped or summarised.
How much text is 32,000 tokens?
Very roughly, for English prose, around 20,000 to 25,000 words, the length of a long report or several chapters. Code and other languages usually fit less per token. Measure with your own content for an accurate figure.
How does a million-token window differ in practice?
It can hold a large codebase, a stack of contracts or a very long conversation at once. Requests become slower and more expensive as they grow, and models may pay less attention to details buried in the middle.
Which is better for coding agents, a large or small window?
Agents that explore big repositories benefit from large windows because tool outputs and file reads accumulate. Focused edits on a few files work fine in smaller windows, especially with careful selection of what to include.
Does a bigger window make answers more accurate?
Not automatically. More context helps when the relevant information would otherwise be missing. Adding irrelevant material can dilute attention and make answers worse. Relevance matters more than volume.
Why does a tool sometimes reduce my context limit?
Tools and services may change available limits per model, plan or load, and very large windows can be offered selectively. Check the provider's current documentation and status pages rather than relying on a past limit.
What is the context of the free-ai endpoint?
32,000 tokens per request, with answers of up to 16,000 tokens. That suits focused tasks rather than whole-repository analysis.
- What actually fills a context window
- Size class one: around 32K tokens
- Size class two: roughly 100K to 250K tokens
- Size class three: around a million tokens
- Estimating what your task needs
- Techniques that stretch a smaller window
- Does a bigger window hurt quality?
- Small windows inside editor assistants
- Picking a model by context needs
What actually fills a context window
People tend to think of context as the document they attached. In practice, several things share the budget. The system prompt, sometimes thousands of tokens in agent tools. Tool and MCP definitions. The full conversation history, resent on each turn. Files and command outputs the agent has read. And the answer itself, which must fit in what remains.
In a long agent session, the visible conversation may be a small fraction of the total. File reads and tool results usually dominate. That is why a session can hit its limit while you feel you have only exchanged a few messages.
The answer needs room too
If a request uses 30,000 of 32,000 tokens for input, only 2,000 remain for the reply. Requests that need long answers, such as full rewrites, must leave space accordingly.
Different models count differently
The same files use different numbers of tokens depending on the model's tokenizer, so a window that fits your project on one model may overflow on another. The article on tokenizer differences explains how to measure this.
Size class one: around 32K tokens
A window of this size holds a long report, a few source files plus a conversation, or a batch of support tickets. It is enough for most single-purpose tasks: summarising one document, editing a module, drafting a reply with relevant background, extracting data from a long page.
The constraint shows up in two cases: when you want the model to consider many files at once, and in long conversations where history accumulates. Both are manageable with retrieval, summaries and fresh sessions.
Speed and cost advantages
Smaller requests return faster and cost less on metered APIs. For high-volume work such as classifying thousands of items, a compact context per item is far more efficient than a giant shared one.
- Fits well: one long document, a handful of code files, a focused chat.
- Fits with care: a small project's key files, a medium research brief.
- Does not fit: an entire repository, a book manuscript, months of chat logs.

Size class two: roughly 100K to 250K tokens
This range, common on many commercial models, holds a mid-sized codebase's relevant parts, several long documents or a lengthy agent session. It is where most coding agents operate comfortably, because file reads and tool outputs can accumulate for a while before anything needs trimming.
It also covers most document work in professional settings: a contract with its annexes, a set of meeting transcripts, a long technical specification. For many teams, this is the practical sweet spot.
Agents still need housekeeping
Even with a couple of hundred thousand tokens, long agent sessions fill up. Good tools compact or summarise history automatically; if yours does not, start new sessions for new tasks.
Cost grows with every turn
Because history is resent, a session near the top of this range pays for most of that context on each new message. Caching, where the provider offers it, reduces the cost of repeated prefixes.
Size class three: around a million tokens
Million-token windows let you load very large inputs in one go: a big repository, a long book, a large collection of documents. For tasks that truly need global awareness, such as tracing a behaviour across an entire codebase or checking consistency across a long manuscript, this is valuable.
The trade-offs are real. Requests take longer to process, cost more and may be subject to separate limits or availability. Answer quality can suffer when the relevant passage is a small needle in a very large haystack. And access to the largest windows may depend on model, plan and current capacity, which is why users sometimes find them unavailable.
Plan for the fallback
If a workflow only works with the largest window, it breaks the day that window is unavailable. Design so the task can also run in chunks or with retrieval, even if more slowly.

Estimating what your task needs
Before choosing a model by window size, measure. Take a typical task, gather everything the model would genuinely need, and count tokens with the provider's usage reporting or a tokenizer library. Add the system prompt, tool definitions and room for the answer.
Then ask which parts are really necessary. Often, an agent reads ten files when two would answer the question. Trimming input to what matters can turn a task that seemed to need a huge window into one that fits comfortably in a small one.
Add a safety margin
Leave at least a few thousand tokens free beyond your estimate. Conversations grow, tools return more than expected and answers run longer than planned.
from openai import OpenAI
client = OpenAI(base_url="https://api.apikeyclaudefree.com/v1", api_key="not-needed")
files = ["app/models.py", "app/views.py", "README.md"]
bundle = "\n\n".join(f"### {p}\n" + open(p, encoding="utf-8").read() for p in files)
resp = client.chat.completions.create(
model="free-ai",
messages=[{"role": "user", "content": bundle}],
max_tokens=1,
)
used = resp.usage.prompt_tokens
print(f"Input: {used} tokens; room left for the answer in 32k: {32000 - used}")Techniques that stretch a smaller window
When a task is larger than the window, you have several well-tested options. None of them is magic, but together they handle most real workloads without resorting to the biggest models.
Map-reduce for long documents
Summarise each chapter or section independently, then ask for a final synthesis of the summaries. This works in small windows and is often more reliable than one giant request, because each step is focused.
Trim before you send
Logs and stack traces are the worst offenders. Keeping only the relevant lines saves thousands of tokens; trimming build logs walks through a practical method.
- Retrieve: search the material and send only the relevant passages.
- Chunk and map: process sections separately, then combine the results.
- Summarise history: replace old conversation turns with a short summary.
- Trim tool output: cap logs and file reads at sensible lengths.
- Start fresh: open a new session for each distinct task.

Does a bigger window hurt quality?
It can. Models attend unevenly across very long inputs, and details in the middle of a huge context are more easily missed than those near the start or end. Irrelevant material also competes for attention. Users who load everything into context and expect perfect recall are often disappointed.
This is not an argument against large windows; it is an argument for relevance. A large window filled with the right material is powerful. A large window filled with everything is expensive and only sometimes better.
Put key instructions at the edges
Place the most important instructions near the start or end of a long prompt, and restate the question after a large document. This simple habit improves results noticeably in long contexts.
Small windows inside editor assistants
Developers who use AI inside an editor often feel the window is small even when the underlying model supports much more. Editor integrations may cap context per request to keep responses quick and costs predictable, and they decide which open files, symbols or search results to include. When an answer ignores a file you had open, the file may simply not have been sent.
You can usually help the tool choose. Reference files explicitly, close unrelated tabs, and paste the specific function or error rather than hoping the integration finds it. For larger investigations, a dedicated agent or a direct API call where you control the input often works better than squeezing everything through an editor panel.
Know what your tool sends
Many assistants can show the context they attached to a request. Checking it once tells you more about why answers miss details than any amount of rephrasing the question.
Limits change with plans and models
The window offered by a tool can differ from the model's maximum and may change between plans or over time. Treat any specific figure you read in a forum as a snapshot and confirm it in the tool's current documentation.

Picking a model by context needs
If your daily work is whole-repository agents or analysis of very large document sets, a commercial model with a large window is the right tool, and frontier models such as Claude are strong choices there. Get access through the official console and check current limits, which may differ by model and plan.
For focused tasks, a 32K window is often enough. The keyless endpoint on this site offers free-ai with 32,000 tokens of context and answers up to 16,000 tokens. It is an independent open-weight model of about 35B parameters, not Claude, and this site is not affiliated with Anthropic. Combined with retrieval and trimming, it handles many everyday jobs. For deciding which tasks belong on which model, see coding-tuned versus all-round models.
Send a test prompt to the keyless free-ai endpoint from the chat box on the home page, no sign-up or key required.
Read also
- How to Give an LLM a Design System So Generated Pages Stay Consistent
- Does max_tokens Count Against Your Limits Before the Answer Arrives?
- What Do initialize, tools/list and tools/call Do in MCP?
- Why Can an Agent See Your MCP Tools but Never Manage to Call Them?
- MCP Connector vs Local Export: Which Is Better for Your Notes?