Skip to content

< CollectionsArticle

Effective context engineering.

Effective context engineering for AI agents

Anthropic · 2025

Read the article (opens in a new tab)

Context is a finite budget. Find the smallest set of high-signal tokens that gets the outcome.

6 sections · 9 problems · 1 project

0 of 10 done

Start Next: 01 Stay Under the Token Budget

Fig. 1. Every turn pours more history into the window. Left alone it spills over the rim; compacted, the oldest turns press into a summary.

Section 01

Context is finite

0 of 2

The article: Models lose focus as the context grows, so every token has a cost.

  1. 01Stay Under the Token Budgetoptimize · medium
  2. 02Put the Answer Where the Model Will Read Itimplement · medium

Section 02

Examples

0 of 1

The article: A few diverse, canonical examples work better than a list of every edge case.

  1. 03Pick the Examples That Fit the Questionimplement · medium

Section 03

Tools

0 of 1

The article: Keep the tool set small and unambiguous; a bloated one confuses the agent.

  1. 04Offer Only the Tools This Request Needsimplement · medium

Section 04

Just in time

0 of 2

The article: Hold light references and load the data at run time with tools, the way a person uses a file system.

  1. 05Hand Retrieval to the Model as a Toolimplement · medium
  2. 06Answer From a Repo That Does Not Fitimplement · hard

Section 05

Long-horizon tasks

0 of 3

The article: Compaction, notes kept outside the window and sub-agents keep a long task inside it.

  1. 07Compact a Long Conversation Without Losing the Decisionimplement · medium
  2. 08Remember What Mattersimplement · medium
  3. 09Hand Off Only What the Next Agent Needsimplement · easy

Section 06

Build it

0 of 1

Beyond the article: Make the prompt earn its tokens, measured on a real model.

  1. 10context-ladderproject
All collections