What is context engineering? How it differs from prompt engineering

Context engineering is the practice of choosing and maintaining the information an AI model sees at each step: instructions, tools, retrieved data and message history. Prompt engineering is about writing good instructions. Context engineering is broader, because agents run many turns and must decide what stays in the window.

What context engineering is

A model can only use what is in its context window, the text it reads on each request. Anthropic's engineering team defines context engineering as curating and maintaining the best set of tokens during model use. That covers system instructions, tool definitions, external data and the message history, not just the prompt you typed.

The reason it matters is that the window is limited and every extra token competes for attention. An agent that reads long logs and whole files can fill the window with material that no longer helps. Context engineering is deciding what to load, what to keep, what to drop and where to store the rest.

How it differs from prompt engineering

Prompt engineering focuses on writing and organizing instructions, mostly for a single task, such as a clear system prompt. Anthropic describes context engineering as the natural next step as people move from single-turn tasks to agents that run over many turns.

A simple way to see it: a prompt is one input you write once. Context is the whole state the model sees, and it changes at every step as tools return results and messages pile up. You write a prompt. You manage context.

Four practical techniques

Anthropic names these techniques for long-running agents.

A small example

Say an agent is migrating a codebase. A naive run reads every file into the window and runs out of room halfway. A context-engineered run keeps a short plan in a notes file, loads one file at a time, hands the log analysis to a sub-agent that returns three lines, and compacts when the window is almost full. Each step sees what it needs, not everything that ever happened.

Limits and common mistakes

Context engineering with several agents

When more than one agent works on a project, each has its own window. Without a shared place, every agent repeats the same discovery and the notes of one are invisible to the others. A shared notes store solves the biggest part of the problem: one agent saves what it learned, and the others read it just in time, rather than each loading the same background.

What NodePress is (and is not)

NodePress is software that gives the AI agents you already use one shared place, called a node, with a shared thread, a shared memory, and the files and context you choose. An agent joins with one pasted line through the remote MCP server at https://nodepress.ai/mcp, and the node runs on your own computer.

It is not a model and it does not decide what belongs in an agent's window. It holds the notes several agents can read, and every step is written to one readable thread.

Do it with a NodePress node

  1. Name a node on nodepress.ai. It runs on your own computer, and the first node needs no sign-up.
  2. Paste the one line into each agent so they share the same node.
  3. Ask the first agent to write a short plan and key decisions into the node's memory.
  4. Ask other agents to read the notes first, then load only the files they need.
  5. Check the thread to see what was saved and clear out notes that are no longer true.

For a short one-off task that fits easily in one window, plain good prompting is enough. A shared node helps when work runs long or involves several agents.

Questions people ask

What is context engineering?

Choosing and maintaining the information an AI model sees at each step: instructions, tools, retrieved data and message history.

What is the difference between prompt engineering and context engineering?

Prompt engineering is writing good instructions, usually for one task. Context engineering manages everything in the window across many turns, as an agent works.

What is compaction in AI agents?

Summarizing a long conversation when the window is nearly full and continuing in a new window that starts with the summary.

Why does an AI agent lose context?

The window has a size limit, and a new session starts empty. Anything not saved outside the window is lost.

How do I give several agents the same context?

Put the shared notes in one place all of them can read, such as a shared memory behind an MCP server, and have each agent load only what it needs.

Related

Sources

NodePress gives your AI agents one shared place on your own computer. Free to start, no sign-up. Make your first node.