Copy working code examples into your own project to classify text, summarize documents, or extract data using Claude.
Build a customer service chatbot that can use tools and take actions on behalf of users.
Implement retrieval-augmented generation by combining Claude with a vector database to answer questions about your own documents.
Add image understanding to your application by using Claude's vision capabilities to analyze charts, forms, or photos.
Requires Anthropic API key and Pinecone account for vector DB examples; some examples may need additional dependencies.
Claude Cookbooks is a collection of practical code examples and guides from Anthropic, the company behind the Claude AI model family. The problem it solves is the learning curve developers face when trying to build real applications using the Claude API, the official documentation explains the API's structure, but working examples showing how to apply it to concrete tasks are often more helpful for getting started quickly. The repository is organized as a set of Jupyter Notebooks, interactive documents that combine runnable Python code with explanatory text and output, so you can read through a concept and immediately execute it to see the result. Each notebook focuses on a specific capability or integration pattern: classifying text, summarizing documents, extracting structured data from PDFs, building a customer service chatbot with tool use, combining Claude with external databases for retrieval-augmented generation (a technique where the AI is given relevant documents to reference before answering), and working with Claude's vision capabilities to interpret images, charts, or forms. There are also notebooks covering more advanced topics: having one Claude model act as a sub-agent inside a larger system orchestrated by another model, enforcing consistent JSON output format, building content moderation filters, and evaluating prompt quality automatically. Someone would use this repository when they have obtained a Claude API key and want working reference code they can copy and adapt into their own project, rather than starting from a blank editor. The examples are primarily in Python, but the patterns they demonstrate can be implemented in any language. The tech stack is Python running in Jupyter Notebooks, using the Anthropic Python SDK to communicate with the Claude API. Some notebooks additionally integrate third-party services like Pinecone for vector search.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.