Course contents
Concept · 4 hands-on exercises

Put it into context

Understand what the agent can see at any moment, why long sessions go stale, and how to hand it exactly the context a task needs.

Every answer an agent gives comes from its context: everything in front of it right now. That's the tool's own instructions, your project's instruction file, the files it has read, your conversation so far, and the output of every command it ran. Nothing else. It doesn't remember yesterday's session, and it can't see your screen unless you show it.

So the quality of the agent's work depends on what you put in front of it, and as much again on what you leave out.

The context window

Context lives in the model's context window, measured in tokens. As of November 2026, many current models have windows of about a million tokens, including Claude Opus 5.5, GPT-6 Astra and Gemini 4 Carbon; Cursor describes Grok 4.7 as having a 256,000-token standard window with a 500,000-token long-context option. That sounds limitless, but two things bite long before the window is full. Everything in it counts toward your usage, and the more there is, the more easily details in the middle get missed.

Explore: What fills a long sessionExercise 1 of 4
Tool instructions and setup · 15kYour instruction file · 2,000Files the agent read · 40kHours of back-and-forth · 160kPasted logs and long errors · 30kScreenshots · 3,000
Tool instructions and setup1 set
Your instruction file1 file
Files the agent read8 files
Hours of back-and-forth2 hours
Pasted logs and long errors1 paste
Screenshots2 images
250ktokens used
25%of a 1M window
750kleft for the work

Comfortable: room to think and work

Illustrative sizes for a 1M-token window; real numbers vary by tool, model and project. Try a whole working day in one session.

Move the controls and watch what changes.

Quick checkExercise 2 of 4

In the explorer, what fills a long session fastest?

What the agent can and can't see

The agent can see…The agent can't see…
Files in the project, once it opens themYour screen or your browser tabs
The output of commands it runsEarlier sessions, unless something was saved to a file
Screenshots and text you paste inYour live site, unless it has a tool to fetch it
Your instruction file, loaded at the startWhat you meant but didn't say

The right-hand column is where most misunderstandings start. You see the page in your browser; a terminal agent usually doesn't. When something looks wrong, describe what you see or attach a screenshot. When you made a decision in an earlier session, it's gone unless you wrote it into the instruction file or a note in the project. And when the agent seems to be answering a different question from the one you asked, it's usually missing a piece of context you assumed it had.

Fresh sessions beat long ones

After hours in one session, the early details (your constraints, the decision you made at 9am) are buried under everything since. Many agents compact long sessions by summarizing older turns, and summaries drop details. The fix is cheap: start a fresh session for each new task. In Claude Code, /clear starts a new conversation while keeping project memory; in Cursor and most other tools, start a new chat. Anything the agent must always know goes in the instruction file, which loads into every new session automatically.

Give context, don't dump it

  • Point, don't paste. “Look at specials.json and archive.html” beats pasting both files. The agent opens them itself and reads only what it needs.
  • Show, don't describe. A screenshot of the broken layout, or an example of the output you want, is worth a paragraph.
  • Trim the evidence. Paste the error lines that matter, not the whole log.
  • Say why. “The owner prints invoices for catering clients” is context no file contains.
Sort itExercise 3 of 4

Today's task is fixing the archive's month headings. Does each item help the agent, or is it noise?

Card 1 of 6

“The owner reads the archive on her phone”

You make the callExercise 4 of 4

The rule it forgot

You've worked on the site in one session all day.

  1. Late in the afternoon, the agent adds a JavaScript framework to build a gallery, even though you said “no frameworks” this morning.

Check your understanding
Q1. Why might an agent “forget” a rule you gave it in this morning's prompt?
Q2. What belongs in the instruction file rather than in a prompt?
· Work through the 4 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.