context_usage
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| ContextUsageAgent clawd_code_sdk.models.context_usage An agent contributing to context usage. |
||
| ContextUsageAttachmentBreakdown clawd_code_sdk.models.context_usage Token breakdown for a specific attachment type. |
||
| ContextUsageCategory clawd_code_sdk.models.context_usage A single category in the context usage breakdown. |
||
| ContextUsageDeferredBuiltinTool clawd_code_sdk.models.context_usage A deferred builtin tool contributing to context usage. |
||
| ContextUsageGridCell clawd_code_sdk.models.context_usage A single cell in the context usage grid visualization. |
||
| ContextUsageMcpInstructions clawd_code_sdk.models.context_usage MCP server instructions contributing to context usage. |
||
| ContextUsageMcpTool clawd_code_sdk.models.context_usage An MCP tool contributing to context usage. |
||
| ContextUsageMemoryFile clawd_code_sdk.models.context_usage A memory file contributing to context usage. |
||
| ContextUsageMessageBreakdown clawd_code_sdk.models.context_usage Breakdown of message tokens by category. |
||
| ContextUsageSkillFrontmatter clawd_code_sdk.models.context_usage A single skill's frontmatter contributing to context usage. |
||
| ContextUsageSkills clawd_code_sdk.models.context_usage Skills context usage summary. |
||
| ContextUsageSlashCommands clawd_code_sdk.models.context_usage Slash commands context usage summary. |
||
| ContextUsageSystemPromptSection clawd_code_sdk.models.context_usage A system prompt section contributing to context usage. |
||
| ContextUsageSystemTool clawd_code_sdk.models.context_usage A system tool contributing to context usage. |
||
| ContextUsageToolCallBreakdown clawd_code_sdk.models.context_usage Token breakdown for a specific tool call type. |
||
| ModelScopedUsageWindow clawd_code_sdk.models.context_usage Per-model weekly window. |
||
| SDKContextUsage clawd_code_sdk.models.context_usage Compact context usage snapshot, attached to assistant messages. |
||
| SDKContextUsageAgent clawd_code_sdk.models.context_usage Agent entry in the compact context usage snapshot. |
||
| SDKContextUsageCategory clawd_code_sdk.models.context_usage A category in the compact context usage snapshot. |
||
| SDKContextUsageMcpTool clawd_code_sdk.models.context_usage MCP tool entry in the compact context usage snapshot. |
||
| SDKContextUsageMemoryFile clawd_code_sdk.models.context_usage Memory file entry in the compact context usage snapshot. |
||
| SDKContextUsageOverLimit clawd_code_sdk.models.context_usage How far the context is over its limit. |
||
| SDKContextUsageSkill clawd_code_sdk.models.context_usage Skill entry in the compact context usage snapshot. |
||
| SDKControlGetContextUsageResponse clawd_code_sdk.models.context_usage Breakdown of current context window usage by category. |
||
| SDKUsageReport clawd_code_sdk.models.context_usage Session usage report (same data as /usage). |
||
| UsageMoney clawd_code_sdk.models.context_usage An amount in minor units (amount_minor / 10**exponent in currency). |
||
| UsageRateLimits clawd_code_sdk.models.context_usage Plan rate-limit windows from the claude.ai usage endpoint. |
||
| UsageReportDisplayName clawd_code_sdk.models.context_usage Wrapper holding a display name. |
||
| UsageReportExtraUsage clawd_code_sdk.models.context_usage Extra (overage) usage state. |
||
| UsageReportLimit clawd_code_sdk.models.context_usage A single rate limit entry. |
||
| UsageReportLimitScope clawd_code_sdk.models.context_usage Scope of a rate limit. |
||
| UsageReportRateLimits clawd_code_sdk.models.context_usage Rate limit state. |
||
| UsageReportSession clawd_code_sdk.models.context_usage Session-level cost/usage totals. |
||
| UsageSpend clawd_code_sdk.models.context_usage Usage-credit spend beyond the plan windows (undocumented, server-defined). |
||
| UsageWindow clawd_code_sdk.models.context_usage Utilization of one plan rate-limit window. |
🛈 DocStrings¶
Context window usage breakdown models.
ContextUsageAgent
¶
Bases: ClaudeCodeBaseModel
An agent contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageAttachmentBreakdown
¶
ContextUsageCategory
¶
Bases: ClaudeCodeBaseModel
A single category in the context usage breakdown.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageDeferredBuiltinTool
¶
Bases: ClaudeCodeBaseModel
A deferred builtin tool contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageGridCell
¶
Bases: ClaudeCodeBaseModel
A single cell in the context usage grid visualization.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageMcpInstructions
¶
ContextUsageMcpTool
¶
Bases: ClaudeCodeBaseModel
An MCP tool contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageMemoryFile
¶
ContextUsageMessageBreakdown
¶
Bases: ClaudeCodeBaseModel
Breakdown of message tokens by category.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSkillFrontmatter
¶
Bases: ClaudeCodeBaseModel
A single skill's frontmatter contributing to context usage.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSkills
¶
Bases: ClaudeCodeBaseModel
Skills context usage summary.
Source code in src/clawd_code_sdk/models/context_usage.py
ContextUsageSlashCommands
¶
ContextUsageSystemPromptSection
¶
ContextUsageSystemTool
¶
ContextUsageToolCallBreakdown
¶
Bases: ClaudeCodeBaseModel
Token breakdown for a specific tool call type.
Source code in src/clawd_code_sdk/models/context_usage.py
ModelScopedUsageWindow
¶
Bases: UsageWindow
Per-model weekly window.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsage
¶
Bases: ClaudeCodeBaseModel
Compact context usage snapshot, attached to assistant messages.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageAgent
¶
Bases: ClaudeCodeBaseModel
Agent entry in the compact context usage snapshot.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageCategory
¶
Bases: ClaudeCodeBaseModel
A category in the compact context usage snapshot.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageMcpTool
¶
Bases: ClaudeCodeBaseModel
MCP tool entry in the compact context usage snapshot.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageMemoryFile
¶
Bases: ClaudeCodeBaseModel
Memory file entry in the compact context usage snapshot.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageOverLimit
¶
Bases: ClaudeCodeBaseModel
How far the context is over its limit.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKContextUsageSkill
¶
Bases: ClaudeCodeBaseModel
Skill entry in the compact context usage snapshot.
Source code in src/clawd_code_sdk/models/context_usage.py
SDKControlGetContextUsageResponse
¶
Bases: ClaudeCodeBaseModel
Breakdown of current context window usage by category.
Source code in src/clawd_code_sdk/models/context_usage.py
autocompact_source
class-attribute
instance-attribute
¶
Where the auto-compact threshold came from, e.g. "model-default" (undocumented).
SDKUsageReport
¶
Bases: ClaudeCodeBaseModel
Session usage report (same data as /usage).
Source code in src/clawd_code_sdk/models/context_usage.py
UsageMoney
¶
Bases: ClaudeCodeBaseModel
An amount in minor units (amount_minor / 10**exponent in currency).
Source code in src/clawd_code_sdk/models/context_usage.py
UsageRateLimits
¶
Bases: ClaudeCodeBaseModel
Plan rate-limit windows from the claude.ai usage endpoint.
Only the fields documented by the TypeScript SDK are modelled; the endpoint carries many experimental extras, which are ignored.
Source code in src/clawd_code_sdk/models/context_usage.py
limits
class-attribute
instance-attribute
¶
limits: list[UsageReportLimit] | None = None
The server's usage rows, in the server's order (render verbatim).
model_scoped
class-attribute
instance-attribute
¶
model_scoped: list[ModelScopedUsageWindow] | None = None
Per-model weekly windows (absent when unknown, empty when there are none).
spend
class-attribute
instance-attribute
¶
spend: UsageSpend | None = None
Usage-credit spend (not documented by the TypeScript SDK; may change).
UsageReportDisplayName
¶
UsageReportExtraUsage
¶
Bases: ClaudeCodeBaseModel
Extra (overage) usage state.
Passed through from the claude.ai usage endpoint, which adds fields freely; unknown fields are ignored even in strict (test) mode.
Source code in src/clawd_code_sdk/models/context_usage.py
UsageReportLimit
¶
Bases: ClaudeCodeBaseModel
A single rate limit entry.
Source code in src/clawd_code_sdk/models/context_usage.py
UsageReportLimitScope
¶
UsageReportRateLimits
¶
UsageReportSession
¶
Bases: ClaudeCodeBaseModel
Session-level cost/usage totals.
Source code in src/clawd_code_sdk/models/context_usage.py
UsageSpend
¶
Bases: ClaudeCodeBaseModel
Usage-credit spend beyond the plan windows (undocumented, server-defined).
Source code in src/clawd_code_sdk/models/context_usage.py
percent
class-attribute
instance-attribute
¶
Share of the spend limit used, 0-100.
UsageWindow
¶
Bases: ClaudeCodeBaseModel
Utilization of one plan rate-limit window.