The previous article covered the basic concepts behind an AI agent. This one covers the next layer — what it actually means to be “good” at using AI.
Why These Two Terms Get Mixed Up
Search for how to use AI well, and “prompt engineering” and “context engineering” show up tangled together. Both sound like “a way to communicate something to AI well,” so it’s easy to treat them as the same thing. But they emerged at different points in AI’s evolution, and they focus on different targets.
Prompt Engineering — “How Do You Phrase It?”
Early LLMs (large language models) had a simple structure: a user typed something, and the model looked at just that input and generated an answer. The concern in that era was singular: “what sentence gets the AI to understand what I mean?”
- Assigning a role — “you’re a copywriter with 20 years of experience” — shifts the tone of the answer
- Showing a few examples (few-shot) gets you an answer closer to the format you actually want
- Adding “think step by step” improves reasoning accuracy
As this kind of know-how — how to structure a single instruction to get a good result — accumulated, the field picked up the name prompt engineering.
Context Engineering — “What Do You Pre-Load?”
Once AI agents started writing code, handling multiple files, and carrying tasks over long stretches of time, the problem changed shape. Now, output quality depends far more on whether the information the agent will reference throughout the task is properly in place from the start than on any single well-written sentence.
That’s context engineering. Think of it as deliberately, systematically loading the Context Window — the space where an agent holds information, covered in the previous article.
The most common tool for this is an AGENTS.md file (sometimes called CLAUDE.md, depending on the tool). Put this file at the root of a project, and the agent automatically references its contents on every task.
What typically goes into AGENTS.md
- A description of what the project does
- Rules to follow (e.g. “don’t create new files without asking,” “don’t deploy before I’ve confirmed the result”)
- Guidance on project structure (what lives in which folder)
Write this one file well, and you never have to repeat the same explanation in every prompt again. It’s a way of setting a project’s “constitution” ahead of time, and having the agent work by referencing that constitution at all times.
Comparing the Two With a Real Example
The difference becomes obvious when you compare how the same task gets approached from a prompt-engineering angle versus a context-engineering angle.
Situation: you want to keep handing internal report drafts off to AI on an ongoing basis.
| Approach | Method |
|---|---|
| Prompt engineering | Every time, spell out in detail: “write this in our company’s report format, in bullet-point style, leading with the conclusion” |
| Context engineering | Write a file up front containing your company’s report format, tone, and commonly-used terms, and have the agent reference that file every time |
With prompt engineering alone, you have to type the same content over and over, and since people phrase it slightly differently each time, results end up inconsistent. Add context engineering, and instructions get shorter while results get more consistent.
Why You Can’t Rely on Just One
These aren’t competitors — they’re techniques operating at different layers.
- No matter how well-prepared the context is, a sloppy specific instruction (prompt) on the day still won’t get you the result you want.
- Conversely, no matter how polished the prompt is, if the agent starts with zero knowledge of the project’s background and rules, you have to explain everything from scratch every time, and consistency suffers.
In practice, the most efficient approach is to pre-load recurring background information as context (AGENTS.md and the like), and reserve the prompt for whatever’s specific to that day.
Wrapping Up
| Prompt Engineering | Context Engineering | |
|---|---|---|
| Focus | How to write a single instruction | How to pre-load the information an agent will reference |
| Emerged from | The era of simple question-answering LLMs | The era of AI agents handling multi-file, multi-step work |
| Representative tools | Role assignment, examples, step-by-step reasoning prompts | Rule files like AGENTS.md (CLAUDE.md) |
The next article covers where these two fall short on their own — harness engineering, for keeping AI running reliably over long stretches of time.
AI Agent Series — Full Table of Contents
- (Part 0, before you start) Setting Up an AI Agent Practice Environment
- (1/5) What Is an AI Agent?
- (2/5) Prompt Engineering vs. Context Engineering — you are here
- (3/5) What Is Harness Engineering?
- (4/5) Agentic Engineering and the PH-AH Loop
- (5/5) Hands-On Practice With 4 AI Agent Concepts
Beyond the series — the two articles below aren’t part of this 5-part series, but pair well with it.
