Chapter 7: Context

Context engineering

Choosing what the model can see on each request: which instructions, files, tool results and history go in, and which stay out. The prompt is what you say. Context is everything else it reads before it answers.

An agent gathers most of its context itself by calling tools, so your sentence is a small part of what it reads. Better wording can't supply a file it never opened. In chat you pasted everything in by hand. With an agent, you set up what it can reach and what it reads first.

Say it to your agent

“Before you change anything, list the files you have read for this task, what you still need to see, and any name you are assuming exists. Read src/api/checkout.ts and src/discount.ts first, then stop and tell me.”

The workshop

Name a word, or describe what you mean in everyday language.