Aionda

2025-10-28

This post was written on Oct 28, 2025.

Models/pricing/policies may have changed. Check the latest anthropic posts.

Claude Context Editing: Performing Surgery on AI Memory

Does AI get slower and dumber as the conversation gets longer? Claude's Context Editing and Thinking Block Clearing features automatically delete unnecessary memories to maintain performance.

Claude Context Editing: Performing Surgery on AI Memory

The 'context window exceeded' error has been a chronic problem in long conversations or complex agent tasks using LLMs. (Problem) Anthropic elegantly solved this problem with Context Editing and Thinking Block Clearing features. (Solution) This is a technology that allows AI to 'forget' completed thinking processes or old tool usage records in the middle of a conversation, just like humans organize unnecessary short-term memories while sleeping. (Evidence)

Core Feature: Thinking Block Clearing

What is it?

The vast amount of 'Thinking Blocks' generated by Claude models (especially Opus/Sonnet 4.5) when solving complex problems are one-time consumables. If this thought process remains in the context even after the problem is solved, it occupies unnecessary tokens. Turning on the clear_thinking_20251015 option makes the AI automatically delete the intermediate thought process from the context after reaching a conclusion.

Context Editing Strategies

  1. Delete Old Tool Results: If dozens of web search results are piled up, keep only the most recent results and summarize or delete previous data.
  2. Client-side Compaction: At the SDK level, if the conversation gets long, it is automatically replaced with a summary before transmission.

Benefits

  • Cost Reduction: Input token count decreases, reducing API costs.
  • Performance Maintenance: Since the context is kept clean, the AI remembers initial instructions well and reacts smartly even in the later parts of the conversation.
Share this article:

Get updates

A weekly digest of what actually matters.

Found an issue? Report a correction so we can review and update the post.