- Claude API now offers new features for managing an AI agent's context, crucial for long-term interactions and complex tasks.
Context editingautomatically clears stale information from thecontext windowwhentoken limitsare approached, keeping the focus on relevant data.- A new
memory toolenables the AI to store and consult information outside the immediatecontext window, facilitating the creation of persistentknowledge bases.
Claude plays Catan: Managing agent context with Sonnet 4.5
- Claude API has introduced
context editingand amemory toolto enhance AI agent context management. Context editingautomatically removes older, less relevanttool callsand their results from the agent'scontext window.- This automatic clearing occurs as the agent approaches its
token limits, ensuring the context remains clean and focused. - The
memory toolprovides a mechanism for the AI to store and retrieve information that persists beyond the currentcontext window. - These capabilities allow AI agents to build and consult a persistent
knowledge baseacross extended interactions, like tracking opponent strategies in a game. - The example of an AI playing Catan demonstrates how these features enable long-term planning and processing of thousands of game events without context overload.
- These new context management features are now available on the Claude Developer platform.
Claude API — A set of services and protocols provided by a cloud platform that allows developers to build applications and interact with its infrastructure.
agent's context — The relevant information an AI agent retains about a conversation or task to understand new inputs and generate coherent responses.
context window — The specific portion of an AI model's input buffer where it processes current information, constrained by token limits.
token limits — The maximum number of tokens (words or sub-word units) an AI model can process in its context window at any given time.
tool calls — Instructions or requests made by an AI agent to external tools or functions to retrieve information or perform actions.
memory tool — A mechanism that allows an AI agent to store and retrieve information outside its immediate context window, enabling long-term memory.
knowledge base — A structured repository of information, facts, and rules that an AI system can consult for reasoning and decision-making.
We're introducing new capabilities for managing your agent's context on the Claude API. Context editing automatically clears stale tool calls and results from within the context window when approaching token limits. And the memory tool enables Claude to store and consult information outside the context window. Let me show you these capabilities in action with something unexpected, a game of Catan. Catan is a strategy board game that requires planning over a long time horizon, sharp negotiation skills and careful observation. Watch as Claude plays against three opponents – Ace, Maven and Scout. Claude is building a knowledge base that persists across games with memory files about each opponent's strategies, like how Maven holds bricks or Ace has a stock pile of wood. As the game progresses, trades, moves, car draws and other events accumulate, eventually overwhelming the context. But context editing automatically removes older, less relevant information. After 75 minutes of play, Claude has processed thousands of game events, yet the context remains clean and focused. These features are now available on the Claude Developer platform.
TL;DR
- Claude API now offers new features for managing an AI agent's context, crucial for long-term interactions and complex tasks.
Context editingautomatically clears stale information from thecontext windowwhentoken limitsare approached, keeping the focus on relevant data.- A new
memory toolenables the AI to store and consult information outside the immediatecontext window, facilitating the creation of persistentknowledge bases.
Takeaways
- Claude API has introduced
context editingand amemory toolto enhance AI agent context management. Context editingautomatically removes older, less relevanttool callsand their results from the agent'scontext window.- This automatic clearing occurs as the agent approaches its
token limits, ensuring the context remains clean and focused. - The
memory toolprovides a mechanism for the AI to store and retrieve information that persists beyond the currentcontext window. - These capabilities allow AI agents to build and consult a persistent
knowledge baseacross extended interactions, like tracking opponent strategies in a game. - The example of an AI playing Catan demonstrates how these features enable long-term planning and processing of thousands of game events without context overload.
- These new context management features are now available on the Claude Developer platform.
Vocabulary
Claude API — A set of services and protocols provided by a cloud platform that allows developers to build applications and interact with its infrastructure.
agent's context — The relevant information an AI agent retains about a conversation or task to understand new inputs and generate coherent responses.
context window — The specific portion of an AI model's input buffer where it processes current information, constrained by token limits.
token limits — The maximum number of tokens (words or sub-word units) an AI model can process in its context window at any given time.
tool calls — Instructions or requests made by an AI agent to external tools or functions to retrieve information or perform actions.
memory tool — A mechanism that allows an AI agent to store and retrieve information outside its immediate context window, enabling long-term memory.
knowledge base — A structured repository of information, facts, and rules that an AI system can consult for reasoning and decision-making.
Transcript
We're introducing new capabilities for managing your agent's context on the Claude API. Context editing automatically clears stale tool calls and results from within the context window when approaching token limits. And the memory tool enables Claude to store and consult information outside the context window. Let me show you these capabilities in action with something unexpected, a game of Catan. Catan is a strategy board game that requires planning over a long time horizon, sharp negotiation skills and careful observation. Watch as Claude plays against three opponents – Ace, Maven and Scout. Claude is building a knowledge base that persists across games with memory files about each opponent's strategies, like how Maven holds bricks or Ace has a stock pile of wood. As the game progresses, trades, moves, car draws and other events accumulate, eventually overwhelming the context. But context editing automatically removes older, less relevant information. After 75 minutes of play, Claude has processed thousands of game events, yet the context remains clean and focused. These features are now available on the Claude Developer platform.