From Prompt Engineering to Context Engineering
You can write a perfect prompt and still get a weak answer. The reason is usually not the wording. It is everything else the model is looking at: old messages from earlier in the chat, a long file you pasted, instructions you set weeks ago, or important background you never gave it.
Context engineering is the skill of controlling all of that. Prompt engineering asks "how do I word my request?" Context engineering asks "what should the model see when it answers, and what should it not see?" Once you think this way, you get more consistent results from any AI tool.
What You'll Learn
- The difference between a prompt and the full context a model sees
- The five things that fill a model's context, and which ones you control
- Why more context is not always better
- The four core moves of context engineering used in the rest of this course
The prompt is only a small part
When you send a message, the model does not just read your latest words. The app sends it a whole bundle, and the model answers based on all of it. That bundle is the context.
- Everything the model sees (the context)
- Standing instructions: custom instructions, project or assistant settings
- Background material: files, pasted text, retrieved documents
- Conversation history: every earlier message and reply in this chat
- Tool results: web searches, file reads, if the assistant uses tools
- Your prompt: the message you just sent
Your prompt competes with everything else in that bundle for the model's attention. A great prompt sitting on top of a messy, contradictory context still produces messy answers.
The context has a budget
Every model has a context window: a limit on how much text it can take in at once. Even when your material fits, space is not free:
- Attention is limited. Models tend to focus on the start and end of a long context and pay less attention to the middle. A key detail buried on page 30 can be missed.
- Noise distracts. Irrelevant text, outdated notes, and earlier wrong answers all pull the model away from what matters.
- Conflicts confuse. If your standing instructions say "be brief" and your prompt says "be detailed," the model has to guess which wins.
- Long context costs more and runs slower, especially in paid or API tools.
So the goal is not "give the model as much as possible." It is give the model the right things, in a clear order, and nothing that gets in the way.
If you want the mechanics of tokens and context windows, How LLMs Actually Work explains them.
Prompt engineering vs context engineering
Context engineering includes prompt engineering, then zooms out.
| Criteria | Prompt engineering | Context engineering |
|---|---|---|
| Main question | How do I word this request? | What should the model see, and in what order? |
| Scope | One message | Instructions, files, history, and the message |
| Typical fix | Clearer wording, examples, format | Remove noise, add missing background, restructure |
| Pays off most for | One-off tasks | Recurring work and long documents or chats |
Prompt engineering
- Main question
- How do I word this request?
- Scope
- One message
- Typical fix
- Clearer wording, examples, format
- Pays off most for
- One-off tasks
Context engineering
- Main question
- What should the model see, and in what order?
- Scope
- Instructions, files, history, and the message
- Typical fix
- Remove noise, add missing background, restructure
- Pays off most for
- Recurring work and long documents or chats
Good prompting still matters. If you want to sharpen that skill first, Advanced Prompt Engineering covers evaluation, meta-prompting, and structured outputs. This course assumes you can write a decent prompt and focuses on everything around it.
A quick diagnosis
When an AI answer disappoints you, ask which part of the context caused it before you rewrite the prompt:
- It ignored my rules. Were the rules buried in a long chat, or contradicted somewhere?
- It made something up. Did it actually have the source material, or was it guessing from general knowledge?
- It used the wrong details. Is there old or wrong information earlier in the conversation?
- It missed something in my document. Was the key part lost in the middle of a very long file?
- It sounds generic. Did it know who you are, who the audience is, and what good looks like?
Most of the time, the fix is to change what the model sees, not how you phrase the question.
The four core moves
The rest of this course is built around four moves:
- Add what is missing: give the model the background it cannot guess. (Lesson 2: context packs)
- Structure what is long: order and shape big inputs so nothing important gets lost. (Lesson 3: long documents)
- Select what is relevant: choose between pasting, uploading, and retrieval. (Lesson 4)
- Remove what is stale: clean up long conversations and hand off to fresh chats. (Lesson 5)
Key Takeaways
- The context is everything the model sees: standing instructions, background material, conversation history, tool results, and your prompt.
- Your prompt is one small part of that bundle, and it competes for attention with everything else.
- More context is not always better: noise, conflicts, and buried details all hurt answers.
- Context engineering asks what the model should see and in what order. It includes prompt engineering and goes beyond it.
- The four core moves: add what is missing, structure what is long, select what is relevant, remove what is stale.

