

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: What Is Context?
incomplete
2: Context As RAM
incomplete
3: New Sessions
incomplete
4: Token Economics
incomplete
5: Ignoring Files
incomplete
6: File Watcher
incomplete
7: Lost in the Middle
incomplete
8: Compaction
incomplete
9: Configure Compaction
incomplete
10: Undo and Redo
incomplete
11: Forking
incomplete
12: Secrets in Context
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Context is all the information your AI model can "see" when it's generating a response. A "context window" is the limit on how much of that information the model can work with at once.
Click to play video
Giving an agent the ability to read files, connect to a database, or call an API does not automatically put that data in the model's context. The agent needs to fetch it first. When the model is generating text, it uses the tokens in context to predict the next token, then repeats the process with the new token included.
What makes AI feel more sophisticated is that all the tool-calling, file-reading, etc. injects more information into context – often managed automatically by agents – before the model generates its final response to a prompt.
The prompt that you enter is only part of the context, and with coding, usually a very small part. Context can include:
A context window of 1 million tokens can hold roughly 750,000 words of English text, or about 1.5x the length of the entire Lord of the Rings trilogy. That's much more than you'd ever write into a prompt by hand, but not so much when you're trying to shove your entire codebase, documentation, and session history into the model's context.