Level 8Lesson 65โฑ๏ธ 40 min

From Wording to Wiring

Prompt engineering is about one sentence. Context engineering is about the whole pipeline that decides everything the model sees

The One-Line Shift

For a couple of years, the skill everyone chased was prompt engineering - finding the perfect wording for your request. That still matters, but it turns out to be a small slice of the real work. The bigger skill now has a name: context engineering.

The whole level in one sentence: context engineering is deliberately designing everything the model sees on each turn - not just your prompt, but the tools, the documents it pulled in, the conversation so far, and what it remembers. The field sums it up as "from wording to wiring."

What "Context" Actually Means

When an AI model answers, it doesn't see your screen or your project - it only sees a block of text called the context window. Everything it knows in that moment had to be put into that window. That includes a lot more than your message:

Everything that lands in the context window:

  โ€ข System prompt   - the standing instructions / role
  โ€ข Your message    - what you just asked
  โ€ข Tool definitions- the list of actions it's allowed to take
  โ€ข Retrieved docs  - files, search results, database rows pulled in
  โ€ข Message history - the whole back-and-forth so far
  โ€ข Memory          - notes it saved from earlier or past sessions
  โ€ข Output rules    - the format you want back

Prompt engineering only touches one of those lines (your message). Context engineering is responsible for all of them, on every turn.

A Picture: The Desk, the Backpack, the Filing Cabinet

Imagine the model is a smart worker solving a problem at a desk:

The desk = the context window

Only so much fits on it. Whatever is on the desk is what the worker can use right now. Pile too much on and they can't find anything.

The backpack = retrieval

Stuff nearby they can grab and put on the desk when needed - files, notes, search results. The skill is grabbing the right thing, not dumping the whole bag out.

The filing cabinet = long-term memory

Things saved from past sessions. Not on the desk by default, but retrievable when relevant.

Context engineering is desk management. It's deciding what goes on the desk, when to grab something from the backpack, what to file away, and what to clear off to make room. That's the entire job.

Prompt Engineering vs. Context Engineering

They aren't rivals - one lives inside the other. Here's the honest comparison:

                  PROMPT ENGINEERING      CONTEXT ENGINEERING
  Scope            one instruction         the whole set of tokens
  Covers           your message            instructions + docs + memory
                                            + tools + history + format
  State            single-turn             multi-turn, runs for hours
  You optimize     better phrasing         higher signal-to-noise
  Failure looks    "it misread me"         "it had the wrong info"
  The tell         you reword              you re-wire
The clearest test (from Sourcegraph's guide): if your improvement comes from swapping words around, you're prompt engineering. If it comes from changing what data the agent pulls in, in what order, and what gets thrown away, you're context engineering. Wording vs. wiring.

Why This Became the Skill of 2026

Two things happened. First, agents stopped being chatbots. A chatbot answers one question with whatever fits in one turn. An agent runs in a loop (you saw this in Level 7), using tools and gathering state, and it has to make a smart decision at step 47 with the leftovers of steps 1-46 cluttering its desk.

Second, teams discovered where agents actually fail. As Sourcegraph put it: a coding agent asked to fix a bug usually doesn't fail because the model can't reason. It fails because a search returned 4,000 results, the agent filled its desk with junk, and the one fact that mattered never made it on. Most production failures are context failures, not model failures.

Anthropic's framing: "Building with language models is becoming less about finding the right words for your prompts, and more about answering the broader question: what configuration of context is most likely to generate the desired behavior?"

Where We're Headed in This Level

The discipline organizes into four pillars - Instructions, Retrieval, Memory, and Tools - plus the pipeline that assembles and prunes them each turn. That's the map for the next seven lessons:

66  The attention budget - why the desk is small (the core constraint)
67  Pillar 1: Instructions - what the model knows before it starts
68  Pillar 2: Retrieval    - how outside facts get onto the desk
69  Pillar 3: Memory       - short-term + long-term remembering
70  Pillar 4: Tools         - the actions it can take
71  Assembling it all      - the pipeline that picks and prunes
72  When it goes wrong     - the failure modes and their fixes

Hands-On: Inventory a Real Context Window

Hands-on (15 min): Open any AI assistant you use and start a fresh chat. Now list everything that's already on its "desk" before you even type: its system instructions (its role), any tools it has, any files or memory it carries. Then ask it one question and notice what got added to the desk (your message, maybe a search result). You're learning to see the context window - and you can't engineer what you can't see. Keep this habit; it's the foundation of everything that follows.
Lesson 65 Quick Reference
Context engineering

Deliberately designing everything the model sees each turn - instructions, tools, retrieved docs, history, memory, output rules

Context window

The block of text the model actually sees; if it is not in there, the model does not know it

From wording to wiring

Prompt engineering tweaks the message; context engineering designs the whole pipeline around it

Desk / backpack / cabinet

The window (desk) is small; retrieval (backpack) and long-term memory (cabinet) feed it on demand

The tell

Rewording = prompt engineering; changing what data is fetched/ordered/discarded = context engineering

Most failures are context failures

Agents usually fail from wrong/too much/missing context, not a weak model

โ† Level 7 Capstone
Unlocks in ~10 min of reading