{
  "description": "The Fable Cookbook as data — six task-pattern recipes for claude-fable-5. Each entry has the human page and the load-bearing facts.",
  "model_id": "claude-fable-5",
  "recipes": [
    {
      "id": "migrate-from-opus",
      "url": "https://fableguide.com/cookbook/migrate-from-opus.html",
      "summary": "From Opus 4.7/4.8: swap the model string; one new rule — explicit thinking:{type:'disabled'} returns 400, omit the field instead. From 4.6 or older: also remove temperature/top_p/top_k, replace budget_tokens with adaptive thinking, replace prefills with output_config.format, stream above ~16K output.",
      "after_migrating": ["Sweep effort medium/high/xhigh on your own evals", "Re-baseline with count_tokens() — no blanket multiplier", "Model swap invalidates prompt cache (expected)", "Set thinking.display:'summarized' if users see reasoning"]
    },
    {
      "id": "agentic-loops",
      "url": "https://fableguide.com/cookbook/agentic-loops.html",
      "summary": "Tool runner (client.beta.messages.tool_runner with @beta_tool functions) for the automatic loop; manual loop checking stop_reason end_turn/pause_turn/tool_use for approval gates. pause_turn: append assistant content and re-send, no extra user message.",
      "key_facts": ["Fable triggers tools conservatively — put WHEN-to-call conditions in tool descriptions", "effort high/xhigh increases tool usage", "10-20 tools beat 200", "Always json-parse tool input, never string-match"]
    },
    {
      "id": "structured-outputs",
      "url": "https://fableguide.com/cookbook/structured-outputs.html",
      "summary": "client.messages.parse(output_format=PydanticModel) → response.parsed_output; or output_config.format with type json_schema. strict:true on tool definitions guarantees tool input matches schema. This replaces prefills (which 400).",
      "key_facts": ["additionalProperties:false required on every object", "No recursive schemas, no min/max constraints", "New schema = one-time compile cost, cached 24h", "Incompatible with citations"]
    },
    {
      "id": "prompt-caching",
      "url": "https://fableguide.com/cookbook/prompt-caching.html",
      "summary": "Prefix match: tools → system → messages; any byte change invalidates everything after it. cache_control:{type:'ephemeral'} on the last stable block; verify via usage.cache_read_input_tokens.",
      "key_facts": ["Fable minimum cacheable prefix: 2048 tokens (silent no-op below)", "Reads ~0.1x, 5-min writes 1.25x — 2 requests break even", "Max 4 breakpoints", "Silent invalidators: timestamps, unsorted json.dumps, per-user IDs early, varying tool sets"]
    },
    {
      "id": "memory-files",
      "url": "https://fableguide.com/cookbook/memory-files.html",
      "summary": "Client-side memory tool {type:'memory_20250818', name:'memory'}; SDK helper BetaAbstractMemoryTool (view/create/str_replace/insert/delete/rename). Fable improved 3x more than Opus 4.8 when given file memory (Slay the Spire).",
      "key_facts": ["Unlock is the system prompt: tell it WHEN to check/write memory", "Many small topic files beat one log", "Never store secrets; per-user dirs in multi-user systems"]
    },
    {
      "id": "task-budgets",
      "url": "https://fableguide.com/cookbook/task-budgets.html",
      "summary": "Beta task-budgets-2026-03-13: output_config.task_budget {type:'tokens', total:N} — a visible token allowance for the whole agentic loop that the model self-paces against. max_tokens stays the hard per-response cap.",
      "key_facts": ["Minimum total: 20000", "Too tight → less thorough completion, model cites budget", "Measure unbudgeted first, then set from usage data"]
    }
  ],
  "quickstart": "https://fableguide.com/api/quickstart.json",
  "last_verified": "2026-06-10"
}
