Skip to content

Claude Cookbook: What Actually Works (2026 Guide)

Anthropic's Claude Cookbook just hit HN's front page. Here's what's actually in it, which recipes matter, and where the official examples fall short.

7 min readBeginner

Hot take: most people reading the Claude Cookbook right now are reading the wrong half of it. The 2023-2024 recipes on chain-of-thought and JSON mode aren’t tutorials anymore – they’re archaeology. The stuff that matters was added in the last six months, and half of it doesn’t work the way the intro examples suggest.

The Cookbook resurfaced on Hacker News last week and predictably split the room. The thread hit 223 points and 117 comments, with one camp calling it theatre (because Anthropic bakes anything useful into the next model release) and the other camp defending it as the only way to discover features you didn’t know existed. Both are right. This guide is for people in the second camp who don’t want to waste a weekend on outdated recipes.

The problem: the Cookbook has two front doors and neither is complete

First gotcha nobody flags: there are now two places to read the Cookbook, and they don’t fully agree. January 7, 2026 – Anthropic launched a rendered web version at platform.claude.com/cookbook, searchable and category-tagged. Meanwhile the GitHub repo (github.com/anthropics/claude-cookbooks, ~48.8k stars as of mid-2026) still hosts the actual runnable notebooks.

Turns out the two surfaces drift. Web catalogue: chronological featured recipes. Repo: a registry.yaml that functions as a machine-readable index – paths, authors, dates, category tags. Some recipes are easier to find on one, some on the other. If you Google “Claude cookbook X” you can land on either, and they won’t always agree on what exists.

The repo was renamed from anthropic-cookbook to claude-cookbooks around September 17, 2025. Old blog posts and Stack Overflow answers still link to the singular, un-prefixed URL. GitHub redirects, but plenty of code snippets doing git clone on the old name will surprise you when branch structure or file paths have moved.

Why the generic tutorials fall short

Every other tutorial about the Claude Cookbook walks you through: clone repo, set ANTHROPIC_API_KEY, run classification notebook, done. That’s five minutes of value.

The real value is knowing which recipes are load-bearing and which are museum pieces. Here’s a rough triage based on what’s current as of mid-2026:

Recipe Added Still worth reading?
Contextual retrieval (RAG) Sept 2024 Yes – the pattern is still state-of-the-art
JSON mode / basic tool choice 2024 No – baked into model defaults
Programmatic Tool Calling (PTC) Nov 2025 Yes – new architecture
Memory tool + context compaction 2025 Yes – beta flags change often, read latest
Prompt caching walkthrough 2024 Skim – the API is simpler now
Async multi-agent orchestration 2025-26 Yes if you’re actually building agents

Notice what’s missing from that table? The 2023 prompt-engineering recipes. They’re not bad – they’re just no longer what changes your output quality. Reasoning models absorbed most of that territory.

The recommended reading path (four recipes, in this order)

One afternoon. These four, in sequence. Shortest path from zero to building something that doesn’t embarrass you in a code review.

1. Set up the repo properly

# Use the correct (renamed) URL
git clone https://github.com/anthropics/claude-cookbooks.git
cd claude-cookbooks

# uv is faster than pip and the repo README recommends it
pip install uv
uv sync

# API key - .env file is safer than shell export
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env

Open registry.yaml in the repo root. That’s your actual table of contents – more accurate than the README’s curated list because it’s auto-generated from the notebooks. Use it to find recipes by date; sort descending and anything older than 18 months gets a skeptical read.

2. Contextual retrieval (RAG that actually works)

Find the contextual retrieval notebook via registry.yaml – search for “contextual” and it’ll surface the September 2024 entry. The core idea: before embedding a chunk, prepend a short Claude-generated summary of where that chunk sits in the document. Then combine semantic search + BM25 + reranking. Chunk-context loss is a real RAG failure mode most tutorials skip entirely. This recipe is the rare one that addresses it head-on.

3. Programmatic Tool Calling (the November 2025 addition)

Skip shipping it for now. The concept still matters. Instead of Claude calling tools one-at-a-time through the standard tool-use loop, Claude writes a Python script that calls multiple tools inside a code execution environment. Intermediate results stay in the runtime – they never touch the context window.

The consequence: according to Anthropic’s internal tests (reported via Habr in early 2026), context load drops by up to 85% when working with large tool libraries. If you’ve ever watched a 2,000-row expense query blow up your context window, that number will resonate.

The catch: PTC only works via the Anthropic API. Claude Code on subscription plans doesn’t expose it – which is why community projects like PTC-MCP exist as an MCP shim to bring the same behavior to Claude Code users. Learn PTC from the cookbook, then try to use it in Claude Code, and you’ll lose an hour. Save yourself that hour.

4. The memory tool

tool_use/memory_cookbook.ipynb shows the current pattern. Note the exact incantation – this changes:

response = client.beta.messages.create(
 betas=["context-management-2025-06-27"],
 model="claude-sonnet-4-6",
 tools=[{"type": "memory_20250818", "name": "memory"}],
 messages=messages,
)

Those version-stamped strings (memory_20250818, context-management-2025-06-27) are the giveaway that the API is still moving. Always re-check the notebook before copying – the stamps roll forward.

What “read the cookbook” looks like in practice

Say you’re building an internal chatbot over a 500-page policy PDF. Naive path: chunk, embed, retrieve top-5, stuff into prompt. Works maybe 70% of the time.

The Cookbook path: (a) run the contextual-retrieval notebook against your PDF, (b) generate per-chunk context summaries once and cache them, (c) combine embeddings with BM25 for hybrid search, (d) rerank top-20 down to top-5. That’s a stack you’d never assemble from reading the API docs alone – it’s a design pattern that only exists as a recipe.

Is it novel science? No. Is it documented well enough anywhere else? Also no. That’s the actual value proposition of the Cookbook – not discovery, not tutorials. Assembly instructions.

Pro tips

A few things you’ll hit within the first week:

  • Sort registry.yaml by date descending. Anything older than 18 months, read with skepticism. Model defaults have probably absorbed it.
  • Don’t trust the model IDs in old notebooks. Recipes from 2024 still reference claude-3-opus-20240229. Swap in the current Sonnet or Haiku before running.
  • Third-party integration folders age fastest. Pinecone, MongoDB, Voyage examples – the patterns hold, but the SDKs have moved. Read for the architecture, not the exact imports.
  • Web catalogue for browsing, repo for running. Neither is complete on its own.
  • Check the author field in registry.yaml. Community contributions exist and aren’t first-party quality. Worth knowing before you copy something into production.

FAQ

Is the Claude Cookbook free?

Yes. Repo and web catalogue are free. You pay for your own API usage when you run the notebooks – nothing else.

Can I run cookbook recipes with just a Claude.ai subscription instead of API credits?

Mostly no – the notebooks call the Anthropic API directly and need a key from console.anthropic.com. A chat subscription doesn’t provide that. Budget a small amount of API credits alongside your subscription if you want to run things yourself.

How is this different from Anthropic’s regular documentation?

The docs tell you what parameters exist. The Cookbook shows you which combinations of parameters produce a working system. Think of it as the difference between a parts list and a schematic – same components, very different usefulness when you’re trying to build something by Tuesday.

Next step: open registry.yaml, filter for anything dated 2025 or later, and pick one recipe that solves a problem you actually have this week. Skip the tour.