Back to Glossary
Infrastructure

Context Window

The maximum amount of text an AI model can process in a single conversation.

Share

Definition

The context window is the total amount of text (measured in tokens) that an AI model can "see" at once during a conversation. It includes everything: your system prompt, the conversation history, your current message, and the AI's response. When a conversation exceeds the context window, the AI starts "forgetting" earlier parts of the conversation — it literally can't see them anymore.

Context window sizes have grown dramatically: early GPT-3 had 4K tokens, GPT-4 offers 128K tokens, and Claude supports up to 200K tokens. A larger context window means longer conversations, bigger documents, and more complex prompts are possible.

Examples

1

Claude's 200K token context window can process roughly a 500-page book in a single conversation

2

If your system prompt is 2,000 tokens and the context window is 8,000 tokens, you have 6,000 tokens left for the conversation and responses

Related Terms

Frequently Asked Questions

What happens when I exceed the context window?
The AI starts dropping earlier messages from the conversation. You might notice it "forgetting" things you said earlier. If this happens, start a new conversation or summarize key information in your current message.
Does a bigger context window mean better responses?
Not automatically. A bigger context window lets you provide more information, but the AI may still prioritize recent messages. For very long contexts, it helps to put the most important information at the beginning and end.

Build prompts using this concept

Explore our prompt library and put context window into practice with ready-to-use templates.

Build prompts using this concept