Skip to main content
Context is the information an AI model uses to produce its next response. Context management is the practice of giving the model the right information at the right time. This matters because AI does not work from your intent alone. It works from the text, files, screenshots, logs, examples, and conversation history available in its context window.

What is a context window?

An AI model has a limit on how much information it can consider at once. That limit is called the context window. The context window can include:
  • Your prompt
  • Earlier messages in the conversation
  • Files or code the model can see
  • Error messages and logs
  • Screenshots, images, or design references
  • Project instructions, such as replit.md
  • Tool results from previous steps
The model uses that context to decide what to generate next.

Why context windows matter

If the important details are not in context, the model may guess. If too much unrelated information is in context, the model may focus on the wrong thing. For example, this prompt gives little context:
This prompt gives useful context:
The second prompt tells the model who the page is for, what to improve, what to preserve, and what is out of scope.

Context window sizes vary

Different AI models can handle different amounts of context. Larger context windows can consider more text at once, but larger is not always better. Relevant context still matters more than dumping every detail into the conversation. Examples of public context window sizes: These numbers change over time and do not guarantee that every product exposes the full model limit. The practical lesson is stable: keep the important information clear and focused.

Types of context

Fresh context and persistent context

Some context belongs in the current conversation. Use it when you are asking for a specific change, debugging one issue, or giving feedback on a recent result. Other context should persist across the project. Use persistent context for coding style, brand guidelines, naming conventions, reusable product rules, and constraints Agent should remember across work sessions. On Replit, replit.md is one way to give Agent persistent project context.

When context gets noisy

Long conversations can drift. If a thread has mixed too many unrelated decisions, Agent may pay attention to old context that no longer matters. Start a fresh thread when:
  • You switch to an unrelated feature
  • The conversation has many abandoned directions
  • Agent keeps applying old constraints
  • You want a clean plan for a new area
When you start fresh, summarize the important context instead of assuming Agent knows what still matters.

Common misconceptions

  • “More context is always better.” Relevant context is better. Too much unrelated context can distract the model.
  • “The model remembers everything perfectly.” AI uses available context, but you should restate important constraints when they matter.
  • “Context is only text.” Screenshots, files, data, designs, logs, and examples can all be context.

Where to go next

Introduction to AI

Learn how language models work and how AI agents use models with tools to take action.

Build with Agent

Learn how to add context while working with Agent.

Effective prompting

See prompt examples that include useful context.

replit.md

Learn how to provide persistent project context.