Claude Cookbooks logo

Claude Cookbooks

CommunityPopular
2025Emma
claude-cookbooks

Claude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities.

Overview

Publisher2025Emma
Repositoryvibe-coding-cn
Skill nameclaude-cookbooks
Stars
23K
Forks
2.4K
Bundled files
9
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by 2025Emma on GitHub. Read the source before you install it.

Installation

Install the Claude Cookbooks AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/2025Emma/vibe-coding-cn.git /tmp/vibe-coding-cn
mkdir -p .claude/skills
cp -r /tmp/vibe-coding-cn/i18n/zh/skills/claude-cookbooks .claude/skills/claude-cookbooks
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Claude Cookbooks in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Claude Cookbooks on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Claude Cookbooks is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Claude Cookbooks Skill

Comprehensive code examples and guides for building with Claude AI, sourced from the official Anthropic cookbooks repository.

When to Use This Skill

This skill should be triggered when:

  • Learning how to use Claude API
  • Implementing Claude integrations
  • Building applications with Claude
  • Working with tool use and function calling
  • Implementing multimodal features (vision, image analysis)
  • Setting up RAG (Retrieval Augmented Generation)
  • Integrating Claude with third-party services
  • Building AI agents with Claude
  • Optimizing prompts for Claude
  • Implementing advanced patterns (caching, sub-agents, etc.)

Quick Reference

Basic API Usage

python
import anthropic

client = anthropic.Anthropic(api_key="your-api-key")

# Simple message
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": "Hello, Claude!"
    }]
)

Tool Use (Function Calling)

python
# Define a tool
tools = [{
    "name": "get_weather",
    "description": "Get current weather for a location",
    "input_schema": {
        "type": "object",
        "properties": {
            "location": {"type": "string", "description": "City name"}
        },
        "required": ["location"]
    }
}]

# Use the tool
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    tools=tools,
    messages=[{"role": "user", "content": "What's the weather in San Francisco?"}]
)

Vision (Image Analysis)

python
# Analyze an image
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {
                    "type": "base64",
                    "media_type": "image/jpeg",
                    "data": base64_image
                }
            },
            {"type": "text", "text": "Describe this image"}
        ]
    }]
)

Prompt Caching

python
# Use prompt caching for efficiency
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    system=[{
        "type": "text",
        "text": "Large system prompt here...",
        "cache_control": {"type": "ephemeral"}
    }],
    messages=[{"role": "user", "content": "Your question"}]
)

Key Capabilities Covered

1. Classification

  • Text classification techniques
  • Sentiment analysis
  • Content categorization
  • Multi-label classification

2. Retrieval Augmented Generation (RAG)

  • Vector database integration
  • Semantic search
  • Context retrieval
  • Knowledge base queries

3. Summarization

  • Document summarization
  • Meeting notes
  • Article condensing
  • Multi-document synthesis

4. Text-to-SQL

  • Natural language to SQL queries
  • Database schema understanding
  • Query optimization
  • Result interpretation

5. Tool Use & Function Calling

  • Tool definition and schema
  • Parameter validation
  • Multi-tool workflows
  • Error handling

6. Multimodal

  • Image analysis and OCR
  • Chart/graph interpretation
  • Visual question answering
  • Image generation integration

7. Advanced Patterns

  • Agent architectures
  • Sub-agent delegation
  • Prompt optimization
  • Cost optimization with caching

Repository Structure

The cookbooks are organized into these main categories:

  • capabilities/ - Core AI capabilities (classification, RAG, summarization, text-to-SQL)
  • tool_use/ - Function calling and tool integration examples
  • multimodal/ - Vision and image-related examples
  • patterns/ - Advanced patterns like agents and workflows
  • third_party/ - Integrations with external services (Pinecone, LlamaIndex, etc.)
  • claude_agent_sdk/ - Agent SDK examples and templates
  • misc/ - Additional utilities (PDF upload, JSON mode, evaluations, etc.)

Reference Files

This skill includes comprehensive documentation in references/:

  • main_readme.md - Main repository overview
  • capabilities.md - Core capabilities documentation
  • tool_use.md - Tool use and function calling guides
  • multimodal.md - Vision and multimodal capabilities
  • third_party.md - Third-party integrations
  • patterns.md - Advanced patterns and agents
  • index.md - Complete reference index

Common Use Cases

Building a Customer Service Agent

  1. Define tools for CRM access, ticket creation, knowledge base search
  2. Use tool use API to handle function calls
  3. Implement conversation memory
  4. Add fallback mechanisms

See: references/tool_use.md#customer-service

Implementing RAG

  1. Create embeddings of your documents
  2. Store in vector database (Pinecone, etc.)
  3. Retrieve relevant context on query
  4. Augment Claude's response with context

See: references/capabilities.md#rag

Processing Documents with Vision

  1. Convert document to images or PDF
  2. Use vision API to extract content
  3. Structure the extracted data
  4. Validate and post-process

See: references/multimodal.md#vision

Building Multi-Agent Systems

  1. Define specialized agents for different tasks
  2. Implement routing logic
  3. Use sub-agents for delegation
  4. Aggregate results

See: references/patterns.md#agents

Best Practices

API Usage

  • Use appropriate model for task (Sonnet for balance, Haiku for speed, Opus for complex tasks)
  • Implement retry logic with exponential backoff
  • Handle rate limits gracefully
  • Monitor token usage for cost optimization

Prompt Engineering

  • Be specific and clear in instructions
  • Provide examples when needed
  • Use system prompts for consistent behavior
  • Structure outputs with JSON mode when needed

Tool Use

  • Define clear, specific tool schemas
  • Validate inputs and outputs
  • Handle errors gracefully
  • Keep tool descriptions concise but informative

Multimodal

  • Use high-quality images (higher resolution = better results)
  • Be specific about what to extract/analyze
  • Respect size limits (5MB per image)
  • Use appropriate image formats (JPEG, PNG, GIF, WebP)

Performance Optimization

Prompt Caching

  • Cache large system prompts
  • Cache frequently used context
  • Monitor cache hit rates
  • Balance caching vs. fresh content

Cost Optimization

  • Use Haiku for simple tasks
  • Implement prompt caching for repeated context
  • Set appropriate max_tokens
  • Batch similar requests

Latency Optimization

  • Use streaming for long responses
  • Minimize message history
  • Optimize image sizes
  • Use appropriate timeout values

Resources

Official Documentation

Community

Learning Resources

Working with This Skill

For Beginners

Start with references/main_readme.md and explore basic examples in references/capabilities.md

For Specific Features

  • Tool use → references/tool_use.md
  • Vision → references/multimodal.md
  • RAG → references/capabilities.md#rag
  • Agents → references/patterns.md#agents

For Code Examples

Each reference file contains practical, copy-pasteable code examples

Examples Available

The cookbook includes 50+ practical examples including:

  • Customer service chatbot with tool use
  • RAG with Pinecone vector database
  • Document summarization
  • Image analysis and OCR
  • Chart/graph interpretation
  • Natural language to SQL
  • Content moderation filter
  • Automated evaluations
  • Multi-agent systems
  • Prompt caching optimization

Notes

  • All examples use official Anthropic Python SDK
  • Code is production-ready with error handling
  • Examples follow current API best practices
  • Regular updates from Anthropic team
  • Community contributions welcome

Skill Source

This skill was created from the official Anthropic Claude Cookbooks repository: https://github.com/anthropics/claude-cookbooks

Repository cloned and processed on: 2025-10-29

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Claude Cookbooks AI skill do?

Claude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities.

Why use Claude Cookbooks on TypingMind?

Because you install it once and use it with any model. Claude Cookbooks is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Claude Cookbooks in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/2025Emma/vibe-coding-cn/tree/main/i18n/zh/skills/claude-cookbooks. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Claude Cookbooks?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Claude Cookbooks?

As many as you like. As long as a model supports skills, you can use Claude Cookbooks with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Claude Cookbooks AI skill free?

Yes. It is published on GitHub by 2025Emma under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇