Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

context-editing changedbuild-with-claude/context-editing

Nearest release: v2.1.330, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+33added
Lines−33removed
From line 50 where the diff opens
First seen 14 Aug 2026 this site's first read of the page
Recorded edits31to this page, all time

The whole hunk

from line 50, old and new numbered
/
lines
from line 50
5050* **Thinking block clearing:** For managing thinking blocks from earlier turns, with options to preserve recent thinking for context continuity
5151* **Client-side SDK compaction:** An SDK-based alternative for summary-based context management (server-side compaction is generally preferred)
5252 
53| Approach | Where it runs | Strategies | How it works |
54| --------------- | ------------- | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55| **Server-side** | API | Tool result clearing (`clear_tool_uses_20250919`)<br />Thinking block clearing (`clear_thinking_20251015`) | Applied before the prompt reaches Claude. Clears specific content from conversation history. Each strategy can be configured independently. |
56| **Client-side** | SDK | Compaction | Available in [TypeScript and Ruby SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) when using [`tool_runner`](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner). Generates a summary and replaces full conversation history. See [Client-side compaction](https://platform.claude.com/docs/en/build-with-claude/context-editing#client-side-compaction-sdk). |
53| Approach | Where it runs | Strategies | How it works |
54| ----- | ----- | ----- | ----- |
55| **Server-side** | API | Tool result clearing (`clear_tool_uses_20250919`)<br />Thinking block clearing (`clear_thinking_20251015`) | Applied before the prompt reaches Claude. Clears specific content from conversation history. Each strategy can be configured independently. |
56| **Client-side** | SDK | Compaction | Available in [TypeScript and Ruby SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) when using [`tool_runner`](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-runner). Generates a summary and replaces full conversation history. See [Client-side compaction](https://platform.claude.com/docs/en/build-with-claude/context-editing#client-side-compaction-sdk). |
5757 
5858## Server-side strategies
5959 
from line 76
7676<Tip>
7777 **Default behavior:** When a request doesn’t include the `clear_thinking_20251015` strategy, the default varies by model class.
7878 
79 | Model class | Keep all prior thinking | Keep thinking only for the turn in progress |
80 | ---------------- | --------------------------- | ------------------------------------------- |
81 | Opus | Claude Opus 4.5 and later | Claude Opus 4.1 and earlier |
82 | Sonnet | Claude Sonnet 4.6 and later | Claude Sonnet 4.5 (deprecated) and earlier |
83 | Haiku | Claude Haiku 5.5 and later | Claude Haiku 4.5 and earlier |
84 | Fable and Mythos | All models | (none) |
79 | Model class | Keep all prior thinking | Keep thinking only for the turn in progress |
80 | ----- | ----- | ----- |
81 | Opus | Claude Opus 4.5 and later | Claude Opus 4.1 and earlier |
82 | Sonnet | Claude Sonnet 4.6 and later | Claude Sonnet 4.5 (deprecated) and earlier |
83 | Haiku | Claude Haiku 5.5 and later | Claude Haiku 4.5 and earlier |
84 | Fable and Mythos | All models | (none) |
8585 
8686 Use this strategy to override the default. If your code runs across multiple model classes, include this strategy and set `keep` explicitly rather than relying on the per-model default.
8787</Tip>
from line 949
949949 
950950The `clear_thinking_20251015` strategy supports the following configuration:
951951 
952| Configuration option | Default | Description |
953| -------------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
954| `keep` | `{type: "thinking_turns", value: 1}` | Defines how many recent assistant turns keep their thinking blocks. Use `{type: "thinking_turns", value: N}` where N must be > 0 to keep the last N turns, or `"all"` to keep all thinking blocks. |
952| Configuration option | Default | Description |
953| ----- | ----- | ----- |
954| `keep` | `{type: "thinking_turns", value: 1}` | Defines how many recent assistant turns keep their thinking blocks. Use `{type: "thinking_turns", value: N}` where N must be > 0 to keep the last N turns, or `"all"` to keep all thinking blocks. |
955955 
956956A request that includes this strategy without `keep` gets `{type: "thinking_turns", value: 1}` on every model, including models whose [per-model default](https://platform.claude.com/docs/en/build-with-claude/context-editing#thinking-block-clearing) keeps all thinking. A request without this strategy gets the per-model default.
957957 
from line 1759
17591759 
17601760## Configuration options for tool result clearing
17611761 
1762| Configuration option | Default | Description |
1763| -------------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1764| `trigger` | 100,000 input tokens | Defines when the context editing strategy activates. Once the prompt exceeds this threshold, clearing starts. You can specify this value in either `input_tokens` or `tool_uses`. |
1765| `keep` | 3 tool uses | Defines how many recent tool use/result pairs to keep after clearing occurs. The API removes the oldest tool interactions first, preserving the most recent ones. |
1766| `clear_at_least` | None | Ensures a minimum number of tokens is cleared each time the strategy activates. If the API can’t clear at least the specified amount, the strategy isn’t applied. This helps determine whether context clearing is worth breaking your prompt cache. |
1767| `exclude_tools` | None | List of tool names whose tool uses and results should never be cleared. Useful for preserving important context. |
1768| `clear_tool_inputs` | `false` | Controls whether the tool call parameters are cleared along with the tool results. By default, only the tool results are cleared while keeping Claude’s original tool calls visible. |
1762| Configuration option | Default | Description |
1763| ----- | ----- | ----- |
1764| `trigger` | 100,000 input tokens | Defines when the context editing strategy activates. Once the prompt exceeds this threshold, clearing starts. You can specify this value in either `input_tokens` or `tool_uses`. |
1765| `keep` | 3 tool uses | Defines how many recent tool use/result pairs to keep after clearing occurs. The API removes the oldest tool interactions first, preserving the most recent ones. |
1766| `clear_at_least` | None | Ensures a minimum number of tokens is cleared each time the strategy activates. If the API can’t clear at least the specified amount, the strategy isn’t applied. This helps determine whether context clearing is worth breaking your prompt cache. |
1767| `exclude_tools` | None | List of tool names whose tool uses and results should never be cleared. Useful for preserving important context. |
1768| `clear_tool_inputs` | `false` | Controls whether the tool call parameters are cleared along with the tool results. By default, only the tool results are cleared while keeping Claude’s original tool calls visible. |
17691769 
17701770## Context editing response
17711771 
from line 2486
24862486 
24872487### Configuration options
24882488 
2489| Parameter | Type | Required | Default | Description |
2490| ------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
2491| `enabled` | boolean | Yes | - | Whether to enable automatic compaction |
2492| `context_token_threshold` | number | No | 100,000 | Token count at which compaction triggers |
2493| `model` | string | No | Same as main model | Model to use for generating summaries |
2494| `summary_prompt` | string | No | See [Default summary prompt](https://platform.claude.com/docs/en/build-with-claude/context-editing#default-summary-prompt) | Custom prompt for summary generation |
2489| Parameter | Type | Required | Default | Description |
2490| ----- | ----- | ----- | ----- | ----- |
2491| `enabled` | boolean | Yes | - | Whether to enable automatic compaction |
2492| `context_token_threshold` | number | No | 100,000 | Token count at which compaction triggers |
2493| `model` | string | No | Same as main model | Model to use for generating summaries |
2494| `summary_prompt` | string | No | See [Default summary prompt](https://platform.claude.com/docs/en/build-with-claude/context-editing#default-summary-prompt) | Custom prompt for summary generation |
24952495 
24962496#### Choosing a token threshold
24972497 
from line 2983
29832983 
29842984* Availability: Available
29852985 
2986| Status | Cloud platforms |
2987| ------ | ----------------------- |
2988| Beta | All supported platforms |
2986| Status | Cloud platforms |
2987| ----- | ----- |
2988| Beta | All supported platforms |
29892989 
29902990### Required beta headers
29912991 
from line 2999
29992999 
30003000[Data handling overview](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#feature-eligibility)
30013001 
3002| Item | Zero data retention | HIPAA |
3003| ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
3004| Status | Eligible (excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)) | Not eligible |
3005| Details | Context edits (tool use clearing and thinking clearing) are applied in real time. | — |
3002| Item | Zero data retention | HIPAA |
3003| ----- | ----- | ----- |
3004| Status | Eligible (excludes [Covered Models](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention#model-specific-data-retention-requirements)) | Not eligible |
3005| Details | Context edits (tool use clearing and thinking clearing) are applied in real time. | — |
30063006 
30073007Applicable endpoints:
30083008 
Feedback