Anthropic Adds Context Editing and File-Based Memory to Claude

Anthropic's Claude platform adds context editing and a file-based memory tool to extend agent context and persist knowledge across sessions. Combined, the features delivered up to 39% performance gains in internal tests.

Anthropic Adds Context Editing and File-Based Memory to Claude

TL;DR

  • Context editing: automatically prunes stale tool outputs and other old content as token limits approach; Sonnet 4.5 tracks available tokens to guide pruning.
  • Memory tool: client-side, file-based CRUD interface for agents; persistence and retention managed by developer infrastructure, accessed via tool calls to offload long-lived knowledge.
  • Measured gains: 39% performance improvement using both features vs baseline; 29% with context editing alone.
  • Token savings and resilience: 100-turn web search test showed workflow completion where context would otherwise fail and an 84% reduction in token consumption.
  • Practical use cases: coding (prune file reads, persist debug notes), research (store findings, expire old search results), data processing (keep intermediates, clear bulky raw data).
  • Availability: public beta on the Claude Developer Platform; also supported on Amazon Bedrock and Google Cloud Vertex AI. Docs and examples: https://docs.claude.com/en/docs/build-with-claude/context-editing https://docs.claude.com/en/docs/agents-and-tools/tool-use/memory-tool https://github.com/anthropics/claude-cookbooks/blob/main/tool_use/memory_cookbook.ipynb

Anthropic adds context editing and a file-based memory tool to Claude Developer Platform

Anthropic introduced two context management capabilities for the Claude Developer Platform alongside Claude Sonnet 4.5: context editing, which prunes stale tool calls and results as token limits approach, and a client-side, file-based memory tool that lets agents persist information outside the immediate context. These additions aim to help agents sustain long-running workflows without losing critical information or hitting context limits.

How context editing works

Context editing automatically removes outdated tool outputs and other stale content from the conversation when token usage approaches the model’s limits, while preserving conversational continuity. The mechanism reduces clutter in the active context so the model focuses on recent, relevant material. Claude Sonnet 4.5 adds built-in context awareness that tracks available tokens throughout a conversation to make pruning decisions more effective.

The memory tool: persistent, client-side storage

The memory tool exposes a file-based interface for agents to create, read, update, and delete files in a dedicated memory directory. Storage and persistence are managed by the developer’s infrastructure, keeping data and retention policies under direct control. Because the tool operates entirely through tool calls, agents can offload larger or longer-lived knowledge than the context window permits, then consult that stored knowledge across sessions.

Measured effects on agent workflows

Internal evaluations reported meaningful gains when combining the two features:

  • 39% performance improvement when using both the memory tool and context editing versus baseline.
  • 29% improvement with context editing alone.
  • In a 100-turn web search test, context editing enabled completion of workflows that would otherwise fail from context exhaustion and reduced token consumption by 84%.

Practical use cases

These capabilities are oriented toward agentic tasks that span extended interactions:

  • Coding: pruning old file reads and test outputs while persisting debugging notes and architectural decisions to memory for later reference.
  • Research: preserving key findings in memory while expiring outdated search results from active context.
  • Data processing: storing intermediate results persistently and clearing bulky raw data from context to keep pipelines within token budgets.

Availability and resources

The context management features are available in public beta on the Claude Developer Platform, and are also supported in Amazon Bedrock and Google Cloud’s Vertex AI. Documentation and examples are available for developers:

Original source: https://www.anthropic.com/news/context-management

Continue the conversation on Slack

Did this article spark your interest? Join our community of experts and enthusiasts to dive deeper, ask questions, and share your ideas.

Join our community