claudecode-omc 5.6.8 → 5.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.local/skills/prompt-optimizer/SKILL.md +262 -19
- package/.omc-curation/ecc-selection.json +80 -0
- package/.omc-curation/governance.json +113 -0
- package/.omc-curation/sources.lock.json +25 -0
- package/README.md +69 -4
- package/bundled/manifest.json +5 -5
- package/bundled/upstream/anthropic-skills/.omc-source/bundle.json +18 -0
- package/bundled/upstream/anthropic-skills/.omc-source/provenance.json +399 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +18 -17
- package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
- package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +4 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
- package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +5 -5
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +3 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +10 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +19 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +6 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +1 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +3 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-self-hosted-sandboxes.md +173 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +10 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +113 -13
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +14 -11
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +4 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +3 -3
- package/bundled/upstream/ecc/.omc-source/bundle.json +2 -1
- package/bundled/upstream/ecc/.omc-source/last-plan-apply.json +108 -24
- package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +3 -3
- package/bundled/upstream/ecc/.omc-source/provenance.json +563 -0
- package/bundled/upstream/ecc/agents/marketing-agent.md +159 -0
- package/bundled/upstream/ecc/agents/react-build-resolver.md +215 -0
- package/bundled/upstream/ecc/agents/react-reviewer.md +167 -0
- package/bundled/upstream/ecc/agents/typescript-reviewer.md +3 -0
- package/bundled/upstream/ecc/commands/harness-audit.md +17 -10
- package/bundled/upstream/ecc/commands/marketing-campaign.md +129 -0
- package/bundled/upstream/ecc/commands/react-build.md +187 -0
- package/bundled/upstream/ecc/commands/react-review.md +170 -0
- package/bundled/upstream/ecc/commands/react-test.md +265 -0
- package/bundled/upstream/ecc/skills/benchmark-optimization-loop/SKILL.md +69 -0
- package/bundled/upstream/ecc/skills/blender-motion-state-inspection/SKILL.md +164 -0
- package/bundled/upstream/ecc/skills/canary-watch/SKILL.md +9 -1
- package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +31 -9
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +38 -4
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +319 -12
- package/bundled/upstream/ecc/skills/data-throughput-accelerator/SKILL.md +72 -0
- package/bundled/upstream/ecc/skills/dynamic-workflow-mode/SKILL.md +123 -0
- package/bundled/upstream/ecc/skills/frontend-a11y/SKILL.md +446 -0
- package/bundled/upstream/ecc/skills/ito-basket-compare/SKILL.md +63 -0
- package/bundled/upstream/ecc/skills/ito-data-atlas-agent/SKILL.md +63 -0
- package/bundled/upstream/ecc/skills/ito-market-intelligence/SKILL.md +60 -0
- package/bundled/upstream/ecc/skills/ito-trade-planner/SKILL.md +67 -0
- package/bundled/upstream/ecc/skills/latency-critical-systems/SKILL.md +73 -0
- package/bundled/upstream/ecc/skills/marketing-campaign/SKILL.md +113 -0
- package/bundled/upstream/ecc/skills/nextjs-turbopack/SKILL.md +13 -0
- package/bundled/upstream/ecc/skills/parallel-execution-optimizer/SKILL.md +72 -0
- package/bundled/upstream/ecc/skills/prediction-market-oracle-research/SKILL.md +63 -0
- package/bundled/upstream/ecc/skills/prediction-market-risk-review/SKILL.md +60 -0
- package/bundled/upstream/ecc/skills/react-patterns/SKILL.md +341 -0
- package/bundled/upstream/ecc/skills/react-performance/SKILL.md +574 -0
- package/bundled/upstream/ecc/skills/react-testing/SKILL.md +423 -0
- package/bundled/upstream/ecc/skills/recsys-pipeline-architect/SKILL.md +114 -0
- package/bundled/upstream/ecc/skills/recursive-decision-ledger/SKILL.md +79 -0
- package/bundled/upstream/ecc/skills/social-publisher/SKILL.md +115 -0
- package/bundled/upstream/ecc/skills/team-agent-orchestration/SKILL.md +110 -0
- package/bundled/upstream/ecc/skills/uncloud/SKILL.md +343 -0
- package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +99 -0
- package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +2 -1
- package/bundled/upstream/oh-my-claudecode/.omc-source/provenance.json +116 -0
- package/bundled/upstream/oh-my-claudecode/skills/autopilot/SKILL.md +7 -0
- package/bundled/upstream/oh-my-claudecode/skills/cancel/SKILL.md +1 -0
- package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +39 -5
- package/bundled/upstream/oh-my-claudecode/skills/hud/SKILL.md +1 -0
- package/bundled/upstream/oh-my-claudecode/skills/local-build-reminder/SKILL.md +78 -0
- package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/SKILL.md +26 -10
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +3 -3
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +6 -4
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/04-welcome.md +2 -2
- package/bundled/upstream/oh-my-claudecode/skills/omc-teams/SKILL.md +6 -6
- package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +44 -32
- package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +45 -21
- package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/self-improve/SKILL.md +7 -0
- package/bundled/upstream/oh-my-claudecode/skills/self-improve/scripts/resolve-paths.mjs +39 -15
- package/bundled/upstream/oh-my-claudecode/skills/team/SKILL.md +132 -90
- package/bundled/upstream/oh-my-claudecode/skills/ultragoal/SKILL.md +93 -0
- package/bundled/upstream/oh-my-claudecode/skills/ultraqa/SKILL.md +28 -13
- package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +7 -0
- package/bundled/upstream/superpowers/.omc-source/bundle.json +2 -1
- package/bundled/upstream/superpowers/.omc-source/provenance.json +63 -0
- package/package.json +2 -1
- package/src/catalog/source-catalog.js +10 -4
- package/src/cli/index.js +4 -0
- package/src/cli/plan.js +14 -2
- package/src/cli/setup.js +52 -13
- package/src/cli/skill.js +1 -1
- package/src/cli/source.js +265 -14
- package/src/config/sources.js +67 -1
- package/src/merge/content-patch.js +84 -0
- package/templates/merge-config.json +1 -8
- package/bundled/upstream/ecc/skills/strategic-compact/suggest-compact.sh +0 -54
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# Managed Agents — Self-Hosted Sandboxes
|
|
2
|
+
|
|
3
|
+
With `config.type: "self_hosted"`, the **agent loop stays on Anthropic's orchestration layer** but **tool execution moves to infrastructure you control** — bash, file ops, and code run inside your container, so filesystem contents and network egress never leave your environment. Contrast with `config.type: "cloud"`, where Anthropic runs the container. Connectivity is **outbound-only**: your worker long-polls Anthropic's work queue; Anthropic never dials into your network.
|
|
4
|
+
|
|
5
|
+
## Flow
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
1. Create environment: config: {type: "self_hosted"} → env_...
|
|
9
|
+
2. Generate environment key (Console, on the environment page) → sk-ant-oat01-... as ANTHROPIC_ENVIRONMENT_KEY
|
|
10
|
+
3. Run a worker: EnvironmentWorker.run() or ant beta:worker poll
|
|
11
|
+
4. Sessions reference environment_id=env_... exactly as for cloud
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Create the environment
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
client = anthropic.Anthropic()
|
|
18
|
+
|
|
19
|
+
environment = client.beta.environments.create(
|
|
20
|
+
name="self-hosted", config={"type": "self_hosted"}
|
|
21
|
+
)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`{"type": "self_hosted"}` is the entire config — there are no pool, capacity, or networking sub-fields; you control those on your side.
|
|
25
|
+
|
|
26
|
+
## Run a worker — SDK (primary path)
|
|
27
|
+
|
|
28
|
+
`EnvironmentWorker` wraps the poll → dispatch → tool-execute loop. `.run()` is the always-on loop; `.run_one()` / `.runOne()` handles one work item (for webhook-driven wake).
|
|
29
|
+
|
|
30
|
+
**Python — always-on:**
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
import asyncio
|
|
34
|
+
import os
|
|
35
|
+
from anthropic import AsyncAnthropic
|
|
36
|
+
from anthropic.lib.environments import EnvironmentWorker
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
async def main() -> None:
|
|
40
|
+
environment_key = os.environ["ANTHROPIC_ENVIRONMENT_KEY"]
|
|
41
|
+
environment_id = os.environ["ANTHROPIC_ENVIRONMENT_ID"]
|
|
42
|
+
async with AsyncAnthropic(auth_token=environment_key) as client:
|
|
43
|
+
await EnvironmentWorker(
|
|
44
|
+
client,
|
|
45
|
+
environment_id=environment_id,
|
|
46
|
+
environment_key=environment_key,
|
|
47
|
+
workdir="/workspace",
|
|
48
|
+
).run()
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
asyncio.run(main())
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**TypeScript — always-on:**
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
58
|
+
import { EnvironmentWorker } from "@anthropic-ai/sdk/helpers/beta/environments";
|
|
59
|
+
|
|
60
|
+
const environmentKey = process.env.ANTHROPIC_ENVIRONMENT_KEY!;
|
|
61
|
+
const environmentId = process.env.ANTHROPIC_ENVIRONMENT_ID!;
|
|
62
|
+
const client = new Anthropic({ authToken: environmentKey });
|
|
63
|
+
const ctrl = new AbortController();
|
|
64
|
+
process.once("SIGTERM", () => ctrl.abort());
|
|
65
|
+
|
|
66
|
+
await new EnvironmentWorker({
|
|
67
|
+
client,
|
|
68
|
+
environmentId,
|
|
69
|
+
environmentKey,
|
|
70
|
+
workdir: "/workspace",
|
|
71
|
+
signal: ctrl.signal
|
|
72
|
+
}).run();
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Customizing tools.** `EnvironmentWorker` runs the built-in toolset by default. To add or replace tools, use `AgentToolContext(workdir=, client=, session_id=)` with `beta_agent_toolset(env)` / `betaAgentToolset(env)` and pass the resulting tools to the lower-level `tool_runner()`. Skills attached to the agent are downloaded into `{workdir}/skills/<name>/` before tool calls begin (`AgentToolContext` handles this when given `client` and `session_id`). Downloaded skill files are marked executable automatically by the CLI and SDK; if you implement skills download yourself, you set permissions.
|
|
76
|
+
|
|
77
|
+
> **Runtime deps:** the SDK helpers require `/bin/bash` at that exact path. The TypeScript SDK additionally requires `unzip`, `tar`, and Node.js 22+. These are resolved at fixed paths and do **not** respect `PATH` overrides.
|
|
78
|
+
|
|
79
|
+
## Run a worker — `ant` CLI (fixed tools)
|
|
80
|
+
|
|
81
|
+
The `ant` CLI ships a worker with the fixed built-in toolset (`bash`, `read`, `write`, `edit`, `glob`, `grep`). Install per the Anthropic CLI docs (see `shared/live-sources.md` → Anthropic CLI), then:
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
export ANTHROPIC_ENVIRONMENT_KEY=sk-ant-oat01-...
|
|
85
|
+
ant beta:worker poll --environment-id env_... --workdir /workspace
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
- `--workdir` is the directory tools operate in (default `.`); tool calls are sandboxed to it.
|
|
89
|
+
- `--environment-key` overrides the env var.
|
|
90
|
+
- `--on-work <script>` runs your script per work item (e.g. to spin a fresh container per session — see Container orchestration below).
|
|
91
|
+
- `--unrestricted-paths`, `--max-idle` (default `60s`), `--log-format` — see `ant beta:worker poll --help`.
|
|
92
|
+
- Flags fall back to env vars (`ANTHROPIC_ENVIRONMENT_ID`, `ANTHROPIC_ENVIRONMENT_KEY`).
|
|
93
|
+
- Exits cleanly on SIGTERM/SIGINT after draining in-flight work.
|
|
94
|
+
- **Fixed toolset** — for custom tools, use the SDK worker above.
|
|
95
|
+
|
|
96
|
+
Inside an `--on-work` container, run `ant beta:worker run --workdir <dir>` as the entrypoint.
|
|
97
|
+
|
|
98
|
+
## Webhook-driven wake (instead of always-on)
|
|
99
|
+
|
|
100
|
+
Register a webhook for `session.status_run_started` (see `shared/managed-agents-webhooks.md`), verify the delivery, then drain one work item with `.run_one()`:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
import os
|
|
104
|
+
import anthropic
|
|
105
|
+
from anthropic.lib.environments import EnvironmentWorker
|
|
106
|
+
|
|
107
|
+
environment_key = os.environ["ANTHROPIC_ENVIRONMENT_KEY"]
|
|
108
|
+
environment_id = os.environ["ANTHROPIC_ENVIRONMENT_ID"]
|
|
109
|
+
client = anthropic.AsyncAnthropic(
|
|
110
|
+
auth_token=environment_key,
|
|
111
|
+
) # reads ANTHROPIC_WEBHOOK_SIGNING_KEY from env for webhooks.unwrap()
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
async def handle(raw: bytes, headers: dict[str, str]) -> dict:
|
|
115
|
+
event = client.beta.webhooks.unwrap(raw.decode(), headers=headers)
|
|
116
|
+
if event.data.type != "session.status_run_started":
|
|
117
|
+
return {"status": "ignored"}
|
|
118
|
+
await EnvironmentWorker(
|
|
119
|
+
client,
|
|
120
|
+
environment_id=environment_id,
|
|
121
|
+
environment_key=environment_key,
|
|
122
|
+
workdir="/workspace",
|
|
123
|
+
).run_one()
|
|
124
|
+
return {"status": "ok"}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
TypeScript: same shape with `client.beta.webhooks.unwrap(body, {headers})` and `new EnvironmentWorker({...}).runOne()`.
|
|
128
|
+
|
|
129
|
+
## Container orchestration (mid-level)
|
|
130
|
+
|
|
131
|
+
`EnvironmentWorker.run()` polls and executes tools in the same process. To run each session in its **own** container, use the mid-level poller in a thin orchestrator — Python `client.beta.environments.work.poller(environment_id=, environment_key=, drain=, block_ms=, reclaim_older_than_ms=, auto_stop=)`; TypeScript `new WorkPoller({client, environmentId, environmentKey, autoStop})` from `@anthropic-ai/sdk/helpers/beta/environments` — and, for each yielded `work` item, start a fresh container with these env vars injected, whose entrypoint runs `ant beta:worker run` or an `EnvironmentWorker(...).run_one()`. `block_ms` is 1–999 (or `None` for non-blocking); `reclaim_older_than_ms` re-claims items leased to a dead worker; `drain` stops once the queue is empty; `auto_stop` posts a stop signal after the iterator exits (set `False` when the launched container owns the stop call). **Go's poller has no `auto_stop` opt-out** — it calls `work.Stop` when the handler returns, so block in the handler until the session completes rather than detaching.
|
|
132
|
+
|
|
133
|
+
| Env var | Value |
|
|
134
|
+
|---|---|
|
|
135
|
+
| `ANTHROPIC_SESSION_ID` | `work.data.id` |
|
|
136
|
+
| `ANTHROPIC_WORK_ID` | `work.id` |
|
|
137
|
+
| `ANTHROPIC_ENVIRONMENT_ID` | `work.environment_id` |
|
|
138
|
+
| `ANTHROPIC_ENVIRONMENT_KEY` | pass through |
|
|
139
|
+
| `ANTHROPIC_BASE_URL` | pass through |
|
|
140
|
+
|
|
141
|
+
Skip items where `work.data.type != "session"`.
|
|
142
|
+
|
|
143
|
+
## Monitoring & control
|
|
144
|
+
|
|
145
|
+
These are **control-plane** calls — authenticate with `x-api-key` (not the environment key); `managed-agents-2026-04-01` beta header. **Call them from outside the worker host** — setting `ANTHROPIC_API_KEY` on the worker host exposes an organization-scoped credential to agent tool calls.
|
|
146
|
+
|
|
147
|
+
| SDK (`client.beta.environments.work.*`) | REST | CLI | Returns |
|
|
148
|
+
|---|---|---|---|
|
|
149
|
+
| `stats(environment_id)` | `GET /v1/environments/{id}/work/stats` | `ant beta:environments:work stats` | `{type:"work_queue_stats", depth, pending, oldest_queued_at, workers_polling}` |
|
|
150
|
+
| `stop(work_id, environment_id=)` | `POST /v1/environments/{id}/work/{work_id}/stop` | `ant beta:environments:work stop` | `work.state` |
|
|
151
|
+
|
|
152
|
+
## What changes vs `cloud`
|
|
153
|
+
|
|
154
|
+
| Concern | `cloud` | `self_hosted` |
|
|
155
|
+
|---|---|---|
|
|
156
|
+
| Container lifecycle, hardening, networking | Anthropic | **You** — run non-root, read-only rootfs, drop caps; egress is whatever your VPC/firewall allows |
|
|
157
|
+
| `file` / `github_repository` resource mounting | Anthropic mounts into the container | **You** — pass pointers via `sessions.create(metadata={...})` and have your orchestrator fetch/clone before dispatch |
|
|
158
|
+
| `memory_store` resources | Supported | **Not yet supported** |
|
|
159
|
+
| Built-in tools | Via `agent_toolset_20260401` | Supplied by your worker (`EnvironmentWorker` default / `beta_agent_toolset(env)` / `ant` CLI fixed set) |
|
|
160
|
+
| Skills download | Automatic | `EnvironmentWorker` / `AgentToolContext` fetch into `{workdir}/skills/` (needs `client` + `session_id`) |
|
|
161
|
+
| Claude Platform on AWS | Supported | **Not available** |
|
|
162
|
+
| SDK worker helpers | All SDKs | **Python, TypeScript, Go only** (`EnvironmentWorker` / poller not in Java, Ruby, PHP, or C#) — use one of those three or the `ant` CLI |
|
|
163
|
+
|
|
164
|
+
## Credentials
|
|
165
|
+
|
|
166
|
+
| Credential | Format | Scope |
|
|
167
|
+
|---|---|---|
|
|
168
|
+
| `ANTHROPIC_ENVIRONMENT_KEY` | `sk-ant-oat01-...` | One environment's work queue. Generate in Console ("Generate environment key"). Pass as `auth_token=` / `authToken` on the client **and** as `environment_key=` / `environmentKey` on `EnvironmentWorker`. Store in a secrets manager; rotate on exposure. |
|
|
169
|
+
| `ANTHROPIC_WEBHOOK_SIGNING_KEY` | `whsec_...` | Webhook signature verification (if using webhook-driven wake). The SDK reads this env var automatically for `client.beta.webhooks.unwrap()`. |
|
|
170
|
+
|
|
171
|
+
## Security — what you own
|
|
172
|
+
|
|
173
|
+
Container hardening; egress restriction (there is no default); `ANTHROPIC_ENVIRONMENT_KEY` custody and rotation; one workspace + environment per trust boundary when running untrusted code; least-privilege for the tool process; log retention and redaction. **Anthropic cannot**: fast-revoke a leaked environment key, verify your image or supply chain, sandbox tool execution inside your container, or enforce retention after tool output reaches your infrastructure. See the Self-Hosted Sandboxes Security page in `shared/live-sources.md` for the full checklist.
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
| Type | Who runs it | How it works |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| **Prebuilt Claude Agent tools** (`agent_toolset_20260401`) | Anthropic, on the session's container | File ops, bash, web search, etc. Enable all at once or configure individually with `enabled: true/false`. |
|
|
10
|
-
| **MCP tools** (`mcp_toolset`) | Anthropic
|
|
9
|
+
| **Prebuilt Claude Agent tools** (`agent_toolset_20260401`) | Anthropic, on the session's container (for `cloud` envs; for `self_hosted`, **your** worker supplies and runs them — see `shared/managed-agents-self-hosted-sandboxes.md`) | File ops, bash, web search, etc. Enable all at once or configure individually with `enabled: true/false`. |
|
|
10
|
+
| **MCP tools** (`mcp_toolset`) | Anthropic's orchestration layer | Capabilities exposed by connected MCP servers. Grant access per-server via the toolset. |
|
|
11
11
|
| **Custom tools** | **You** — your application handles the call and returns results | Agent emits a `agent.custom_tool_use` event, session goes `idle`, you send back a `user.custom_tool_result` event. |
|
|
12
12
|
|
|
13
13
|
**Recommendation:** Enable all prebuilt tools via `agent_toolset_20260401`, then disable individually as needed.
|
|
@@ -182,6 +182,12 @@ This keeps secrets out of reusable agent definitions. Each vault credential is t
|
|
|
182
182
|
|
|
183
183
|
> 💡 **Per-tool enablement (empirical):** `mcp_toolset` has been observed accepting `default_config: {enabled: false}` + `configs: [{name, enabled: true}]` for an allowlist pattern. The API ref shows only the minimal `{type, mcp_server_name}` form.
|
|
184
184
|
|
|
185
|
+
> 💡 **Changing tools/MCP servers on a running session:** `sessions.update()` can replace `agent.tools`, `agent.mcp_servers`, and `vault_ids` while the session is `idle` — a session-local override that doesn't touch the agent object. See `shared/managed-agents-core.md` → Updating the agent configuration mid-session.
|
|
186
|
+
|
|
187
|
+
**Large MCP tool outputs.** If an MCP tool returns more than **100K tokens**, the output is automatically offloaded to a file in the sandbox — the agent receives a truncated preview plus the file path and can `read` the full content. No configuration required.
|
|
188
|
+
|
|
189
|
+
**Invalid vault credentials don't block session creation.** If a vault credential is invalid for a declared MCP server, the session still creates successfully; a `session.error` event describes the MCP auth failure, and auth retries on the next `session.status_idle` → `session.status_running` transition.
|
|
190
|
+
|
|
185
191
|
> ⚠️ **MCP auth tokens ≠ REST API tokens.** Hosted MCP servers (`mcp.notion.com`, `mcp.linear.app`, etc.) typically require **OAuth bearer tokens**, not the service's native API keys. A Notion `ntn_` integration token authenticates against Notion's REST API but will **not** work as a vault credential for the Notion MCP server. These are different auth systems.
|
|
186
192
|
|
|
187
193
|
### Vaults — the MCP credential store
|
|
@@ -268,7 +274,7 @@ Skills are attached to the **agent** definition via `agents.create()`:
|
|
|
268
274
|
const agent = await client.beta.agents.create(
|
|
269
275
|
{
|
|
270
276
|
name: "Financial Agent",
|
|
271
|
-
model: "claude-opus-4-
|
|
277
|
+
model: "claude-opus-4-8",
|
|
272
278
|
system: "You are a financial analysis agent.",
|
|
273
279
|
skills: [
|
|
274
280
|
{ type: "anthropic", skill_id: "xlsx" },
|
|
@@ -283,7 +289,7 @@ Python:
|
|
|
283
289
|
```python
|
|
284
290
|
agent = client.beta.agents.create(
|
|
285
291
|
name="Financial Agent",
|
|
286
|
-
model="claude-opus-4-
|
|
292
|
+
model="claude-opus-4-8",
|
|
287
293
|
system="You are a financial analysis agent.",
|
|
288
294
|
skills=[
|
|
289
295
|
{"type": "anthropic", "skill_id": "xlsx"},
|
|
@@ -15,6 +15,8 @@ For the latest, authoritative version (with code samples in every supported lang
|
|
|
15
15
|
| Breaking Changes by Source Model | Migrating to Opus 4.6 / Sonnet 4.6 |
|
|
16
16
|
| Migrating to Opus 4.7 | Migrating to Opus 4.7 (breaking changes, silent defaults, behavioral shifts) |
|
|
17
17
|
| Opus 4.7 Migration Checklist | The required vs optional items for 4.7, tagged `[BLOCKS]` / `[TUNE]` |
|
|
18
|
+
| Migrating to Opus 4.8 | Migrating to Opus 4.8 (no new breaking changes; mid-session system prompts; behavioral re-tuning) |
|
|
19
|
+
| Opus 4.8 Migration Checklist | The required vs optional items for 4.8, tagged `[BLOCKS]` / `[TUNE]` |
|
|
18
20
|
| Verify the Migration | After edits — runtime spot-check |
|
|
19
21
|
|
|
20
22
|
**TL;DR:** Change the model ID string. If you were using `budget_tokens`, switch to `thinking: {type: "adaptive"}`. If you were using assistant prefills, they 400 on both Opus 4.6 and Sonnet 4.6 — switch to one of the prefill replacements (most often `output_config.format`; see the table in Breaking Changes by Source Model). If you're moving from Sonnet 4.5 to Sonnet 4.6, set `effort` explicitly — 4.6 defaults to `high`. Remove the `effort-2025-11-24` and `fine-grained-tool-streaming-2025-05-14` beta headers (GA on 4.6); remove `interleaved-thinking-2025-05-14` once you're on adaptive thinking (keep it only while using the transitional `budget_tokens` escape hatch). Then drop back from `client.beta.messages.create` to `client.messages.create`. Dial back any aggressive "CRITICAL: YOU MUST" tool instructions; 4.6 follows the system prompt much more closely.
|
|
@@ -173,12 +175,13 @@ If you're applying several prompt-tuning edits at once, offer them as a short li
|
|
|
173
175
|
|
|
174
176
|
| If you're on… | Migrate to | Why |
|
|
175
177
|
| ------------------------------------- | ------------------ | ------------------------------------------------- |
|
|
176
|
-
| Opus 4.
|
|
177
|
-
| Opus 4.
|
|
178
|
+
| Opus 4.7 | `claude-opus-4-8` | Most capable model; same API surface as 4.7 (no new breaking changes) — mostly prompt re-tuning; see Migrating to Opus 4.8 |
|
|
179
|
+
| Opus 4.6 | `claude-opus-4-8` | Apply the Opus 4.7 breaking changes, then the 4.8 re-tuning |
|
|
180
|
+
| Opus 4.0 / 4.1 / 4.5 / Opus 3 | `claude-opus-4-8` | Apply 4.6 → 4.7 → 4.8 in order (adaptive thinking, drop sampling params, then re-tune) |
|
|
178
181
|
| Sonnet 4.0 / 4.5 / 3.7 / 3.5 | `claude-sonnet-4-6`| Best speed / intelligence balance; adaptive thinking; 64K output |
|
|
179
182
|
| Haiku 3 / 3.5 | `claude-haiku-4-5` | Fastest and most cost-effective |
|
|
180
183
|
|
|
181
|
-
Default to the latest Opus for the caller's tier unless they explicitly chose otherwise.
|
|
184
|
+
Default to the latest Opus for the caller's tier unless they explicitly chose otherwise. The Opus migrations layer: if you're on Opus 4.6 or older, apply each version's section in order up to your target (e.g. 4.5 → 4.8 means the 4.6, 4.7, and 4.8 sections in sequence). A 4.7 → 4.8 move has no new breaking changes — see Migrating to Opus 4.8 below.
|
|
182
185
|
|
|
183
186
|
---
|
|
184
187
|
|
|
@@ -190,7 +193,7 @@ These models return 404 — update immediately:
|
|
|
190
193
|
| ----------------------------- | ------------- | -------------------- |
|
|
191
194
|
| `claude-3-7-sonnet-20250219` | Feb 19, 2026 | `claude-sonnet-4-6` |
|
|
192
195
|
| `claude-3-5-haiku-20241022` | Feb 19, 2026 | `claude-haiku-4-5` |
|
|
193
|
-
| `claude-3-opus-20240229` | Jan 5, 2026 | `claude-opus-4-
|
|
196
|
+
| `claude-3-opus-20240229` | Jan 5, 2026 | `claude-opus-4-8` |
|
|
194
197
|
| `claude-3-5-sonnet-20241022` | Oct 28, 2025 | `claude-sonnet-4-6` |
|
|
195
198
|
| `claude-3-5-sonnet-20240620` | Oct 28, 2025 | `claude-sonnet-4-6` |
|
|
196
199
|
| `claude-3-sonnet-20240229` | Jul 21, 2025 | `claude-sonnet-4-6` |
|
|
@@ -201,7 +204,7 @@ These models return 404 — update immediately:
|
|
|
201
204
|
| Model | Retires | Replacement |
|
|
202
205
|
| ----------------------------- | ------------- | -------------------- |
|
|
203
206
|
| `claude-3-haiku-20240307` | Apr 19, 2026 | `claude-haiku-4-5` |
|
|
204
|
-
| `claude-opus-4-20250514` | June 15, 2026 | `claude-opus-4-
|
|
207
|
+
| `claude-opus-4-20250514` | June 15, 2026 | `claude-opus-4-8` |
|
|
205
208
|
| `claude-sonnet-4-20250514` | June 15, 2026 | `claude-sonnet-4-6` |
|
|
206
209
|
|
|
207
210
|
---
|
|
@@ -470,14 +473,15 @@ If the model is now overtriggering a tool or skill, the fix is almost always to
|
|
|
470
473
|
|
|
471
474
|
| Old string (migration source) | New string |
|
|
472
475
|
| ------------------------------ | ------------------ |
|
|
473
|
-
| `claude-opus-4-
|
|
474
|
-
| `claude-opus-4-
|
|
475
|
-
| `claude-opus-4-
|
|
476
|
-
| `claude-opus-4-
|
|
476
|
+
| `claude-opus-4-7` | `claude-opus-4-8` |
|
|
477
|
+
| `claude-opus-4-6` | `claude-opus-4-8` |
|
|
478
|
+
| `claude-opus-4-5` | `claude-opus-4-8` |
|
|
479
|
+
| `claude-opus-4-1` | `claude-opus-4-8` |
|
|
480
|
+
| `claude-opus-4-0` | `claude-opus-4-8` |
|
|
477
481
|
| `claude-sonnet-4-5` | `claude-sonnet-4-6`|
|
|
478
482
|
| `claude-sonnet-4-0` | `claude-sonnet-4-6`|
|
|
479
483
|
|
|
480
|
-
Older aliases (`claude-opus-4-
|
|
484
|
+
Older aliases (`claude-opus-4-7`, `claude-opus-4-6`, `claude-opus-4-5`, `claude-sonnet-4-5`, etc.) are still active and can be pinned if you need time before upgrading — see `shared/models.md` for the full legacy list.
|
|
481
485
|
|
|
482
486
|
---
|
|
483
487
|
|
|
@@ -519,7 +523,7 @@ For cached prompts: the render order and hash inputs did not change, so existing
|
|
|
519
523
|
|
|
520
524
|
> **Model ID `claude-opus-4-7` is authoritative as written here.** When the user asks to migrate to Opus 4.7, write `model="claude-opus-4-7"` exactly. Do **not** WebFetch to verify — this guide is the source of truth for migration target IDs. The corresponding entry exists in `shared/models.md`.
|
|
521
525
|
|
|
522
|
-
Claude Opus 4.7
|
|
526
|
+
Claude Opus 4.7 was Anthropic's most capable model at its launch and is now the previous-generation Opus (Opus 4.8 is current — see Migrating to Opus 4.8 below). It is highly autonomous and performs exceptionally well on long-horizon agentic work, knowledge work, vision tasks, and memory tasks. This section summarizes everything that was new at the 4.7 launch and remains the layered breaking-change path for callers coming from Opus 4.6 or older. It is layered on top of the 4.6 migration above — if the caller is jumping from Opus 4.5 or older, apply the 4.6 changes first, then this section, then the 4.8 section.
|
|
523
527
|
|
|
524
528
|
**TL;DR for someone already on Opus 4.6:** update the model ID to `claude-opus-4-7`, strip any remaining `budget_tokens` and sampling parameters (both 400 on Opus 4.7), give `max_tokens` extra headroom and re-baseline with `count_tokens()` against the new model, opt back into `thinking.display: "summarized"` if reasoning is surfaced to users, and re-tune `effort` — it matters more on 4.7 than on any prior Opus.
|
|
525
529
|
|
|
@@ -758,12 +762,108 @@ Every item is tagged: **`[BLOCKS]`** items cause a 400 error, infinite loop, sil
|
|
|
758
762
|
|
|
759
763
|
---
|
|
760
764
|
|
|
765
|
+
## Migrating to Opus 4.8
|
|
766
|
+
|
|
767
|
+
> **Model ID `claude-opus-4-8` is authoritative as written here.** When the user asks to migrate to Opus 4.8, write `model="claude-opus-4-8"` exactly. Do **not** WebFetch to verify — this guide is the source of truth for migration target IDs. The corresponding entry exists in `shared/models.md`.
|
|
768
|
+
|
|
769
|
+
Claude Opus 4.8 is our most capable generally available model to date — highly autonomous, with state-of-the-art long-horizon agentic execution, knowledge work, and memory. It is layered on top of the Opus 4.7 migration above. If the caller is jumping from Opus 4.6 or older, apply the 4.6 and 4.7 sections first, then this one.
|
|
770
|
+
|
|
771
|
+
**No new breaking changes.** Opus 4.8 keeps the same request surface as Opus 4.7. The same calls that already work on 4.7 work unchanged on 4.8 — adaptive thinking only (`thinking: {type: "enabled", budget_tokens: N}` still 400s; use `{type: "adaptive"}`), sampling parameters (`temperature`, `top_p`, `top_k`) still rejected, last-assistant-turn prefills still 400, `thinking.display` still defaults to `"omitted"`, and the `low`/`medium`/`high`/`xhigh`/`max` effort levels, Task Budgets (beta), and high-resolution vision all behave as on 4.7. A 4.7 → 4.8 migration is therefore **the model-ID swap plus prompt re-tuning** — there is no required code edit beyond the model string.
|
|
772
|
+
|
|
773
|
+
**TL;DR for someone already on Opus 4.7:** swap the model ID to `claude-opus-4-8`. Nothing else is required to avoid an error. Then re-tune prompts for the behavioral shifts: 4.8 narrates *more* than 4.7 (add a silence-default if you want 4.7-like terseness), writes in a warmer, less hedged voice, is more deliberate and asks more often (add autonomy guidance to claw back ask-rate), and is more conservative about reaching for search, subagents, file-based memory, and custom tools (add explicit "when to use this" triggering). For long-horizon agentic work, give the full task specification up front in one well-specified turn and run at high effort.
|
|
774
|
+
|
|
775
|
+
### No new API breaking changes (inherited from 4.7)
|
|
776
|
+
|
|
777
|
+
These all carry over from Opus 4.7 unchanged — apply them only if the caller is coming from Opus 4.6 or earlier (see the **Migrating to Opus 4.7** section above for the before/after and the SDK-specific syntax):
|
|
778
|
+
|
|
779
|
+
- `thinking: {type: "enabled", budget_tokens: N}` → 400. Use `thinking: {type: "adaptive"}` + `output_config.effort`.
|
|
780
|
+
- `temperature`, `top_p`, `top_k` → 400. Remove them; steer with prompting.
|
|
781
|
+
- Last-assistant-turn prefills → 400. Use `output_config.format` (structured outputs) or a system-prompt instruction.
|
|
782
|
+
- `thinking.display` defaults to `"omitted"`; set `"summarized"` if you surface reasoning to users.
|
|
783
|
+
|
|
784
|
+
If the caller is already on Opus 4.7 and these are clean, there is nothing to change here.
|
|
785
|
+
|
|
786
|
+
### New API feature: mid-session system prompts
|
|
787
|
+
|
|
788
|
+
You can deliver trusted instructions partway through a session by placing `{"role": "system", ...}` entries directly in the `messages` array — without editing the top-level system prompt and invalidating your prompt cache. Use it for things the application learns mid-session: the user delivered async context, a mode toggled (auto-approve enabled), files changed on disk, the remaining token budget dropped.
|
|
789
|
+
|
|
790
|
+
```python
|
|
791
|
+
messages=[
|
|
792
|
+
{"role": "user", "content": [{"type": "tool_result", "tool_use_id": "...", "content": "..."}]},
|
|
793
|
+
{"role": "system", "content": "This project's codebase is Go. Write code in Go."},
|
|
794
|
+
]
|
|
795
|
+
```
|
|
796
|
+
|
|
797
|
+
Phrase these as **context, not commands**. State the fact and let Claude act on it; avoid override-style language ("ignore what the user said", "regardless of the user's request", "disregard the previous instruction"). Claude is trained to protect users from instructions that appear to work against them, and that protection applies to the system role too. This is a beta (`anthropic-beta: mid-conversation-system-2026-04-07`) and is available from Opus 4.7 onward, not 4.8-exclusive. For cache-placement details and the older-model `<system-reminder>` fallback, see `shared/prompt-caching.md` and `shared/agent-design.md`.
|
|
798
|
+
|
|
799
|
+
### Capability improvements
|
|
800
|
+
|
|
801
|
+
**Long-horizon agentic execution.** Opus 4.8 is state-of-the-art at long, autonomous agentic work — complex refactors and overnight coding runs that complete without human correction. To get the most out of it, **give the full task specification up front in a single well-specified initial turn and run at high effort** (`effort: "high"` or `"xhigh"`). Its long-horizon coherence comes partly from reasoning more at each step; combined with a clear up-front goal, that more-intelligent planning often produces more efficient *and* more accurate output than prior frontier models. The "clear goal up front" principle maps to two product surfaces: in Claude Code, `/goal` sets direction for the run; with **Managed Agents (CMA)**, state what "done" looks like via an **Outcome** (`user.define_outcome` with a gradeable rubric — the harness runs an iterate → grade → revise loop), see `shared/managed-agents-outcomes.md`.
|
|
802
|
+
|
|
803
|
+
**Effort is a dimension to test, not a fixed setting.** On prior models many reached for `xhigh` reflexively to maximize intelligence. Opus 4.8 has a higher intelligence ceiling, so **start at `high` as the default and iterate** rather than defaulting to `xhigh`. Sweep `medium`, `high`, and `xhigh` on your own eval set and weigh the intelligence ↔ latency ↔ cost tradeoff per route — the relationship isn't monotonic: higher effort up front often *reduces* turn count and total cost on agentic work, while for some tasks `medium` delivers equally good results in less time. Reserve `max` for extremely hard, latency-insensitive cases. The per-level effort table in the **Migrating to Opus 4.7** section above applies unchanged on 4.8.
|
|
804
|
+
|
|
805
|
+
**Writing voice and clarity.** Testers consistently describe 4.8's prose as clearer, warmer, and less hedged than prior models, with fewer measurable AI vocal tics — especially at higher effort, where it approaches expert-level prose and structure. This is roughly the **opposite** direction from the 4.7 shift (4.7 was more clipped, direct, and less validation-forward). If you added style prompts to counter 4.7's terseness or to inject warmth, re-evaluate them against the new baseline before keeping them — they may now overcorrect. 4.8 is also a stronger thought partner: more thoughtful, more willing to push back, and more likely to infer the right answer from context.
|
|
806
|
+
|
|
807
|
+
**Code review and debugging.** Stronger real-bug finding and clearer explanations than 4.7 — one-shot fixes where 4.7 needed more, and correctly identifying intermittent flakes rather than declaring "fixed" after one clean run. The 4.7 caveat still applies: if a review harness says "only report high-severity issues" or "be conservative", 4.8 follows it literally and measured recall can drop even though underlying bug-finding improved. Tell the model to report everything and filter downstream (or review a second time) — see the **Code review** guidance in the 4.7 section for the recommended prompt.
|
|
808
|
+
|
|
809
|
+
### Behavioral shifts (prompt-tunable)
|
|
810
|
+
|
|
811
|
+
None of these break code, but prompts tuned for Opus 4.7 may land differently. 4.8 follows instructions well, so small, explicit nudges close the gap.
|
|
812
|
+
|
|
813
|
+
**Tool triggering is surface-dependent (search & knowledge).** 4.8's tool-triggering is more surface-dependent than in prior models: with a system prompt present it is high-precision / low-recall — web search triggers slightly more often but runs fewer rounds per trigger, while knowledge-retrieval tools (Drive, project knowledge, connected files) trigger *less* often. It searches when it's confident search is needed and otherwise answers from context, which can lower research depth on tasks that need it. Recover should-search rate with an explicit search-first instruction:
|
|
814
|
+
|
|
815
|
+
> ```
|
|
816
|
+
> <search_first>
|
|
817
|
+
> For questions where current information would change the answer (recent events, current roles or prices, version-specific behavior, or anything the user flags as time-sensitive) search before answering rather than answering from memory. For open-ended research requests, begin searching immediately; do not ask a scoping question first unless the request is genuinely ambiguous about what to research.
|
|
818
|
+
> </search_first>
|
|
819
|
+
> ```
|
|
820
|
+
|
|
821
|
+
**Under-utilization of subagents, memory, and custom tools.** Separately from search, 4.8 is conservative about reaching for capabilities that need an explicit "decide to use this" step — file-based memory, subagent delegation, custom tools. It won't reach for complex or expensive capabilities unless reasonably sure they're needed. This is steerable since 4.8 follows instructions well — say *when* each capability applies, not just that it exists:
|
|
822
|
+
|
|
823
|
+
> *"Before any task longer than a few turns, check your memory file for relevant prior context and write new findings to it as you go. When a task fans out across independent items (many files to read, many tests to run, many candidates to check), delegate to subagents rather than iterating serially."*
|
|
824
|
+
|
|
825
|
+
The same lever works at the **tool-description** level, not just the system prompt: prescriptive descriptions that state *when* to call a tool (e.g. "Call this when the user asks about current prices or recent events") give meaningful lift on 4.8 over descriptions that only state what the tool does. Make the trigger condition part of each capability's own `description`.
|
|
826
|
+
|
|
827
|
+
**More user-facing narration.** 4.8 narrates more than 4.7 — more text between tool calls in long tool-calling sessions, and longer, more detailed end-of-task wrap-ups by default. If you previously added scaffolding to force interim status ("after every 3 tool calls, summarize progress"), **remove it** — 4.8 does this on its own. If the narration is too verbose for a coding agent, an explicit silence-default makes it behave like 4.7 with no loss of quality:
|
|
828
|
+
|
|
829
|
+
> *"Default to silence between tool calls. Only write text when you find something, change direction, or hit a blocker — one sentence each. Do not narrate routine actions ('Now I'll...', 'Let me check...', 'Looking at...'). When done: one or two sentences on the outcome. Do not recap every file or test — the user has been following along."*
|
|
830
|
+
|
|
831
|
+
For knowledge-work deliverables (reports, analysis readouts), verbosity responds very well to instructions in user preferences or the user turn — expose a verbosity preference rather than hard-coding a length.
|
|
832
|
+
|
|
833
|
+
**More deliberate — asks more often.** 4.8 is more deliberate than prior Opus models. On minor decisions it would previously just make (a variable name, a default value, which of two equivalent approaches), it tends to pause and ask, and it often closes a completed task with "Want me to also…?" rather than doing the obvious next step or stopping cleanly. This is preferred for high-stakes or unfamiliar codebases, but bugs users when uncalibrated. Grant autonomy on the small stuff while keeping caution where it matters (in Claude Code testing this cut ask-rate by ~12 percentage points with no increase in over-reach):
|
|
834
|
+
|
|
835
|
+
> *"For minor choices (naming, formatting, default values, which approach among equivalents), pick a reasonable option and note it rather than asking. For scope changes or destructive actions, still ask first."*
|
|
836
|
+
|
|
837
|
+
**Verbose reasoning when thinking is disabled.** With `thinking: {type: "disabled"}`, 4.8 occasionally writes longer explanations of its reasoning into the visible response, which reads as verbose when the user wants a fast, quick answer. The simplest fix is to leave adaptive thinking on — set `thinking: {type: "adaptive"}` (the recommended setting; it adjusts how much to think per task). Note adaptive is **not** on when the field is omitted — like Opus 4.7, a request with no `thinking` field runs without thinking, so set it explicitly. If you need thinking off for latency or cost, scope it in the system prompt:
|
|
838
|
+
|
|
839
|
+
> *"Respond only with your final answer. Do not include exploratory reasoning, intermediate drafts, diffs you considered but rejected, or meta-commentary about your process."*
|
|
840
|
+
|
|
841
|
+
### Opus 4.8 Migration Checklist
|
|
842
|
+
|
|
843
|
+
Every item is tagged: **`[BLOCKS]`** items cause a 400 error if missed; **`[TUNE]`** items are quality/cost adjustments — surface them to the user as recommendations.
|
|
844
|
+
|
|
845
|
+
For a caller **already on Opus 4.7**, only the first item is required; everything else is `[TUNE]`. The conditional `[BLOCKS]` item applies only when coming from Opus 4.6 or earlier.
|
|
846
|
+
|
|
847
|
+
- [ ] **[BLOCKS]** Update the `model=` string to `claude-opus-4-8`
|
|
848
|
+
- [ ] **[BLOCKS]** *(only if coming from Opus 4.6 or earlier)* Apply the **Migrating to Opus 4.7** breaking changes first — `budget_tokens` → adaptive thinking, strip `temperature`/`top_p`/`top_k`, remove last-assistant-turn prefills. These already 400 on 4.7 and continue to 400 on 4.8.
|
|
849
|
+
- [ ] **[TUNE]** Long-horizon / agentic work: put the full task spec in one well-specified first turn and run at `high` or `xhigh` effort (Claude Code: `/goal`; Managed Agents: an Outcome with a gradeable rubric)
|
|
850
|
+
- [ ] **[TUNE]** Effort: sweep `medium` / `high` / `xhigh` on your eval set and pick per route by the intelligence ↔ latency ↔ cost tradeoff (default `high`, `xhigh` for coding/agentic)
|
|
851
|
+
- [ ] **[TUNE]** Research depth & tool use: add a search-first instruction; add explicit triggering guidance for subagents, file-based memory, and custom tools (4.8 under-reaches for these by default) — in the system prompt *and* in each tool's own `description` (prescriptive "call this when…" descriptions give measurable lift)
|
|
852
|
+
- [ ] **[TUNE]** Narration: remove forced-progress scaffolding (*"after every N tool calls…"*); add a silence-default if a coding agent is too chatty
|
|
853
|
+
- [ ] **[TUNE]** Autonomy: add small-decisions-don't-ask guidance to cut ask-rate, while keeping caution on scope changes / destructive actions
|
|
854
|
+
- [ ] **[TUNE]** Writing voice: re-evaluate style prompts added to counter 4.7's directness — 4.8 is warmer and less hedged by default; re-baseline before keeping them
|
|
855
|
+
- [ ] **[TUNE]** Code-review harnesses: keep the report-everything-filter-downstream pattern (4.8 follows "only high-severity" / "be conservative" filters literally, which can depress measured recall)
|
|
856
|
+
- [ ] **[TUNE]** Thinking-disabled paths: add a final-answer-only instruction if reasoning leaks into the visible response
|
|
857
|
+
- [ ] **[TUNE]** Consider mid-session system messages (`role:"system"` in `messages`, beta `mid-conversation-system-2026-04-07`) for context the app learns mid-session, instead of rebuilding the top-level system prompt and invalidating the cache
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
761
861
|
## Verify the Migration
|
|
762
862
|
|
|
763
|
-
After updating, spot-check that the new model is actually being used. Replace `YOUR_TARGET_MODEL` with the model string you migrated to (e.g. `claude-opus-4-
|
|
863
|
+
After updating, spot-check that the new model is actually being used. Replace `YOUR_TARGET_MODEL` with the model string you migrated to (e.g. `claude-opus-4-8`, `claude-opus-4-7`, `claude-sonnet-4-6`, `claude-haiku-4-5`) and keep the assertion prefix in sync:
|
|
764
864
|
|
|
765
865
|
```python
|
|
766
|
-
YOUR_TARGET_MODEL = "claude-opus-4-
|
|
866
|
+
YOUR_TARGET_MODEL = "claude-opus-4-8" # or "claude-opus-4-7", "claude-sonnet-4-6", "claude-haiku-4-5"
|
|
767
867
|
response = client.messages.create(model=YOUR_TARGET_MODEL, max_tokens=64, messages=[...])
|
|
768
868
|
assert response.model.startswith(YOUR_TARGET_MODEL), response.model
|
|
769
869
|
```
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
For **live** capability data — context window, max output tokens, feature support (thinking, vision, effort, structured outputs, etc.) — query the Models API instead of relying on the cached tables below. Use this when the user asks "what's the context window for X", "does model X support vision/thinking/effort", "which models support feature Y", or wants to select a model by capability at runtime.
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
|
-
m = client.models.retrieve("claude-opus-4-
|
|
11
|
-
m.id # "claude-opus-4-
|
|
12
|
-
m.display_name # "Claude Opus 4.
|
|
10
|
+
m = client.models.retrieve("claude-opus-4-8")
|
|
11
|
+
m.id # "claude-opus-4-8"
|
|
12
|
+
m.display_name # "Claude Opus 4.8"
|
|
13
13
|
m.max_input_tokens # context window (int)
|
|
14
14
|
m.max_tokens # max output tokens (int)
|
|
15
15
|
|
|
@@ -32,16 +32,16 @@ Top-level fields (`id`, `display_name`, `max_input_tokens`, `max_tokens`) are ty
|
|
|
32
32
|
### Raw HTTP
|
|
33
33
|
|
|
34
34
|
```bash
|
|
35
|
-
curl https://api.anthropic.com/v1/models/claude-opus-4-
|
|
35
|
+
curl https://api.anthropic.com/v1/models/claude-opus-4-8 \
|
|
36
36
|
-H "x-api-key: $ANTHROPIC_API_KEY" \
|
|
37
37
|
-H "anthropic-version: 2023-06-01"
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
```json
|
|
41
41
|
{
|
|
42
|
-
"id": "claude-opus-4-
|
|
43
|
-
"display_name": "Claude Opus 4.
|
|
44
|
-
"max_input_tokens":
|
|
42
|
+
"id": "claude-opus-4-8",
|
|
43
|
+
"display_name": "Claude Opus 4.8",
|
|
44
|
+
"max_input_tokens": 1000000,
|
|
45
45
|
"max_tokens": 128000,
|
|
46
46
|
"capabilities": {
|
|
47
47
|
"image_input": {"supported": true},
|
|
@@ -57,14 +57,16 @@ curl https://api.anthropic.com/v1/models/claude-opus-4-7 \
|
|
|
57
57
|
|
|
58
58
|
| Friendly Name | Alias (use this) | Full ID | Context | Max Output | Status |
|
|
59
59
|
|-------------------|---------------------|-------------------------------|----------------|------------|--------|
|
|
60
|
+
| Claude Opus 4.8 | `claude-opus-4-8` | — | 1M | 128K | Active |
|
|
60
61
|
| Claude Opus 4.7 | `claude-opus-4-7` | — | 1M | 128K | Active |
|
|
61
62
|
| Claude Opus 4.6 | `claude-opus-4-6` | — | 1M | 128K | Active |
|
|
62
63
|
| Claude Sonnet 4.6 | `claude-sonnet-4-6` | - | 1M | 64K | Active |
|
|
63
64
|
| Claude Haiku 4.5 | `claude-haiku-4-5` | `claude-haiku-4-5-20251001` | 200K | 64K | Active |
|
|
64
65
|
|
|
65
66
|
### Model Descriptions
|
|
66
|
-
- **Claude Opus 4.
|
|
67
|
-
- **Claude Opus 4.
|
|
67
|
+
- **Claude Opus 4.8** — The most capable Claude model to date — highly autonomous, state-of-the-art on long-horizon agentic work, knowledge work, and memory; clearer, warmer writing. Same API surface as Opus 4.7 (adaptive thinking only; sampling parameters and `budget_tokens` removed). 1M context window at standard API pricing (no long-context premium). See `shared/model-migration.md` → Migrating to Opus 4.8 — a 4.7 → 4.8 move is a model-ID swap plus prompt re-tuning, no new breaking changes.
|
|
68
|
+
- **Claude Opus 4.7** — Previous-generation Opus. Highly autonomous; strong on long-horizon agentic work, knowledge work, vision, and memory. Adaptive thinking only; sampling parameters and `budget_tokens` removed. 1M context window. See `shared/model-migration.md` → Migrating to Opus 4.7.
|
|
69
|
+
- **Claude Opus 4.6** — Older Opus. Supports adaptive thinking (recommended), 128K max output tokens (requires streaming for large outputs). 1M context window.
|
|
68
70
|
- **Claude Sonnet 4.6** — Our best combination of speed and intelligence. Supports adaptive thinking (recommended). 1M context window. 64K max output tokens.
|
|
69
71
|
- **Claude Haiku 4.5** — Fastest and most cost-effective model for simple tasks.
|
|
70
72
|
|
|
@@ -103,12 +105,13 @@ When a user asks for a model by name, use this table to find the correct model I
|
|
|
103
105
|
|
|
104
106
|
| User says... | Use this model ID |
|
|
105
107
|
|-------------------------------------------|--------------------------------|
|
|
106
|
-
| "opus", "most powerful" | `claude-opus-4-
|
|
108
|
+
| "opus", "most powerful" | `claude-opus-4-8` |
|
|
109
|
+
| "opus 4.8" | `claude-opus-4-8` |
|
|
107
110
|
| "opus 4.7" | `claude-opus-4-7` |
|
|
108
111
|
| "opus 4.6" | `claude-opus-4-6` |
|
|
109
112
|
| "opus 4.5" | `claude-opus-4-5` |
|
|
110
113
|
| "opus 4.1" | `claude-opus-4-1` |
|
|
111
|
-
| "opus 4", "opus 4.0" | `claude-opus-4-0`
|
|
114
|
+
| "opus 4", "opus 4.0" | `claude-opus-4-0` (deprecated — suggest `claude-opus-4-8`) |
|
|
112
115
|
| "sonnet", "balanced" | `claude-sonnet-4-6` |
|
|
113
116
|
| "sonnet 4.6" | `claude-sonnet-4-6` |
|
|
114
117
|
| "sonnet 4.5" | `claude-sonnet-4-5` |
|
|
@@ -111,11 +111,11 @@ Fix by moving the dynamic piece after the last breakpoint, making it determinist
|
|
|
111
111
|
|
|
112
112
|
| Model | Minimum |
|
|
113
113
|
|---|---:|
|
|
114
|
-
| Opus 4.7, Opus 4.6, Opus 4.5, Haiku 4.5 | 4096 tokens |
|
|
114
|
+
| Opus 4.8, Opus 4.7, Opus 4.6, Opus 4.5, Haiku 4.5 | 4096 tokens |
|
|
115
115
|
| Sonnet 4.6, Haiku 3.5, Haiku 3 | 2048 tokens |
|
|
116
116
|
| Sonnet 4.5, Sonnet 4.1, Sonnet 4, Sonnet 3.7 | 1024 tokens |
|
|
117
117
|
|
|
118
|
-
A 3K-token prompt caches on Sonnet 4.5 but silently won't on Opus 4.
|
|
118
|
+
A 3K-token prompt caches on Sonnet 4.5 but silently won't on Opus 4.8.
|
|
119
119
|
|
|
120
120
|
**Economics:** Cache reads cost ~0.1× base input price. Cache writes cost **1.25× for 5-minute TTL, 2× for 1-hour TTL**. Break-even depends on TTL: with 5-minute TTL, two requests break even (1.25× + 0.1× = 1.35× vs 2× uncached); with 1-hour TTL, you need at least three requests (2× + 0.2× = 2.2× vs 3× uncached). The 1-hour TTL keeps entries alive across gaps in bursty traffic, but the doubled write cost means it needs more reads to pay off.
|
|
121
121
|
|
|
@@ -35,7 +35,7 @@ Each tool requires a name, description, and JSON Schema for its inputs:
|
|
|
35
35
|
**Best practices for tool definitions:**
|
|
36
36
|
|
|
37
37
|
- Use clear, descriptive names (e.g., `get_weather`, `search_database`, `send_email`)
|
|
38
|
-
- Write detailed descriptions — Claude uses these to decide when to use the tool
|
|
38
|
+
- Write detailed descriptions — Claude uses these to decide when to use the tool. Be **prescriptive about *when* to call it**, not just what it does (e.g. "Call this when the user asks about current prices or recent events"). On recent Opus models, which reach for tools more conservatively, trigger conditions in the description give measurable lift in should-call rate.
|
|
39
39
|
- Include descriptions for each property
|
|
40
40
|
- Use `enum` for parameters with a fixed set of values
|
|
41
41
|
- Mark truly required parameters in `required`; make others optional with defaults
|
|
@@ -74,7 +74,7 @@ if response.stop_reason == "pause_turn":
|
|
|
74
74
|
]
|
|
75
75
|
# Make another API request — server resumes automatically
|
|
76
76
|
response = client.messages.create(
|
|
77
|
-
model="claude-opus-4-
|
|
77
|
+
model="claude-opus-4-8", messages=messages, tools=tools
|
|
78
78
|
)
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -171,7 +171,7 @@ Web search and web fetch let Claude search the web and retrieve page content. Th
|
|
|
171
171
|
]
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
### Dynamic Filtering (Opus 4.7 / Opus 4.6 / Sonnet 4.6)
|
|
174
|
+
### Dynamic Filtering (Opus 4.8 / Opus 4.7 / Opus 4.6 / Sonnet 4.6)
|
|
175
175
|
|
|
176
176
|
The `web_search_20260209` and `web_fetch_20260209` versions support **dynamic filtering** — Claude writes and executes code to filter search results before they reach the context window, improving accuracy and token efficiency. Dynamic filtering is built into these tool versions and activates automatically; you do not need to separately declare the `code_execution` tool or pass any beta header.
|
|
177
177
|
|
|
@@ -280,7 +280,7 @@ Two features are available:
|
|
|
280
280
|
- **JSON outputs** (`output_config.format`): Control Claude's response format
|
|
281
281
|
- **Strict tool use** (`strict: true`): Guarantee valid tool parameter schemas
|
|
282
282
|
|
|
283
|
-
**Supported models:** Claude Opus 4.
|
|
283
|
+
**Supported models:** Claude Opus 4.8, Claude Sonnet 4.6, and Claude Haiku 4.5. Legacy models (Claude Opus 4.5, Claude Opus 4.1) also support structured outputs.
|
|
284
284
|
|
|
285
285
|
> **Recommended:** Use `client.messages.parse()` which automatically validates responses against your schema. When using `messages.create()` directly, use `output_config: {format: {...}}`. The `output_format` convenience parameter is also accepted by some SDK methods (e.g., `.parse()`), but `output_config.format` is the canonical API-level parameter.
|
|
286
286
|
|