Skip to content

Comments

feat: add ThinkingConfig types and effort option#565

Merged
ashwin-ant merged 1 commit intomainfrom
ashwin/thinking-config-and-effort-options
Feb 11, 2026
Merged

feat: add ThinkingConfig types and effort option#565
ashwin-ant merged 1 commit intomainfrom
ashwin/thinking-config-and-effort-options

Conversation

@ashwin-ant
Copy link
Collaborator

Summary

  • Adds ThinkingConfig union type with ThinkingConfigAdaptive, ThinkingConfigEnabled, and ThinkingConfigDisabled variants
  • Adds thinking field to ClaudeAgentOptions that takes precedence over the deprecated max_thinking_tokens field
  • Adds effort field to ClaudeAgentOptions supporting "low", "medium", "high", and "max" values, mapped to --effort CLI flag
  • Resolves thinking config to --max-thinking-tokens CLI flag: adaptive defaults to 32,000, enabled uses budget_tokens, disabled uses 0

Test plan

  • Verify ThinkingConfigEnabled with budget_tokens passes the correct value to --max-thinking-tokens
  • Verify ThinkingConfigAdaptive defaults to --max-thinking-tokens 32000 when max_thinking_tokens is not set
  • Verify ThinkingConfigDisabled passes --max-thinking-tokens 0
  • Verify thinking takes precedence over max_thinking_tokens when both are set
  • Verify effort is passed as --effort <value> to the CLI
  • Verify all new types are exported from __init__.py

Changelog

  • Added ThinkingConfig, ThinkingConfigAdaptive, ThinkingConfigEnabled, and ThinkingConfigDisabled types to ClaudeAgentOptions for controlling extended thinking behavior
  • Added effort option to ClaudeAgentOptions for controlling thinking depth ("low", "medium", "high", "max")
  • Deprecated max_thinking_tokens in favor of the new thinking config field

🤖 Generated with Claude Code (0% 11-shotted by claude)

- Add ThinkingConfigAdaptive, ThinkingConfigEnabled, ThinkingConfigDisabled
  TypedDict types and a ThinkingConfig union type in types.py
- Add `thinking: ThinkingConfig | None` field to ClaudeAgentOptions,
  which takes precedence over the deprecated `max_thinking_tokens`
- Add `effort: Literal["low", "medium", "high", "max"] | None` field
  to ClaudeAgentOptions, passed via --effort CLI flag
- Update subprocess_cli.py to resolve thinking config into
  --max-thinking-tokens: adaptive defaults to 32_000, enabled uses
  budget_tokens, disabled uses 0
- Export new ThinkingConfig types from the top-level package

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ashwin-ant ashwin-ant requested a review from a team February 11, 2026 18:10
@ashwin-ant ashwin-ant merged commit 1671b6c into main Feb 11, 2026
9 checks passed
@ashwin-ant ashwin-ant deleted the ashwin/thinking-config-and-effort-options branch February 11, 2026 18:17
phil65 added a commit to phil65/claude-agent-sdk-python that referenced this pull request Feb 17, 2026


- Add ThinkingConfigAdaptive, ThinkingConfigEnabled, ThinkingConfigDisabled types
- Add ThinkingConfig union type
- Add thinking and effort fields to ClaudeAgentOptions
- Update _build_command() to resolve thinking config to --max-thinking-tokens
- Add --effort flag support
- Re-export ThinkingConfig types from __init__.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants