Anthropic's Claude Cookbook: Production-Ready Agent Patterns
Anthropic published the Claude Cookbook, a collection of 50+ tutorials covering agent patterns, tool use, evals, and production deployment. The cookbook targets developers building with the Claude Agent SDK and Managed Agents API.
Key Sections
Agent SDK Tutorials (8 guides): Start with "The one-liner research agent" (Sep 2025) using WebSearch for autonomous research. Scale to "The chief of staff agent" with subagents, hooks, and plan mode. The "Site reliability agent" (Feb 2026) demonstrates incident response with read-write MCP tools.
Managed Agents Tutorials (10 guides): The entry-point "Managed Agents tutorial: iterate on a failing test suite" (Apr 2026) walks through agent/environment/session creation, file mounts, and the streaming event loop by fixing three planted bugs in a calc.py package. "Managed Agents tutorial: production setup" covers vault-backed MCP credentials, the session.status_idled webhook pattern, and resource lifecycle CRUD verbs.
Agent Patterns (12 guides): "Context engineering: memory, compaction, and tool clearing" (Mar 2026) compares strategies for long-running agents. "Async multi-agent orchestration" (Jun 2026) covers fixed N-agent teams with peer messaging and dynamically spawned async subagents.
Evals & Outcomes (7 guides): "Outcomes: agents that verify their own work" (May 2026) builds a grade-and-revise loop: a writer drafts a cited research brief, a stateless grader fetches every URL and checks every quote against a rubric, and feedback drives revisions until the brief passes. Covers user.define_outcome, span.outcome_evaluation_* events, and rubric writing.
Cybersecurity (3 guides): "The vulnerability detection agent" (Apr 2026) uses the Claude Agent SDK to threat-model a C target, hunt memory-safety bugs with built-in file tools, and triage findings into a structured report. "Threat intelligence enrichment agent" (Apr 2026) queries multiple threat intel sources, cross-references findings, maps to MITRE ATT&CK, and produces structured reports for SIEM/SOAR integration.
RAG & Retrieval (6 guides): "Enhancing RAG with contextual retrieval" (Sep 2024) adds context to chunks before embedding with prompt caching. "Knowledge graph construction with Claude" (Mar 2026) extracts entities, mines relations, deduplicates, and queries multi-hop graphs.
Tools & Integrations (12 guides): "Programmatic tool calling (PTC)" (Nov 2025) reduces latency by letting Claude write code that calls tools programmatically. "Tool search with embeddings" (Nov 2025) scales to thousands of tools using semantic embeddings. "Low latency voice assistant with ElevenLabs" (Nov 2025) combines speech-to-text and text-to-speech with Claude.
Production Patterns
- Hosting your agent (May 2026): Deploy the research agent through three tiers (Docker, Modal, Kubernetes) with the same container image and HTTP interface.
- Usage & cost Admin API cookbook (Aug 2025): Programmatically access and analyze Claude API usage and cost data.
- Speculative prompt caching (May 2025): Warm cache speculatively while users formulate queries to reduce time-to-first-token.
- Session memory compaction (Jan 2026): Manage long-running conversations with background threading and prompt caching.
Concrete Code Examples
The cookbook includes executable code. For instance, the Managed Agents tutorial shows how to create an agent:
from anthropic import Anthropic
client = Anthropic()
agent = client.agents.create(
name="bug-fixer",
model="claude-sonnet-4-20250514",
instructions="Fix bugs in the attached Python file.",
tools=[{"type": "code_interpreter"}]
)
session = client.agents.sessions.create(agent_id=agent.id)
for event in client.agents.sessions.stream(agent_id=agent.id, session_id=session.id):
if event.type == "message":
print(event.message.content)
Another example from the evals cookbook:
# Define an outcome for a research brief
outcome = client.agents.outcomes.create(
name="research_brief_quality",
rubric=[
"Every claim must cite a URL",
"Quotes must be verbatim from the source",
"At least 5 distinct sources"
],
evaluator_model="claude-opus-4-20250514"
)
Why It Matters
Anthropic is providing production-grade patterns for building reliable agents, not just demos. The cookbook covers evals, memory, tool selection, and deployment — the hard parts of agent development. The inclusion of cybersecurity and SRE agents shows real enterprise use cases.
Next Steps
Start with the Managed Agents tutorial for a hands-on introduction. Then explore the evals cookbook to add verification loops to your agents. For production, follow the hosting guide to deploy on Kubernetes.



