Context Editing

Control how old tool results and eligible reasoning blocks are retained as a conversation approaches its context limits.

Choose a sensible clearing rule

Tool-result clearing can activate after a configured input-token or tool-use threshold while keeping a specified number of recent operations. Thinking-block handling has its own configuration and model constraints. Choose a rule based on which results the next step genuinely needs.

Preserve decisions outside the cleared history

Run a fixture that calls several tools and then asks about one early decision. Store the decision and its source reference in durable state before clearing older results. Compare accuracy and usage with the unchanged baseline and adjust retention for operations whose results are expensive to retrieve again.

Source documentation

Official Claude documentation