---
title: "Context Window"
description: "A context window is the maximum amount of input and generated state that a Large Language Model (LLM) can process during one interaction. It is usually measured in tokens and may include system instructions, user messages, retrieved documents, tool definitions, tool results, prior model output, and the requested response."
canonical_url: "https://promptmetheus.com/resources/llm-knowledge-base/context-window"
---

> Index of every page on this site: [llms.txt](https://promptmetheus.com/llms.txt)

A context window is the maximum amount of input and generated state that a [Large Language Model (LLM)](https://promptmetheus.com/resources/llm-knowledge-base/large-language-model-llm) can process during one interaction. It is usually measured in [tokens](https://promptmetheus.com/resources/llm-knowledge-base/token) and may include system instructions, user messages, retrieved documents, tool definitions, tool results, prior model output, and the requested response.

The context window is a capacity limit, not a guarantee that every included detail will be used equally well. Very long inputs can increase cost and latency and may reduce retrieval or reasoning accuracy. The [Lost-in-the-Middle Effect](https://promptmetheus.com/resources/llm-knowledge-base/lost-in-the-middle-effect) is one example of performance degrading based on where information appears in a long prompt.

Applications should therefore treat the context window as an attention and cost budget. [Context engineering](https://promptmetheus.com/resources/llm-knowledge-base/context-engineering) selects the most relevant information for each model call, while [context compaction](https://promptmetheus.com/resources/llm-knowledge-base/context-compaction) reduces accumulated history during long-running conversations or agent tasks. [Context window expansion](https://promptmetheus.com/resources/llm-knowledge-base/context-window-expansion) increases the maximum usable input length, but it does not remove the need to manage relevance and instruction priority.

The usable output length may share the same limit as the input, depending on the model API. Developers should reserve sufficient capacity for the response and for any intermediate reasoning or tool interactions required by the task.

## Sitemap

See the full [sitemap](https://promptmetheus.com/sitemap.md) for all pages.
