Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/claude_agent_sdk/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
PermissionMode = Literal["default", "acceptEdits", "plan", "bypassPermissions"]

# SDK Beta features - see https://docs.anthropic.com/en/api/beta-headers
SdkBeta = Literal["context-1m-2025-08-07"]
SdkBeta = Literal[
"context-1m-2025-08-07", # Extended 1M context window
"clear-thinking-20250115", # Clear thinking blocks from previous turns to reduce token usage
]

# Agent definitions
SettingSource = Literal["user", "project", "local"]
Expand Down
15 changes: 15 additions & 0 deletions tests/test_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ def test_build_command_with_max_thinking_tokens(self):
assert "--max-thinking-tokens" in cmd
assert "5000" in cmd

def test_build_command_with_betas(self):
"""Test building CLI command with betas option."""

transport = SubprocessCLITransport(
prompt="test",
options=make_options(
betas=["context-1m-2025-08-07", "clear-thinking-20250115"]
),
)

cmd = transport._build_command()
assert "--betas" in cmd
betas_index = cmd.index("--betas")
assert cmd[betas_index + 1] == "context-1m-2025-08-07,clear-thinking-20250115"

def test_build_command_with_add_dirs(self):
"""Test building CLI command with add_dirs option."""
from pathlib import Path
Expand Down