mirror of
https://github.com/anthropics/skills
synced 2026-12-03 04:10:48 +00:00
Update claude-api skill: build-eval and hillclimb guides, eager input streaming, platform availability refresh
- Add shared/evals/: build-eval, eval-hillclimb, cost-hillclimb, and eval-audit guides, plus the report schema, runner scaffold, and lite report builder - Default to eager_input_streaming for streaming client tools; default to outcomes for deliverable-shaped Managed Agents work - Model access errors are 404 and beta gating is 400, not 403 - Point cost-optimize at cache diagnostics when the prompt cache misses - Use current-generation model ids in Go/Java/C# samples - Refresh platform availability and model-support claims; repoint dead live-sources URLs
This commit is contained in:
@@ -173,7 +173,7 @@ Automatic is the right default for multi-turn conversations - the multi-turn pla
|
||||
| A single turn appends more than 20 positions (consecutive tool_use runs, and tool_result runs, each collapse to one position) | The lookback can miss the previous entry - § 20-block lookback window. |
|
||||
| A platform or integration without automatic caching (check `shared/platform-availability.md`) | The top-level field is rejected there - use explicit markers only. |
|
||||
|
||||
**The robust combination for agent loops:** one explicit breakpoint on the last block of the static system prefix - the expensive shared part gets a guaranteed read point that survives whatever happens later in `messages` - plus top-level automatic caching for the growing conversation tail (where automatic caching is available - `shared/platform-availability.md`).
|
||||
**The robust combination for agent loops:** one explicit breakpoint on the last block of the static system prefix - the expensive shared part gets a guaranteed read point that survives whatever happens later in `messages` - plus top-level automatic caching for the growing conversation tail (where automatic caching is available - `shared/platform-availability.md`). If § Choosing the TTL puts you on the 1-hour TTL, set `ttl: "1h"` on the explicit marker as well as on the top-level field. Both default to 5 minutes, and a 1-hour automatic entry after a 5-minute marker breaks the ordering rule above: longer TTLs must come first. The reverse, a 1-hour marker with a 5-minute tail, is allowed.
|
||||
|
||||
---
|
||||
|
||||
@@ -229,7 +229,7 @@ Implication: you can change `tool_choice` per-request without losing the tools+s
|
||||
|
||||
| Top-level change that invalidates | Cache-preserving form | Available on |
|
||||
|---|---|---|
|
||||
| Tool definitions (add/remove) | `tool_addition` / `tool_removal` blocks - see `shared/tool-use-concepts.md` § Mid-conversation tool changes | Claude Opus 5 onward, behind `mid-conversation-tool-changes-2026-07-01` |
|
||||
| Tool definitions (add/remove) | `tool_addition` / `tool_removal` blocks - see `shared/tool-use-concepts.md` § Mid-conversation tool changes | Claude Opus 5, Claude Opus 4.8, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5, Claude Mythos 5.1 (not Claude Sonnet 5), behind `mid-conversation-tool-changes-2026-07-01` |
|
||||
| System prompt content | A `{"role": "system", "content": "..."}` message - see § Mid-conversation system messages above | Claude Opus 5, Claude Opus 4.8, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5, Claude Mythos 5.1 - **already available today**, no beta header |
|
||||
| Per-turn reminder (inject, then delete next request) | A turn-scoped `clear_at: "next_user_message"` system message, left in the transcript - see § Mid-conversation system messages above (without the beta: a text block after the `tool_result` blocks, earlier copies kept) | Same models as mid-conversation system messages, behind `mid-conversation-system-clear-at-2026-08-21` |
|
||||
| `effort` change | A `{"role": "system", "content": [], "output_config": {"effort": ...}}` message - see `shared/model-migration.md` -> Migrating to Claude Fable 5.1 from Claude Fable 5 | Claude Fable 5.1, Claude Mythos 5.1, Claude Opus 5, behind `mid-conversation-output-config-2026-07-01` |
|
||||
@@ -276,6 +276,9 @@ To eliminate the cache-miss latency on the *first* real request, send a **`max_t
|
||||
client.messages.create(
|
||||
model="claude-opus-5",
|
||||
max_tokens=0,
|
||||
# Example values - send the same thinking and effort settings as your real traffic (see below)
|
||||
thinking={"type": "adaptive"},
|
||||
output_config={"effort": "high"},
|
||||
system=[{
|
||||
"type": "text",
|
||||
"text": SYSTEM_PROMPT,
|
||||
@@ -287,6 +290,8 @@ client.messages.create(
|
||||
|
||||
**Breakpoint placement:** put `cache_control` on the **last block shared with the real request** (the system prompt or tool definitions) - **not** on the placeholder user message, and **not** via top-level automatic caching (which would key the cache to the placeholder). The placeholder can be any non-whitespace string; it's read during prefill but never answered.
|
||||
|
||||
**Match the real traffic's thinking and effort settings.** Both are rendered into the prompt (see § Invalidation hierarchy), so a pre-warm with different settings can write a cache entry your real traffic never hits. For adaptive-thinking traffic, send the same `thinking` and `effort` values in the pre-warm. Traffic that uses extended thinking (`thinking.type: "enabled"`, accepted only on Claude 4.6 and earlier models and on Claude Mythos Preview) can't be matched, because `max_tokens: 0` rejects that setting (see Rejected combinations below). Whether a pre-warm still helps that traffic depends on where the model renders the thinking configuration, which the docs don't state per model - check `cache_read_input_tokens` on the first real request.
|
||||
|
||||
**Rejected combinations:** `max_tokens: 0` is an `invalid_request_error` with `stream: true`, `thinking.type: "enabled"`, `output_config.format`, `tool_choice` of `{"type":"tool"}` or `{"type":"any"}`, or inside a Message Batches request.
|
||||
|
||||
**TTL still applies** - re-warm at least every 5 minutes for the default cache, or use the 1-hour TTL. This replaces the older `max_tokens: 1` workaround (no single-token reply to discard, no output tokens billed, intent is unambiguous).
|
||||
|
||||
Reference in New Issue
Block a user