spacehub

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

claude-code / plugins / claude-opus-4-5-migration / skills / claude-opus-4-5-migration / references / effort.md
70 lines · 1.7 KBPreviewCodeRaw
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
7Effort 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
17Requires beta flag `effort-2025-11-24` in API calls.
18
19**Python SDK:**
20```python
21response = 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
34const 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
60Effort 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
671. First determine effort level, then set thinking budget
682. Best performance: high effort + high thinking budget
693. Cost/latency optimization: medium effort
704. Simple high-volume queries: low effort