010 Coding Collective

010 Coding Collective

What is context engineering? A guide for people working with AI agents

Context engineering decides what a language model sees at each step: instructions, files, tools and memory. What it is, why it matters more than your prompt once you work with AI agents, and how to do it in practice.

AI LLMs Context Engineering Prompt Engineering AI Agents Claude Code Codex MCP RAG Software Development

A clever prompt no longer cuts it

An AI agent can work on its own for an hour and read dozens of files along the way. What the model does then depends less on your first instruction than on everything that piles up in its context window during that time.

Choosing what the model sees

Context engineering treats the context window as a small workbench. At every step you choose which instructions, files, tools and earlier results sit on it, and you clear away what no longer matters.

Less wandering, better code

An agent with the right context makes fewer mistakes, repeats itself less and sticks to your project's conventions. That saves review time and rounds of corrections.

The short answer

Context engineering is deciding what a language model gets to see at each step. Not just your question, but everything in the context window: the instructions, the files it has read, the tools it can call, the results of earlier steps and whatever it remembers from previous work.

A model knows nothing outside that window. What isn’t in it doesn’t exist for the model. What is in it but isn’t relevant pulls its attention away. Context engineering is the craft of making that selection.

The term caught on in mid-2025, when Shopify CEO Tobi Lütke and AI researcher Andrej Karpathy, among others, used it as a better name for what prompt engineering had turned into in practice. It has since become the usual name for designing what an AI agent sees.

Why your prompt is no longer the main character

With a chatbot you ask one question and get one answer. The prompt is almost the entire context, so it pays to word it well. That’s what prompt engineering is about.

A coding agent like Claude Code or Codex works differently. It takes dozens of steps in a row: searching files, reading them, editing, running tests, reading errors, trying again. Every step adds text to the context window. Half an hour in, your original instruction is a small part of what the model sees.

Two things then go wrong:

1

The window fills up

Even a window of hundreds of thousands of tokens fills up on a large codebase. Something has to go, and when the agent drops things blindly, sometimes the one line that mattered goes with it.

2

More context doesn't make the model smarter

The more the window holds, the worse a model gets at finding the right details. Researchers call this context rot: old error messages, abandoned approaches and irrelevant files pull attention away from what counts now.

Context engineering tackles both. The goal isn’t as much context as possible, but the smallest set of information that lets the model take the next step well.

What sits in the context window

To design context, you need to know what it’s made of. For a coding agent there are roughly six layers.

1

System instructions

The tool's own fixed instructions: who the agent is, how it uses tools, what it may not do. As a user you have little say over these.

2

Project instructions

A file in your repo, such as CLAUDE.md or AGENTS.md, that loads into every session. It holds your conventions, your architecture and the commands to build and test.

3

The task and the conversation

What you ask and everything that goes back and forth after that. This grows fastest and gets cluttered first.

4

Files read and tool output

The code the agent opened, the output of tests and commands, search results. Often the largest part of the window.

5

Tools and their descriptions

Every available tool, MCP ones included, takes up space with its description. Twenty integrations you don't use are twenty sources of noise.

6

Retrieved knowledge and memory

Documentation pulled in through search or RAG, notes from earlier sessions, a summary of what's already done.

Only the first layer is fixed. You can steer the other five, and that’s where the work is. How tools come in through MCP and how knowledge gets retrieved with RAG each have their own explainer.

Four techniques that work in practice

Most approaches come down to four moves. Good agents do some of them on their own, but if you know them you can use them on purpose.

1

Select: only what's needed

Let the agent search and read selectively instead of loading whole folders. Keep the instructions file short and point to separate documents for detail. Switch off MCP integrations this task doesn't need.

2

Summarize: boil down old work

When a session runs long, summarize what was decided and done, then start clean. Claude Code does this with compaction. A fresh session with a good summary often beats a full session that keeps going.

3

Write down: memory outside the window

A plan, a task list or notes in a file survive every summary. The agent reads them back when it needs to, instead of holding everything in its head.

4

Isolate: hand off subtasks

A subagent investigates something in its own clean window and hands back only the conclusion. That way a search through a hundred files doesn't clutter your main session.

Prompt engineering, context engineering and harness engineering

The three terms often get mixed up. They describe layers that fit inside each other.

Prompt engineering Context engineering Harness engineering
What it's about Wording one instruction well Everything the model sees at each step The whole environment around the agent
Unit One question One step in a session Every session in a project
Typical work Role, examples, desired format Select, summarize, write down, isolate Tests, checks, permissions, feedback loops
When it counts One-off questions to a chatbot Agents that work on their own for a long time Teams that use agents every day

Prompt engineering is part of context engineering: your prompt is one of the things in the window. Context engineering in turn is part of harness engineering, which also handles what happens when the agent gets something wrong. What a harness is exactly, you can read in what is an AI harness.

How a senior team approaches context engineering

Every client repo we work in runs with coding agents. What we’ve learned about context along the way comes down to a few fixed habits.

1

A short, honest instructions file

The instructions file in the repo describes how the project really works: which commands, which conventions, which pitfalls. Not a wish list. Whatever is wrong gets deleted, because an agent follows it to the letter.

2

Small tasks, fresh sessions

One task per session. An agent that fixes a bug, builds a feature and refactors at the same time drags the context of all three into every step.

3

The plan in writing

For bigger work the agent first writes a plan to a file. That plan becomes the task's memory, and a person reads it before any code gets written.

4

Tests as context

A failing test tells an agent exactly what's wrong, in a few lines. That's better context than an explanation in prose, and it works again in every session.

A model can only work with what’s on its workbench. Context engineering is clearing it before you start.

When you can worry about it less

Not every AI task needs this work. For a one-off question to ChatGPT, rewriting a text or explaining a function, the context is small and easy to oversee. A clear question is enough.

A short script of a few hundred lines doesn’t need much design either: the agent reads it all in one go and the window never fills up. Context engineering starts to pay off once an agent works on its own for longer, in a codebase bigger than one window can hold, or in a team where several people point the same agent at the same project.

Conclusion: context is the new programming work

AI agents shift what a developer does. Less typing yourself, more deciding what the agent knows at the moment it makes a call. That isn’t a trick for better prompts but design work: what must always be known, what do you fetch when it’s needed, and what do you clear away.

🧩

What it is

Deciding what a language model sees at each step: instructions, files, tools, earlier results and memory. As little as possible, as much as needed.

🎯

Why it matters

Agents work for a long time and read a lot. Without deliberate choices the window fills with noise, and the model wanders off or forgets what mattered.

Frequently Asked Questions

What is context engineering, in short?

Context engineering is deciding what sits in a language model's context window at each step: which instructions, files, tools, examples and earlier results the model sees. The goal is the smallest set of information that lets the model take the next step well.

What's the difference between prompt engineering and context engineering?

Prompt engineering is about wording one instruction well. Context engineering is about everything the model receives across a whole session: the files it read, tool output, the conversation and memory too. Your prompt is one part of the context.

What is a context window?

The context window is the amount of text a language model can process at once, measured in tokens. Everything the model knows about your task has to fit in it. Whatever falls outside, the model doesn't see.

Isn't a bigger context window simply the answer?

No. A bigger window postpones the problem but doesn't solve it. The more it holds, the worse a model gets at finding the right details. A full session with old errors and abandoned approaches often performs worse than a short, clean one.

What do CLAUDE.md and AGENTS.md have to do with context engineering?

They're instructions files in your repo that a coding agent loads into every session. They're the fixed part of the context: conventions, architecture and commands the model always needs to know. Keeping them short and accurate is one of the most effective forms of context engineering.

How do RAG and MCP relate to context engineering?

Both are ways of bringing context in. RAG looks up relevant documents and puts them in the window. MCP connects an agent to external tools and data sources. Both make the window richer, and both call for choices: what do you fetch, and what do you leave out.

Build faster with AI without lowering the bar?

Our senior developers work with coding agents every day. Bring them onto your project, or have your team learn to use them well in a workshop.

Let's discuss your project

From AI prototypes that need to be production-ready to strategic advice, code audits, or ongoing development support. We're happy to think along about the best approach, no strings attached.

010 Coding Collective free consultation
free

Free Consultation

In 1.5 hours we discuss your project, challenges and goals. Honest advice from senior developers, no sales pitch.

1.5 hours with senior developer(s)
Analysis of your current situation
Written summary afterwards
Concrete next steps