feat: add ThinkingConfig types and effort option#565
Merged
ashwin-ant merged 1 commit intomainfrom Feb 11, 2026
Merged
Conversation
- 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>
hackyon-anthropic
approved these changes
Feb 11, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ThinkingConfigunion type withThinkingConfigAdaptive,ThinkingConfigEnabled, andThinkingConfigDisabledvariantsthinkingfield toClaudeAgentOptionsthat takes precedence over the deprecatedmax_thinking_tokensfieldeffortfield toClaudeAgentOptionssupporting"low","medium","high", and"max"values, mapped to--effortCLI flagthinkingconfig to--max-thinking-tokensCLI flag:adaptivedefaults to 32,000,enabledusesbudget_tokens,disableduses 0Test plan
ThinkingConfigEnabledwithbudget_tokenspasses the correct value to--max-thinking-tokensThinkingConfigAdaptivedefaults to--max-thinking-tokens 32000whenmax_thinking_tokensis not setThinkingConfigDisabledpasses--max-thinking-tokens 0thinkingtakes precedence overmax_thinking_tokenswhen both are seteffortis passed as--effort <value>to the CLI__init__.pyChangelog
ThinkingConfig,ThinkingConfigAdaptive,ThinkingConfigEnabled, andThinkingConfigDisabledtypes toClaudeAgentOptionsfor controlling extended thinking behavioreffortoption toClaudeAgentOptionsfor controlling thinking depth ("low","medium","high","max")max_thinking_tokensin favor of the newthinkingconfig field🤖 Generated with Claude Code (0% 11-shotted by claude)