Anthropic's Claude Cookbooks — the canonical recipe index
TL;DR
anthropics/claude-cookbooks is Anthropic's
official, MIT-licensed collection of runnable Jupyter
notebooks — "copy-able code snippets" for building with the
Claude API (the capture reports 46,373★, updated 2026-07-02, README
renamed from the older anthropic-cookbook). Its value to
this vault is not a new argument but a canonical,
first-party embodiment of a broad swath of concepts the graph
already holds — the five Agentic Workflow Patterns, Pure Agent Applications via the
Claude Agent SDK, Managed Agents (the
managed_agents/ "CMA_*" recipes), Agent-Computer Interface (ACI)
tool-use, RAG, Eval-Driven
Development, and sub-agents (Reasoning Effort Control's
Haiku-as-sub-agent-of-Opus recipe). So the dominant stance is
corroborates: it is the runnable reference behind concepts
sourced elsewhere, and it raises confidence without duplicating them. It
earns its keep by surfacing two techniques the graph did not yet
have a page for — Prompt
Caching (misc/prompt_caching.ipynb,
speculative_prompt_caching.ipynb) and Contextual Retrieval
(capabilities/contextual-embeddings/) — which are spun out
below. Should you care? Yes, as a lookup
index, not a read-through: when a capture demands a concrete recipe
(batch, citations, JSON mode, PDF, memory tool, programmatic tool
calling, extended thinking, fine-tuning on Bedrock), this repo is the
first-party place to fetch it — a deep-read of any one notebook is an
on-demand deep-research burst, not this triage pass.
What it is %%ADAPTER_NOTE%% how it is organized
A flat set of topic directories, each holding self-contained
.ipynb recipes plus a few support skills/scripts. The
load-bearing top-level groupings:
capabilities/— task recipes: classification, summarization,retrieval_augmented_generation/,contextual-embeddings/,knowledge_graph/,text_to_sql/.claude_agent_sdk/— eight numbered notebooks building end-to-end agents (research, chief-of-staff, observability, SRE, vulnerability-detection) + a07_Hosting_the_agent; a Pure Agent Application / SDK track, incl.04_migrating_from_openai_agents_sdk.managed_agents/— the "CMA_*" (Managed Agent) recipes: coordinate a specialist team, human-in-the-loop gate, iterate-fix-failing-tests, operate-in-production, orchestrate-issue-to-PR, prompt versioning/rollback, remember-user-preferences,verify_with_outcome_grader(LLM-as-Judge).tool_use/— calculator, customer-service, structured-JSON extraction,memory_tool,parallel_tools,programmatic_tool_calling_ptc,tool_choice, twotool_search_*recipes,automatic-context-compaction,context_engineering/.multimodal/— vision getting-started + best-practices, charts/graphs/PowerPoint reading, transcription,using_sub_agents(Haiku sub-agent of Opus).extended_thinking/,evals/+misc/building_evals.ipynb+generate_test_cases.ipynb,skills/(custom-skills track),observability/usage_cost_api,patterns/agents/,third_party/(Pinecone, VoyageAI, MongoDB, Deepgram, ElevenLabs, WolframAlpha, LlamaIndex…), and grab-bagmisc/(batch processing, citations, JSON mode, prompt caching, metaprompt, PDF summarization, session memory compaction).- Infra:
Makefile,pyproject.toml/uv.lock,scripts/validate_*_notebooks.py+tests/(notebooks are CI-validated),authors.yaml/registry.yaml,.claude/(agents, commands, skills).
Concepts introduced
- Prompt Caching — new page. Reuse a cached prompt prefix across calls to cut cost and latency on repeated long contexts; the repo ships both a base and a speculative recipe.
- Contextual Retrieval — new page. Prepend chunk-situating context before embedding (and indexing) so retrieved chunks don't lose the document context that makes them findable; attaches to the existing retrieval spine (Hybrid Retrieval, Semantic Retrieval, Reranking).
Held, not dropped (themes the repo embodies that don't warrant their own page yet — spin out on demand when a second witness or a deep-read lands):
- Programmatic tool calling (PTC)
(
tool_use/programmatic_tool_calling_ptc.ipynb) — the model emits code that calls tools rather than one-shot tool JSON. Held pending a focused source. - Tool search
(
tool_use/tool_search_alternate_approaches,..._with_embeddings) — selecting from a large tool set; related to Search-Then-Get. Held. - Memory tool (
tool_use/memory_tool.py,memory_cookbook.ipynb) — first-party agent-memory recipe; relates to AI Second Brain / Context Substrate. Held. - Context compaction
(
tool_use/automatic-context-compaction,misc/session_memory_compaction) — managing a growing context window. Held. - Extended thinking (
extended_thinking/) — a recipe surface for Reasoning Effort Control; corroborates, no new page. - Batch processing, citations, JSON mode, moderation filter, metaprompt, PDF summarization, fine-tuning on Bedrock, knowledge-graph, text-to-SQL, custom skills, usage/cost API — each a discrete recipe; held as an index entry, not a concept, until a capture needs it.
Key claims
- The Claude Cookbooks are copy-able code recipes for building with the Claude API; concepts are Python-first but portable to any language that can call the API. (observation — Golden Templates / Reusable Workflow Library) — the repo's self-description; it is a first-party recipe catalog, the official analogue of the personal loop-library pattern.
- Notebooks are CI-validated
(
scripts/validate_all_notebooks.py,tests/notebook_tests/,lychee.tomllink-check). observation — recipes are tested artifacts, not stale gists. - The repo treats "official recipes" as a maintained,
contribution-driven catalog (author schema,
registry.yaml, issue/PR templates). (best_practice — Reusable Workflow Library) — context: a vendor curating a shared reference; the anatomy (registry + validation + authorship) is what keeps a public recipe catalog trustworthy, contingent on wanting canonical status. - Sub-agent recipe: use Haiku as a sub-agent in combination
with Opus. (observation — Reasoning Effort Control)
— the source's stated pattern in
multimodal/using_sub_agents.ipynb; a concrete cheap-model-under-strong-model instance.
Check-worthy source claims (attributed to the repo, not adjudicated — a later grounding pass can verify; named models/dates/counts are groundable):
- The repo reports 46,373★, MIT license, default branch
main, updated 2026-07-02, and a README renamed fromanthropic-cookbookto "Claude Cookbooks." observation — capture metadata. - A
fable_5_fallback_billing/guide.ipynbdirectory exists (a recipe framed around a model named "Fable 5" and fallback billing). observation — named-model/feature claim; attributed as the repo's, flagged for verification, not adjudicated here. - A
claude_agent_sdk/04_migrating_from_openai_agents_sdk.ipynbrecipe exists. observation — named cross-vendor migration recipe; groundable.
Why this
corroborates (and where it adds)
The repo attaches to a large, already-populated region of
the graph — agent architecture, tool use, evals, retrieval, managed
agents — so it is not novel: its primary graph role is to
be the canonical first-party embodiment of concepts
sourced elsewhere (Building
Effective Agents, the video distillates on
loops/managed-agents/evals). It corroborates rather than duplicates:
each "CMA_*" notebook is an independent witness that Managed Agent recipes exist and are
maintained; patterns/agents/ + the SDK notebooks witness Agentic Workflow Patterns and
Pure Agent Application in
runnable form; evals/ + building_evals +
verify_with_outcome_grader witness Eval-Driven Development and LLM-as-Judge. Note this is first-party
corroboration (same vendor as building-effective-agents),
not a fully independent second source — it raises availability
confidence (the recipe is real and tested) more than consensus
confidence.
Two secondary novel threads justify the
two new pages: Prompt Caching and Contextual Retrieval attach to no
prior concept (the retrieval spine had hybrid/semantic/rerank but not
the situate-before-embed move). No contradicts tension
surfaced — the repo is a reference index, complementary to the graph's
argumentative distillates.