Skip to content

Commit 6c565dd

Browse files
github-actions[bot]claude
authored andcommitted
docs: Claude Code v2.1.97 + Agent SDK + Agents API
MAJOR UPDATE: Agent SDK launch + new API endpoints NEW FEATURES: - Claude Code v2.1.97 with focus view (Ctrl+O), status line improvements, subagent indicators - Complete Agent SDK docs (custom tools, file checkpointing, hosting, cost tracking) - New Agents API (beta endpoints for create, list, update, archive, versions) - New API endpoints: environments, sessions, vaults - 500+ documentation updates across API reference and platform docs WHY IT MATTERS: The Agent SDK enables developers to build custom Claude-powered applications with domain-specific tools and persistent state management. This represents a significant expansion of Claude's capabilities beyond chat into programmable agent workflows. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9dcac0c commit 6c565dd

1,031 files changed

Lines changed: 678672 additions & 57398 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

content/.metadata.json

Lines changed: 5409 additions & 2546 deletions
Large diffs are not rendered by default.

content/CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,54 @@
11
# Changelog
22

3+
## 2.1.97
4+
5+
- Added focus view toggle (`Ctrl+O`) in `NO_FLICKER` mode showing prompt, one-line tool summary with edit diffstats, and final response
6+
- Added `refreshInterval` status line setting to re-run the status line command every N seconds
7+
- Added `workspace.git_worktree` to the status line JSON input, set when the current directory is inside a linked git worktree
8+
- Added `● N running` indicator in `/agents` next to agent types with live subagent instances
9+
- Added syntax highlighting for Cedar policy files (`.cedar`, `.cedarpolicy`)
10+
- Fixed `--dangerously-skip-permissions` being silently downgraded to accept-edits mode after approving a write to a protected path
11+
- Fixed and hardened Bash tool permissions, tightening checks around env-var prefixes and network redirects, and reducing false prompts on common commands
12+
- Fixed permission rules with names matching JavaScript prototype properties (e.g. `toString`) causing `settings.json` to be silently ignored
13+
- Fixed managed-settings allow rules remaining active after an admin removed them until process restart
14+
- Fixed `permissions.additionalDirectories` changes in settings not applying mid-session
15+
- Fixed removing a directory from `settings.permissions.additionalDirectories` revoking access to the same directory passed via `--add-dir`
16+
- Fixed MCP HTTP/SSE connections accumulating ~50 MB/hr of unreleased buffers when servers reconnect
17+
- Fixed MCP OAuth `oauth.authServerMetadataUrl` not being honored on token refresh after restart, fixing ADFS and similar IdPs
18+
- Fixed 429 retries burning all attempts in ~13 seconds when the server returns a small `Retry-After` — exponential backoff now applies as a minimum
19+
- Fixed rate-limit upgrade options disappearing after context compaction
20+
- Fixed several `/resume` picker issues: `--resume <name>` opening uneditable, Ctrl+A reload wiping search, empty list swallowing navigation, task-status text replacing conversation summary, and cross-project staleness
21+
- Fixed file-edit diffs disappearing on `--resume` when the edited file was larger than 10KB
22+
- Fixed `--resume` cache misses and lost mid-turn input from attachment messages not being saved to the transcript
23+
- Fixed messages typed while Claude is working not being persisted to the transcript
24+
- Fixed prompt-type `Stop`/`SubagentStop` hooks failing on long sessions, and hook evaluator API errors displaying "JSON validation failed" instead of the actual message
25+
- Fixed subagents with worktree isolation or `cwd:` override leaking their working directory back to the parent session's Bash tool
26+
- Fixed compaction writing duplicate multi-MB subagent transcript files on prompt-too-long retries
27+
- Fixed `claude plugin update` reporting "already at the latest version" for git-based marketplace plugins when the remote had newer commits
28+
- Fixed slash command picker breaking when a plugin's frontmatter `name` is a YAML boolean keyword
29+
- Fixed copying wrapped URLs in `NO_FLICKER` mode inserting spaces at line breaks
30+
- Fixed scroll rendering artifacts in `NO_FLICKER` mode when running inside zellij
31+
- Fixed a crash in `NO_FLICKER` mode when hovering over MCP tool results
32+
- Fixed a `NO_FLICKER` mode memory leak where API retries left stale streaming state
33+
- Fixed slow mouse-wheel scrolling in `NO_FLICKER` mode on Windows Terminal
34+
- Fixed custom status line not displaying in `NO_FLICKER` mode on terminals shorter than 24 rows
35+
- Fixed Shift+Enter and Alt/Cmd+arrow shortcuts not working in Warp with `NO_FLICKER` mode
36+
- Fixed Korean/Japanese/Unicode text becoming garbled when copied in no-flicker mode on Windows
37+
- Fixed Bedrock SigV4 authentication failing when `AWS_BEARER_TOKEN_BEDROCK` or `ANTHROPIC_BEDROCK_BASE_URL` are set to empty strings (as GitHub Actions does for unset inputs)
38+
- Improved Accept Edits mode to auto-approve filesystem commands prefixed with safe env vars or process wrappers (e.g. `LANG=C rm foo`, `timeout 5 mkdir out`)
39+
- Improved auto mode and bypass-permissions mode to auto-approve sandbox network access prompts
40+
- Improved sandbox: `sandbox.network.allowMachLookup` now takes effect on macOS
41+
- Improved image handling: pasted and attached images are now compressed to the same token budget as images read via the Read tool
42+
- Improved slash command and `@`-mention completion to trigger after CJK sentence punctuation, so Japanese/Chinese input no longer requires a space before `/` or `@`
43+
- Improved Bridge sessions to show the local git repo, branch, and working directory on the claude.ai session card
44+
- Improved footer layout: indicators (Focus, notifications) now stay on the mode-indicator row instead of wrapping below
45+
- Improved context-low warning to show as a transient footer notification instead of a persistent row
46+
- Improved markdown blockquotes to show a continuous left bar across wrapped lines
47+
- Improved session transcript size by skipping empty hook entries and capping stored pre-edit file copies
48+
- Improved transcript accuracy: per-block entries now carry the final token usage instead of the streaming placeholder
49+
- Improved Bash tool OTEL tracing: subprocesses now inherit a W3C `TRACEPARENT` env var when tracing is enabled
50+
- Updated `/claude-api` skill to cover Managed Agents alongside the Claude API
51+
352
## 2.1.96
453

554
- Fixed Bedrock requests failing with `403 "Authorization header is missing"` when using `AWS_BEARER_TOKEN_BEDROCK` or `CLAUDE_CODE_SKIP_BEDROCK_AUTH` (regression in 2.1.94)

content/blog/engineering/claude-code-best-practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Use Claude Code
2929

3030
Best Practices for Claude Code
3131

32-
[Getting started](https://www.anthropic.com/docs/en/overview)[Build with Claude Code](https://www.anthropic.com/docs/en/sub-agents)[Deployment](https://www.anthropic.com/docs/en/third-party-integrations)[Administration](https://www.anthropic.com/docs/en/setup)[Configuration](https://www.anthropic.com/docs/en/settings)[Reference](https://www.anthropic.com/docs/en/cli-reference)[What's New](https://www.anthropic.com/docs/en/whats-new)[Resources](https://www.anthropic.com/docs/en/legal-and-compliance)
32+
[Getting started](https://www.anthropic.com/docs/en/overview)[Build with Claude Code](https://www.anthropic.com/docs/en/sub-agents)[Deployment](https://www.anthropic.com/docs/en/third-party-integrations)[Administration](https://www.anthropic.com/docs/en/setup)[Configuration](https://www.anthropic.com/docs/en/settings)[Reference](https://www.anthropic.com/docs/en/cli-reference)[Agent SDK](https://www.anthropic.com/docs/en/agent-sdk/overview)[What's New](https://www.anthropic.com/docs/en/whats-new)[Resources](https://www.anthropic.com/docs/en/legal-and-compliance)
3333

3434
##### Getting started
3535

@@ -125,7 +125,7 @@ Claude performs dramatically better when it can verify its own work, like run te
125125

126126
| Strategy | Before | After |
127127
| --- | --- | --- |
128-
| **Provide verification criteria** | _”implement a function that validates email addresses"_ | _"write a validateEmail function. example test cases: [[email protected]](https://www.anthropic.com/cdn-cgi/l/email-protection#7005031502301508111d001c155e131f1d) is true, invalid is false, [[email protected]](https://www.anthropic.com/cdn-cgi/l/email-protection#b8cdcbddcaf896dbd7d5) is false. run the tests after implementing”_ |
128+
| **Provide verification criteria** | _”implement a function that validates email addresses"_ | _"write a validateEmail function. example test cases: [[email protected]](https://www.anthropic.com/cdn-cgi/l/email-protection#85f0f6e0f7c5e0fde4e8f5e9e0abe6eae8) is true, invalid is false, [[email protected]](https://www.anthropic.com/cdn-cgi/l/email-protection#5227213720127c313d3f) is false. run the tests after implementing”_ |
129129
| **Verify UI changes visually** | _”make the dashboard look better"_ | _"[paste screenshot] implement this design. take a screenshot of the result and compare it to the original. list differences and fix them”_ |
130130
| **Address root causes, not symptoms** | _”the build is failing"_ | _"the build fails with this error: [paste error]. fix it and verify the build succeeds. address the root cause, don’t suppress the error”_ |
131131

content/blog/engineering/claude-code-sandboxing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Our new sandboxed bash tool and Claude Code on the web offer substantial improve
6868
To get started with these tools:
6969

7070
1. Run `/sandbox` in Claude and check out [our docs](https://docs.claude.com/en/docs/claude-code/sandboxing) on how to configure this sandbox.
71-
2. Go to [claude.com/code](http://claude.ai/redirect/website.v1.91b9b576-38af-40d7-8b65-118a3bfcad75/code) to try out Claude Code on the web.
71+
2. Go to [claude.com/code](http://claude.ai/redirect/website.v1.93c40709-533b-444e-aacf-c48d96624ea1/code) to try out Claude Code on the web.
7272

7373
Or, if you're building your own agents, check out our [open-sourced sandboxing code](https://github.com/anthropic-experimental/sandbox-runtime), and consider integrating it into your work. We look forward to seeing what you build.
7474

content/claude-code-manifest.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "@anthropic-ai/claude-code",
3-
"version": "2.1.96",
3+
"version": "2.1.97",
44
"author": {
55
"name": "Anthropic",
66
"email": "support@anthropic.com"
77
},
88
"license": "SEE LICENSE IN README.md",
9-
"_id": "@anthropic-ai/claude-code@2.1.96",
9+
"_id": "@anthropic-ai/claude-code@2.1.97",
1010
"maintainers": [
1111
{
1212
"name": "zak-anthropic",
@@ -73,20 +73,20 @@
7373
"claude": "cli.js"
7474
},
7575
"dist": {
76-
"shasum": "d528e9638292c7b275c896b283e4a8e6959ef0ef",
77-
"tarball": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-2.1.96.tgz",
76+
"shasum": "b790d417b4f47b897068ffff9b57812ccc81e707",
77+
"tarball": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-2.1.97.tgz",
7878
"fileCount": 20,
79-
"integrity": "sha512-ETrc0+1qWHaqtKi+ixbsAecZyM+H52VIJj+zWIvw3jBU/JZ9v5vnE2kHShM1lcpr+Gji7GXk23l0CMGLA7hC0g==",
79+
"integrity": "sha512-8lKM/rFctBl+82bQ+0g0Lkbt9tJU/zYKAjWisNUq436/386n/VZQbnyjnibGkyqqB6mrX/3ub/cpFlpCu4FXLg==",
8080
"signatures": [
8181
{
82-
"sig": "MEUCIDfVFVFY0qtDRV8JGrx0/QKyh70/hWuV+lO0LSTt2zz6AiEA20JmCcoQACXgZOSLdrLxZ8I2356j3KvBbianSlhxu0A=",
82+
"sig": "MEUCICG6rML8JBFMxvrHFFDhofBztC5mvsOLqHbO7G4bdU4MAiEA/TuR+/HzSBvE2e/5XokcLHWOLaw604eahZ4Hy+IFTew=",
8383
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
8484
}
8585
],
86-
"unpackedSize": 48924836
86+
"unpackedSize": 48991994
8787
},
8888
"type": "module",
89-
"_from": "file:/home/runner/work/claude-cli-internal/claude-cli-internal/build-external/anthropic-ai-claude-code-2.1.96.tgz",
89+
"_from": "file:/home/runner/work/claude-cli-internal/claude-cli-internal/build-external/anthropic-ai-claude-code-2.1.97.tgz",
9090
"engines": {
9191
"node": ">=18.0.0"
9292
},
@@ -97,8 +97,8 @@
9797
"name": "wolffiex",
9898
"email": "wolffiex@anthropic.com"
9999
},
100-
"_resolved": "/home/runner/work/claude-cli-internal/claude-cli-internal/build-external/anthropic-ai-claude-code-2.1.96.tgz",
101-
"_integrity": "sha512-ETrc0+1qWHaqtKi+ixbsAecZyM+H52VIJj+zWIvw3jBU/JZ9v5vnE2kHShM1lcpr+Gji7GXk23l0CMGLA7hC0g==",
100+
"_resolved": "/home/runner/work/claude-cli-internal/claude-cli-internal/build-external/anthropic-ai-claude-code-2.1.97.tgz",
101+
"_integrity": "sha512-8lKM/rFctBl+82bQ+0g0Lkbt9tJU/zYKAjWisNUq436/386n/VZQbnyjnibGkyqqB6mrX/3ub/cpFlpCu4FXLg==",
102102
"_npmVersion": "10.8.2",
103103
"description": "Use Claude, Anthropic's AI assistant, right from your terminal. Claude can understand your codebase, edit files, run terminal commands, and handle entire workflows for you.",
104104
"directories": {},
@@ -118,7 +118,7 @@
118118
"@img/sharp-linuxmusl-arm64": "^0.34.2"
119119
},
120120
"_npmOperationalInternal": {
121-
"tmp": "tmp/claude-code_2.1.96_1775622763975_0.7218051294969574",
121+
"tmp": "tmp/claude-code_2.1.97_1775683674825_0.4147276975853762",
122122
"host": "s3://npm-registry-packages-npm-production"
123123
}
124124
}

content/en/about-claude/models/migration-guide.md

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Guide for migrating to Claude 4.6 models from previous Claude versions
44

55
---
66

7+
<Note>
8+
This guide covers migrating [Messages API](/docs/en/build-with-claude/working-with-messages) code. If you use [Claude Managed Agents](/docs/en/managed-agents/overview), see [Migrating between model versions](/docs/en/managed-agents/migration#migrating-between-model-versions). The Managed Agents runtime handles most of the request-shape changes described here.
9+
</Note>
10+
711
## Migrating to Claude 4.6
812

913
Claude Opus 4.6 is a near drop-in replacement for Claude 4.5, with a few breaking changes to be aware of. For a full list of new features, see [What's new in Claude 4.6](/docs/en/about-claude/models/whats-new-claude-4-6).
@@ -50,6 +54,20 @@ These are not required but will improve your experience:
5054
)
5155
```
5256

57+
```bash CLI
58+
ant messages create <<'YAML'
59+
model: claude-opus-4-6
60+
max_tokens: 16000
61+
thinking:
62+
type: adaptive
63+
output_config:
64+
effort: high
65+
messages:
66+
- role: user
67+
content: Your prompt here
68+
YAML
69+
```
70+
5371
```typescript TypeScript hidelines={1..2}
5472
import Anthropic from "@anthropic-ai/sdk";
5573
@@ -222,7 +240,7 @@ model = "claude-opus-4-6" # After
222240
Use only `temperature` OR `top_p`, not both:
223241
224242
225-
```python nocheck
243+
```python Python nocheck
226244
# Before - This will error in Claude 4+ models
227245
response = client.messages.create(
228246
model="claude-3-7-sonnet-20250219",
@@ -263,7 +281,7 @@ model = "claude-opus-4-6" # After
263281
Update your application to [handle `refusal` stop reasons](/docs/en/test-and-evaluate/strengthen-guardrails/handle-streaming-refusals):
264282
265283
266-
```python nocheck
284+
```python Python nocheck
267285
response = client.messages.create(...)
268286
269287
if response.stop_reason == "refusal":
@@ -276,7 +294,7 @@ model = "claude-opus-4-6" # After
276294
Claude 4.5+ models return a `model_context_window_exceeded` stop reason when generation stops due to hitting the context window limit, rather than the requested `max_tokens` limit. Update your application to handle this new stop reason:
277295
278296
279-
```python nocheck
297+
```python Python nocheck
280298
response = client.messages.create(...)
281299
282300
if response.stop_reason == "model_context_window_exceeded":
@@ -436,6 +454,18 @@ curl https://api.anthropic.com/v1/messages \
436454
}'
437455
```
438456
457+
```bash CLI
458+
ant messages create <<'YAML'
459+
model: claude-sonnet-4-6
460+
max_tokens: 8192
461+
output_config:
462+
effort: low
463+
messages:
464+
- role: user
465+
content: Your prompt here
466+
YAML
467+
```
468+
439469
```python Python
440470
response = client.messages.create(
441471
model="claude-sonnet-4-6",
@@ -615,6 +645,20 @@ curl https://api.anthropic.com/v1/messages \
615645
}'
616646
```
617647

648+
```bash CLI nocheck
649+
ant messages create <<'YAML'
650+
model: claude-sonnet-4-6
651+
max_tokens: 64000
652+
thinking:
653+
type: adaptive
654+
output_config:
655+
effort: medium
656+
messages:
657+
- role: user
658+
content: Your prompt here
659+
YAML
660+
```
661+
618662
```python Python nocheck
619663
response = client.messages.create(
620664
model="claude-sonnet-4-6",
@@ -803,6 +847,21 @@ curl https://api.anthropic.com/v1/messages \
803847
}'
804848
```
805849

850+
```bash CLI
851+
ant beta:messages create --beta interleaved-thinking-2025-05-14 <<'YAML'
852+
model: claude-sonnet-4-6
853+
max_tokens: 16384
854+
thinking:
855+
type: enabled
856+
budget_tokens: 16384
857+
output_config:
858+
effort: medium
859+
messages:
860+
- role: user
861+
content: Your prompt here
862+
YAML
863+
```
864+
806865
```python Python
807866
response = client.beta.messages.create(
808867
model="claude-sonnet-4-6",
@@ -995,6 +1054,21 @@ curl https://api.anthropic.com/v1/messages \
9951054
}'
9961055
```
9971056

1057+
```bash CLI
1058+
ant beta:messages create --beta interleaved-thinking-2025-05-14 <<'YAML'
1059+
model: claude-sonnet-4-6
1060+
max_tokens: 8192
1061+
thinking:
1062+
type: enabled
1063+
budget_tokens: 16384
1064+
output_config:
1065+
effort: low
1066+
messages:
1067+
- role: user
1068+
content: Your prompt here
1069+
YAML
1070+
```
1071+
9981072
```python Python
9991073
response = client.beta.messages.create(
10001074
model="claude-sonnet-4-6",

content/en/about-claude/models/whats-new-claude-4-6.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For complete pricing and specs, see the [models overview](/docs/en/about-claude/
2525

2626
`thinking: {type: "enabled"}` and `budget_tokens` are **deprecated** on Opus 4.6 and Sonnet 4.6. They remain functional but will be removed in a future model release. Use adaptive thinking and the [effort parameter](/docs/en/build-with-claude/effort) to control thinking depth instead. Adaptive thinking also automatically enables interleaved thinking.
2727

28-
```python
28+
```python Python
2929
response = client.messages.create(
3030
model="claude-opus-4-6",
3131
max_tokens=16000,
@@ -66,7 +66,7 @@ The following tools are now generally available:
6666

6767
[Fast mode](/docs/en/build-with-claude/fast-mode) (`speed: "fast"`) delivers significantly faster output token generation for Opus models. Fast mode is up to 2.5x as fast at premium pricing ($30/$150 per MTok). This is the same model running with faster inference (no change to intelligence or capabilities).
6868

69-
```python
69+
```python Python
7070
response = client.beta.messages.create(
7171
model="claude-opus-4-6",
7272
max_tokens=4096,
@@ -106,7 +106,7 @@ On **Sonnet 4.6**, the `interleaved-thinking-2025-05-14` beta header is still fu
106106

107107
The `output_format` parameter for [structured outputs](/docs/en/build-with-claude/structured-outputs) has been moved to `output_config.format`. The old parameter remains functional but is deprecated and will be removed in a future model release.
108108

109-
```python nocheck
109+
```python Python nocheck
110110
# Before
111111
response = client.messages.create(
112112
output_format={"type": "json_schema", "schema": {...}},

0 commit comments

Comments
 (0)