$ show anthropics/claude-cookbooks
This repository is a comprehensive educational cookbook for building with Anthropic's Claude API and Agent SDK. It contains over 60 Jupyter notebooks demonstrating capabilities such as classification, retrieval-augmented generation (RAG), summarization, text-to-SQL, knowledge graph construction, content moderation, tool use, multimodal processing, extended thinking, and agent orchestration. The repo also includes production-oriented hosting patterns (Docker, Kubernetes, Modal, Cloudflare Workers) for deploying agents, and extensive evaluation frameworks using promptfoo with custom Python evaluators (BLEU, ROUGE, LLM-as-judge). While primarily a tutorial collection, it exhibits hybrid characteristics with reusable infrastructure code for agent hosting, content moderation pipelines, and notebook validation. The codebase is actively maintained with CI/CD workflows, but relies on beta APIs and hardcoded model names that introduce technical drift. Data assets are synthetic but realistic, enabling reproducible demonstrations of Claude's capabilities.
The LLM identified 4 files worth highlighting for reuse:
A deterministic content moderation engine that separates extraction from verdict using a compiler, extractor, and rule engine. It processes ad creatives, product listings, and UGC against hand-authored golden rules with derived fields. The pattern is self-contained, parameterized via JSON rule files, and can be extracted for any policy-based moderation task.
A FastAPI server that wraps a Claude agent over HTTP with Server-Sent Events (SSE) streaming. Provides health check, session creation, and message streaming endpoints. The pattern is reusable for deploying any agent as a microservice with minimal modification, and is shared across Docker, Modal, and Kubernetes hosting tiers.
A comprehensive notebook validator with stateful caching, progressive batch processing, dashboard generation, GitHub issue export, and auto-fixing of deprecated model IDs. Demonstrates a robust pattern for maintaining quality in a large notebook repository, reusable for any Jupyter-based project.
Shared utility functions for making LLM calls and extracting XML-tagged content from responses. Provides a clean, reusable abstraction for agent workflows across multiple notebooks. The pattern is minimal, dependency-free, and can be extracted into any project requiring structured LLM interaction.