CompactionControl Class — anthropic-sdk-python Architecture
Architecture documentation for the CompactionControl class in _beta_compaction_control.py from the anthropic-sdk-python codebase.
Entity Profile
Dependency Diagram
graph TD 2aaf0253_b31f_0636_fbc1_eac8017be6f5["CompactionControl"] af98aab0_f1fc_18e5_6340_25ca580ef0d0["_beta_compaction_control.py"] 2aaf0253_b31f_0636_fbc1_eac8017be6f5 -->|defined in| af98aab0_f1fc_18e5_6340_25ca580ef0d0
Relationship Graph
Source Code
src/anthropic/lib/tools/_beta_compaction_control.py lines 31–48
class CompactionControl(TypedDict, total=False):
context_token_threshold: int
"""The context token threshold at which to trigger compaction.
When the cumulative token count (input + output) across all messages exceeds this threshold,
the message history will be automatically summarized and compressed. Defaults to 100,000 tokens.
"""
model: str
"""
The model to use for generating the compaction summary.
If not specified, defaults to the same model used for the tool runner.
"""
summary_prompt: str
"""The prompt used to instruct the model on how to generate the summary."""
enabled: Required[bool]
Domain
Source
Frequently Asked Questions
What is the CompactionControl class?
CompactionControl is a class in the anthropic-sdk-python codebase, defined in src/anthropic/lib/tools/_beta_compaction_control.py.
Where is CompactionControl defined?
CompactionControl is defined in src/anthropic/lib/tools/_beta_compaction_control.py at line 31.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free