Source: raw/claude-cookbooks-main/
The official Anthropic cookbook repository (github.com/anthropics/anthropic-cookbook) containing Jupyter notebooks and Python examples for building with the Claude API. This article catalogs the cookbooks as a CCA-F study resource, organizing them by exam domain relevance. Each notebook provides hands-on code you can run to internalize the patterns tested on the exam.
Repository Overview
- Language: Python (Jupyter notebooks)
- License: MIT
- Key directories:
tool_use/,capabilities/,misc/,multimodal/,patterns/agents/,claude_agent_sdk/,managed_agents/,skills/,extended_thinking/ - Prerequisites: Anthropic API key, Python 3.10+,
uvfor dependency management - Setup:
uv sync --all-extras, thencp .env.example .envand add yourANTHROPIC_API_KEY
Cookbooks by Exam Domain
Domain 1: Agentic Architecture & Orchestration (27%)
These notebooks demonstrate the agentic loop lifecycle, coordinator-subagent patterns, and multi-agent orchestration:
| Notebook | Path | What it teaches |
|---|---|---|
| Customer Service Agent | tool_use/customer_service_agent.ipynb | Full agentic loop: tool calls, stop_reason checking, conversation management. Directly maps to Task 1.1 |
| Orchestrator Workers | patterns/agents/orchestrator_workers.ipynb | Coordinator-subagent pattern with parallel workers. Maps to Tasks 1.2, 1.3 |
| Basic Workflows | patterns/agents/basic_workflows.ipynb | Prompt chaining, routing, parallelization patterns. Maps to Task 1.6 |
| Evaluator Optimizer | patterns/agents/evaluator_optimizer.ipynb | Iterative refinement loops where evaluator guides optimizer. Maps to Task 1.6 |
| Sub-Agents | multimodal/using_sub_agents.ipynb | Spawning sub-agents for parallel processing. Maps to Task 1.3 |
| One-Liner Research Agent | claude_agent_sdk/00_The_one_liner_research_agent.ipynb | Minimal Agent SDK setup. Maps to Tasks 1.1, 1.3 |
| Chief of Staff Agent | claude_agent_sdk/01_The_chief_of_staff_agent.ipynb | Multi-agent delegation with coordinator. Maps to Tasks 1.2, 1.3 |
| Session Browser | claude_agent_sdk/05_Building_a_session_browser.ipynb | Session management and state inspection. Maps to Task 1.7 |
Managed Agents cookbooks (advanced agentic patterns):
CMA_orchestrate_issue_to_pr.ipynb— end-to-end orchestration from GitHub issue to PRCMA_iterate_fix_failing_tests.ipynb— iterative test-fixing loopsCMA_gate_human_in_the_loop.ipynb— human-in-the-loop gating patternsCMA_operate_in_production.ipynb— production operation patternsCMA_explore_unfamiliar_codebase.ipynb— codebase exploration strategies
Domain 2: Tool Design & MCP Integration (18%)
These notebooks cover tool definition, structured errors, tool choice configuration, and tool search patterns:
| Notebook | Path | What it teaches |
|---|---|---|
| Calculator Tool | tool_use/calculator_tool.ipynb | Basic tool definition with JSON schema. Maps to Task 2.1 |
| Parallel Tools | tool_use/parallel_tools.ipynb | Parallel tool execution patterns. Maps to Task 2.3 |
| Tool Choice | tool_use/tool_choice.ipynb | auto, any, and forced tool selection. Maps to Task 2.3 |
| Tool Search (Embeddings) | tool_use/tool_search_with_embeddings.ipynb | Semantic tool search for large tool sets. Maps to Task 2.3 |
| Tool Search (Alternate) | tool_use/tool_search_alternate_approaches.ipynb | Alternative approaches to tool discovery. Maps to Task 2.3 |
| Programmatic Tool Calling | tool_use/programmatic_tool_calling_ptc.ipynb | Programmatic (non-LLM) tool execution. Maps to Tasks 2.1, 2.3 |
| Context Engineering Tools | tool_use/context_engineering/context_engineering_tools.ipynb | Context-aware tool design. Maps to Tasks 2.1, 2.4 |
| Memory Cookbook | tool_use/memory_cookbook.ipynb | Persistent memory tools. Maps to Task 2.4 |
| Automatic Context Compaction | tool_use/automatic-context-compaction.ipynb | Automatic context management. Maps to Tasks 2.4, 5.4 |
| Tool Use with Pydantic | tool_use/tool_use_with_pydantic.ipynb | Schema validation with Pydantic. Maps to Task 2.1 |
| Tool Evaluation | tool_evaluation/tool_evaluation.ipynb | Evaluating tool use quality. Maps to Task 2.1 |
| Threat Intel Agent | tool_use/threat_intel_enrichment_agent.ipynb | Multi-tool agent for security. Maps to Tasks 2.1, 2.3 |
Domain 3: Claude Code Configuration & Workflows (20%)
The cookbooks repo itself demonstrates Claude Code configuration patterns:
| Resource | Path | What it teaches |
|---|---|---|
| Root CLAUDE.md | CLAUDE.md | Project-level configuration with coding standards, model aliases, git workflow. Maps to Task 3.1 |
| Slash Commands | .claude/commands/ | Project-scoped commands (notebook-review, review-pr, link-review, model-check). Maps to Task 3.2 |
| Skills | .claude/skills/cookbook-audit/SKILL.md | Skill with style guide reference, demonstrating SKILL.md frontmatter. Maps to Task 3.2 |
| Code Reviewer Agent | .claude/agents/code-reviewer.md | Agent definition for automated code review. Maps to Task 3.6 |
| Skills Notebooks | skills/notebooks/01_skills_introduction.ipynb | Introduction to skills system. Maps to Task 3.2 |
| Skills Custom Dev | skills/notebooks/03_skills_custom_development.ipynb | Building custom skills. Maps to Task 3.2 |
Domain 4: Prompt Engineering & Structured Output (20%)
These notebooks demonstrate structured output, few-shot prompting, batch processing, and validation patterns:
| Notebook | Path | What it teaches |
|---|---|---|
| Extracting Structured JSON | tool_use/extracting_structured_json.ipynb | JSON extraction via tool_use. Maps to Task 4.3 |
| Enable JSON Mode | misc/how_to_enable_json_mode.ipynb | Reliable JSON output. Maps to Task 4.3 |
| Batch Processing | misc/batch_processing.ipynb | Message Batches API usage, custom_id correlation. Maps to Task 4.5 |
| Building Evals | misc/building_evals.ipynb | Automated evaluation patterns. Maps to Tasks 4.4, 4.6 |
| Generate Test Cases | misc/generate_test_cases.ipynb | Test case generation. Maps to Task 3.5 |
| Moderation Filter | misc/building_moderation_filter.ipynb | Content classification with structured output. Maps to Task 4.1 |
| Using Citations | misc/using_citations.ipynb | Citation tracking in output. Maps to Task 5.6 |
| Classification Guide | capabilities/classification/guide.ipynb | Classification patterns with explicit criteria. Maps to Task 4.1 |
| Summarization Guide | capabilities/summarization/guide.ipynb | Summarization with structured output. Maps to Task 4.3 |
| RAG Guide | capabilities/retrieval_augmented_generation/guide.ipynb | Retrieval-augmented generation. Maps to Tasks 4.2, 5.1 |
| Vision with Tools | tool_use/vision_with_tools.ipynb | Multimodal structured extraction. Maps to Task 4.3 |
| Metaprompt | misc/metaprompt.ipynb | Prompt generation and refinement. Maps to Task 4.1 |
Domain 5: Context Management & Reliability (15%)
These notebooks address context window management, prompt caching, session memory, and long-document handling:
| Notebook | Path | What it teaches |
|---|---|---|
| Prompt Caching | misc/prompt_caching.ipynb | Cache-aware prompt design, cost reduction. Maps to Task 5.1 |
| Speculative Caching | misc/speculative_prompt_caching.ipynb | Advanced caching strategies. Maps to Task 5.1 |
| Session Memory Compaction | misc/session_memory_compaction.ipynb | Compacting long conversation history. Maps to Tasks 5.1, 5.4 |
| Automatic Context Compaction | tool_use/automatic-context-compaction.ipynb | Automated context management. Maps to Task 5.4 |
| PDF Upload Summarization | misc/pdf_upload_summarization.ipynb | Handling long documents. Maps to Task 5.1 |
| Sampling Past Max Tokens | misc/sampling_past_max_tokens.ipynb | Working beyond token limits. Maps to Task 5.1 |
| Observability Agent | claude_agent_sdk/02_The_observability_agent.ipynb | Agent monitoring and observability. Maps to Task 5.3 |
| SRE Agent | claude_agent_sdk/03_The_site_reliability_agent.ipynb | Reliability patterns in practice. Maps to Task 5.3 |
| Prompt Versioning & Rollback | managed_agents/CMA_prompt_versioning_and_rollback.ipynb | Managing prompt versions for reliability. Maps to Task 5.3 |
Extended Thinking (Cross-Domain)
| Notebook | Path | What it teaches |
|---|---|---|
| Extended Thinking | extended_thinking/extended_thinking.ipynb | Chain-of-thought reasoning patterns. Relevant to Tasks 4.1, 4.6 |
| Extended Thinking + Tools | extended_thinking/extended_thinking_with_tool_use.ipynb | Combining reasoning with tool use. Relevant to Tasks 1.1, 4.3 |
Recommended Study Path
Work through the notebooks in this order to build knowledge progressively:
- Week 1 — Tool Foundations:
calculator_tool→tool_choice→parallel_tools→extracting_structured_json - Week 2 — Agentic Patterns:
customer_service_agent→basic_workflows→orchestrator_workers→evaluator_optimizer - Week 3 — Production Concerns:
batch_processing→prompt_caching→session_memory_compaction→building_evals - Week 4 — Advanced Agents: Agent SDK notebooks (00-05) → Managed Agents notebooks →
context_engineering_tools
Key Takeaways
- The cookbooks repository provides runnable code for nearly every CCA-F task statement — use it as your hands-on lab
- Domain 1 (Agentic Architecture) has the richest notebook coverage: the
patterns/agents/,claude_agent_sdk/, andmanaged_agents/directories together cover all 7 task statements - Domain 2 (Tool Design) is well covered by the
tool_use/directory — especiallytool_choice.ipynbandprogrammatic_tool_calling_ptc.ipynb - Domain 3 (Claude Code Config) is best studied by examining the repo’s own
.claude/directory structure rather than running notebooks - The
misc/batch_processing.ipynbnotebook is essential for Task 4.5 (batch strategies) — one of the most concrete exam topics - Domain 5 (Context & Reliability) content is spread across
misc/(caching, compaction) and the Agent SDK (observability, SRE patterns)
Related
- CCA-F Official Exam Guide
- CCA-F Technical Reference
- CCA-F Practice Exam (60 Questions)
- The Architect’s Playbook
- CCA-F Study Guide
- CCA-F Practice Questions by Domain
- The Complete Guide to Building Skills for Claude
- Claude Code Subagents
- Essential MCP Servers for 2026
Try It
- Clone the repo:
git clone https://github.com/anthropics/anthropic-cookbook.gitand set up your API key - Run
customer_service_agent.ipynbfirst — it is the single most exam-relevant notebook, covering the agentic loop, tool use, and conversation management in one example - Modify the examples — after running each notebook, change something (add a tool, modify the schema, break something intentionally) to see what happens
- Build your own cookbook — create a notebook that combines patterns from at least 3 different cookbooks into one integrated system
- Use the cookbooks as flashcards — for each notebook, write down which exam task statement it maps to without looking at this article