Skip to content

Claude Cookbooks

A set of Jupyter notebook recipes showing how to build with the Claude API.

Stars
54.1k
Forks
6.5k
Licence
MIT
Language
Jupyter Notebook
Last update
7 days ago
Type
Learning resource

What it is

This repository is a collection of Jupyter notebooks and guides with copy-able code examples for using Claude, Anthropic's AI model, through its API. Each recipe covers a specific task, such as classification, retrieval augmented generation, tool use, vision, summarization, prompt caching, or automated evaluations. Developers use it as a starting point and adapt the snippets into their own projects.

  • Build a customer service agent that uses tools, based on the tool use recipe
  • Create a retrieval augmented generation pipeline with a vector database such as Pinecone
  • Extract text or data from images, charts, or forms using vision examples
  • Summarize PDFs by parsing them and passing the text to Claude
  • Set up prompt caching or a cost optimization checklist for an agent

Great for

  • Python developers who want working examples of Claude API calls
  • Developers exploring tool use or retrieval augmented generation with Claude
  • Teams evaluating how to add vision or PDF handling to an application
  • People new to the Claude API who want to follow guided examples

Not ideal for

  • Non-programmers, since the recipes are code notebooks that assume coding knowledge
  • People looking for a finished end-user app, because this is example code rather than a product
  • Anyone needing non-Python examples, since the README says the code is primarily Python and other languages must be adapted
Step-by-step guide: how to use Claude CookbooksInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Clone and build from source

    You'll need: Python · A Claude API key · Jupyter Notebook or JupyterLab

    Clone the repository

    git clone https://github.com/anthropics/claude-cookbooks
  2. 2

    Run it

    • Sign up for a Claude API key and store it securely
    • Clone the repository and install Python and Jupyter
    • Open the notebook for the recipe that matches your task
    • Run the cells in order, supplying your API key as the notebook expects
  3. 3

    Get the most out of it

    • Start with the Claude API Fundamentals course linked in the README if you are new to the API
    • Combine the tool use and retrieval recipes to build an agent that answers from your own data
    • Use the prompt caching recipe to reduce cost on repeated long prompts
    • Follow the automated evaluations recipe to measure prompt changes systematically

Downloads

Strengths

  • Covers many common tasks, from classification to vision to agents, in one place
  • Code is meant to be copied and integrated into real projects
  • Released under the MIT license, which permits reuse

Trade-offs

  • The README is short and does not list versions or detailed setup steps, so you must read each notebook for specifics
  • Some recipes link to external repositories or third-party services that need their own accounts or setup
  • Examples may reflect the Claude API at the time they were written, so check current docs before relying on them

How it compares

ProjectStarsTypeLevelUpdatedBest for
claude-cookbooks (this)54.1kLearning resourceintermediate7 days agoPython developers who want working examples of Claude API calls
langchain149kFrameworkintermediate4 days agoPython developers building LLM-powered applications
llama_index52.8kLibraryintermediate10 days agoPython developers building retrieval-augmented generation (RAG) apps over private documents
openai-cookbook76.9kLearning resourcebeginner5 days agoDevelopers who are new to the OpenAI API and want working examples

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.