surshar / claude-code
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
Built by Anthropic · github.com/anthropics
| 1 | # Effort Parameter (Beta) |
| 2 | |
| 3 | **Add effort set to `"high"` during migration.** This is the default configuration for best performance with Opus 4.5. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | Effort controls how eagerly Claude spends tokens. It affects all tokens: thinking, text responses, and function calls. |
| 8 | |
| 9 | | Effort | Use Case | |
| 10 | |--------|----------| |
| 11 | | `high` | Best performance, deep reasoning (default) | |
| 12 | | `medium` | Balance of cost/latency vs. performance | |
| 13 | | `low` | Simple, high-volume queries; significant token savings | |
| 14 | |
| 15 | ## Implementation |
| 16 | |
| 17 | Requires beta flag `effort-2025-11-24` in API calls. |
| 18 | |
| 19 | **Python SDK:** |
| 20 | ```python |
| 21 | response = client.messages.create( |
| 22 | model="claude-opus-4-5-20251101", |
| 23 | max_tokens=1024, |
| 24 | betas=["effort-2025-11-24"], |
| 25 | output_config={ |
| 26 | "effort": "high" # or "medium" or "low" |
| 27 | }, |
| 28 | messages=[...] |
| 29 | ) |
| 30 | ``` |
| 31 | |
| 32 | **TypeScript SDK:** |
| 33 | ```typescript |
| 34 | const response = await client.messages.create({ |
| 35 | model: "claude-opus-4-5-20251101", |
| 36 | max_tokens: 1024, |
| 37 | betas: ["effort-2025-11-24"], |
| 38 | output_config: { |
| 39 | effort: "high" // or "medium" or "low" |
| 40 | }, |
| 41 | messages: [...] |
| 42 | }); |
| 43 | ``` |
| 44 | |
| 45 | **Raw API:** |
| 46 | ```json |
| 47 | { |
| 48 | "model": "claude-opus-4-5-20251101", |
| 49 | "max_tokens": 1024, |
| 50 | "anthropic-beta": "effort-2025-11-24", |
| 51 | "output_config": { |
| 52 | "effort": "high" |
| 53 | }, |
| 54 | "messages": [...] |
| 55 | } |
| 56 | ``` |
| 57 | |
| 58 | ## Effort vs. Thinking Budget |
| 59 | |
| 60 | Effort is independent of thinking budget: |
| 61 | |
| 62 | - High effort + no thinking = more tokens, but no thinking tokens |
| 63 | - High effort + 32k thinking = more tokens, but thinking capped at 32k |
| 64 | |
| 65 | ## Recommendations |
| 66 | |
| 67 | 1. First determine effort level, then set thinking budget |
| 68 | 2. Best performance: high effort + high thinking budget |
| 69 | 3. Cost/latency optimization: medium effort |
| 70 | 4. Simple high-volume queries: low effort |