# What is a context window?

The context window is the amount of text a language model can look at while it writes a reply: your messages, files, tool results and its own earlier answers. It is the model's working memory, separate from what it learned in training, and it is measured in tokens.

## Why it matters

A larger window lets a model work with longer documents and longer conversations. When it fills up, something has to go: older messages are dropped or summarised, and details get lost. Coding agents feel this most, because file contents and tool results are long.

## Making good use of it

- Put rules the agent always needs in a short context file, such as [AGENTS.md](https://ai-powered.com/academy/glossary/agents-md).
- Put procedures in [skills](https://ai-powered.com/academy/glossary/agent-skill), which load only when needed.
- Start a fresh session for a new task instead of carrying an old conversation along.

The lesson [context engineering](https://ai-powered.com/academy/code-with-ai-agents/context-engineering) covers this in practice.

## Sources

Official documentation, checked on 19 November 2026:

- [Glossary (Claude docs)](https://platform.claude.com/docs/en/about-claude/glossary)
- [How Claude remembers your project (Claude Code docs)](https://code.claude.com/docs/en/memory)

## Related terms

- [Token](https://ai-powered.com/academy/glossary/token): A token is the smallest unit of text a language model works with: a word, part of a word, a character or a byte. Models read and write tokens, so context limits and API prices are counted in tokens rather than words.
- [LLM](https://ai-powered.com/academy/glossary/llm): An LLM (large language model) is an AI model with a very large number of parameters, trained on vast amounts of text, that generates text: it can answer questions, summarise, write and more. AI assistants are built on LLMs that are further trained to be helpful.
- [Agent skill](https://ai-powered.com/academy/glossary/agent-skill): An agent skill is a folder that teaches an AI agent how to do one kind of task. It holds a SKILL.md file (a name, a description of when to use it, and instructions) and can include scripts, templates and reference files. The agent loads it only when a task matches the description.
- [AGENTS.md](https://ai-powered.com/academy/glossary/agents-md): AGENTS.md is an open format: a plain Markdown file at the root of a repository that tells coding agents how to work in it, such as build and test commands and conventions. Many coding agents read it at the start of a session. CLAUDE.md is Claude Code's equivalent, and Claude Code can read AGENTS.md too.
