From Prompt Engineering to Context Engineering
Why the best results come from curating everything the model sees — not from magic phrases — and a framework for doing it.
For a while, getting good results from AI meant collecting magic phrases. "Think step by step." "You are a world-class expert." "I'll tip you $200." Some of those tricks helped older models a little. None of them explain why the same agent nails a task on Monday and fumbles a nearly identical one on Tuesday.
The real answer is usually boring: on Tuesday, the model was looking at different information. It was missing a file, holding a stale assumption from earlier in the conversation, or wading through 40 irrelevant search results. Modern models are capable enough that what they see matters far more than how you phrase the ask.
This lesson reframes your job. You'll learn what "context" actually includes, why more of it can make things worse, and a four-step framework for deciding what goes in front of the model, so you can fix bad results deliberately instead of by trial and error.
What the model actually sees
A language model has no memory between calls and no view of your screen, your files, or your company. Every time it responds, it sees exactly one thing: a block of text (and sometimes images) called the context. The context window is the maximum amount of that text it can take in at once, measured in tokens (roughly word-sized chunks; see Context Windows, Tokens, and Cost for the details).
When you type a message into an agent, your message is a small slice of what the model receives. A typical agent's context looks like this:
| Layer | What it contains | Who controls it |
|---|---|---|
| System prompt | The agent's role, rules, and priorities | The agent builder |
| Tool definitions | Names, descriptions, and schemas of every tool available | The agent builder |
| Standing instructions | Project files like CLAUDE.md or AGENTS.md, user preferences | You or your team |
| Retrieved knowledge | Documents, search results, file contents pulled in for this task | The agent, guided by you |
| Memory | Notes carried over from earlier sessions | The agent or the builder |
| Conversation history | Every previous message, tool call, and tool result in this session | Accumulates automatically |
| The current request | What you just asked | You |
Context engineering is the practice of deliberately designing all of those layers so the model has exactly what it needs for the task, in a form it can use, and as little else as possible. Prompt engineering (the craft of wording a single request well) is one part of it, the last row in the table.