Key takeaways
- A context window is the maximum amount of text, measured in tokens, a model can consider at once, including its output.
- Long context windows of hundreds of thousands to a million tokens let models read large documents or codebases.
- Limits exist because attention computation and memory grow with length, raising cost and latency.
- Context is per conversation; new chats start fresh, and tools like Claude Code summarise or compact long sessions.
- Roughly, 128K tokens is about 96,000 English words and 1M tokens about 750,000 words.
A context window is the maximum amount of text, measured in tokens, that a language model can take into account at once: your instructions, the conversation so far, any documents, and the response it generates. Long context windows, from hundreds of thousands to a million tokens, let models read whole reports, books or codebases in one go. Context management is central to RAG systems like RAG.NextUpgrad, so this page explains how context windows work, their limits, why they matter, resets in Claude, and what different sizes hold.
What is a long context window in AI?
A long context window is a model's ability to handle very large inputs, commonly 128,000 tokens and above, with some models supporting around a million tokens. That is enough to include long contracts, multiple research papers or substantial codebases in a single request.
Also asked as: what is long context window in ai
Long context enables tasks such as summarising whole books, answering questions across many documents, analysing large logs and reviewing code across files. It does not mean the model uses every part equally well: research found models can miss information placed in the middle of long inputs. For large knowledge bases, retrieval still helps by selecting the most relevant parts. A good rule: use long context when the task genuinely needs the whole document, and retrieval when only a few passages matter.
How does a context window work?
Text is split into tokens, pieces of words, and the model processes all tokens in its window together using attention, which lets each token consider the others. Everything outside the window is invisible to the model for that request.
Also asked as: how does context window work
In chat apps, the window holds the system prompt, conversation history, uploaded content and the new answer. As conversations grow, older parts may be summarised, truncated or dropped to stay within the limit. Each request is processed fresh: the model has no memory beyond what is placed in the window, plus any separate memory features that add saved information to the context.
What is a context window limit?
The context window limit is the maximum number of tokens a model accepts per request, combining input and output. Exceeding it causes errors in APIs, or truncation and summarisation in chat apps. Output usually has its own, smaller maximum.
Also asked as: what is context window limit
Limits vary by model and plan, from a few thousand tokens in older models to hundreds of thousands or a million in recent ones. Practical limits are often lower than technical ones because of cost, latency and quality. In applications, budget tokens deliberately: system prompt, retrieved chunks, conversation history and space for the answer, trimming whichever matters least.
What is the input context window?
The input context is the portion of the window filled by what you send: system instructions, conversation history, documents, retrieved passages and the current question. The remaining space is available for the model's output.
Also asked as: what is input context window
Input tokens are typically cheaper than output tokens in API pricing, but large inputs still add cost and latency, especially when resent with every turn. Prompt caching reduces cost for repeated, stable input such as long system prompts or documents. Designing inputs carefully, putting the most important instructions and content clearly, improves both quality and cost.
Why is the context window limited?
Context windows are limited because the attention computation and the memory for storing intermediate values grow with input length, increasing compute cost, GPU memory needs and latency. Models also need training on long sequences to use them well.
Also asked as: why context window is limited
Engineering advances, such as efficient attention kernels, better memory management and training techniques, have extended windows dramatically. But longer context still costs more per request and can reduce precision on details. That is why many systems combine moderate context with retrieval: select relevant passages rather than sending everything.
Why does the context window matter?
It determines how much information a model can use at once: long documents, extended conversations, many retrieved passages or large codebases. Too small a window forces aggressive trimming, losing details; a large window enables richer tasks but costs more.
Also asked as: why does context window matter
For developers, context shapes architecture: whether to send whole documents or retrieve chunks, how to manage chat history, and how agents keep track of long tasks. For users, it explains why long chats start "forgetting" early details. Good context management, keeping what matters and dropping what does not, often improves results more than a bigger window. Agents in particular need careful context handling, since tool outputs accumulate quickly over many steps.
Is the context window per chat?
Yes. Each conversation has its own context; starting a new chat begins with an empty window, apart from system instructions and any saved memory or project files the app adds. Within a chat, the window holds as much of the conversation as fits.
Also asked as: is context window per chat
Features such as projects, custom instructions and memory carry selected information across chats by inserting it into each new context. Through APIs, applications decide exactly what context to send each time. If a chat becomes long and unfocused, starting a new one with a short summary of key points usually gives better answers.
When does the context window reset in Claude?
In the Claude apps, each new conversation starts with a fresh context window. Within long conversations, the app manages context as it grows, and you may be prompted to start a new chat. In Claude Code, long sessions are automatically compacted, summarising earlier history to free space, and you can clear or compact manually.
Also asked as: when does context window reset claude
Practical tips: start new chats for new topics, use projects to keep shared files and instructions available across chats, and in Claude Code use project memory files such as CLAUDE.md for durable instructions. Similar mechanisms exist in other tools, such as automatic summarisation in coding agents.
How long is a 128K context window?
A 128K context window holds about 128,000 tokens, roughly 96,000 English words using the common estimate of about three-quarters of a word per token, equivalent to a few hundred pages of text, such as a long novel or a large technical report.
Also asked as: how long is 128k context window
For comparison, 32K tokens is about 24,000 words, roughly a long article series or a short book section, and 200K tokens is about 150,000 words. Code and non-English text use tokens differently, often more tokens per word for Indian languages, so actual capacity varies. Use a tokenizer tool to measure your own documents.
How long is a 1M context window?
A one million token context window holds roughly 750,000 English words, the equivalent of several long novels, thousands of pages of documents, or a large codebase, in a single request.
Also asked as: how long is 1m context window
Such windows enable tasks like analysing entire code repositories, many hours of transcripts or large document collections at once. Requests this large are slower and more expensive, and models may not use all details equally well. For repeated questions over the same large corpus, retrieval or caching usually beats sending a million tokens each time.






