Agent skill

Claude Cookbooks Reference

by 2025Emma in 2025Emma/vibe-coding-cn

Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.

MITAuto-check passedAI & LLM Engineering

Install Claude Cookbooks Reference

skills CLI
$ npx skills add 2025Emma/vibe-coding-cn --skill claude-cookbooks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install 2025Emma/vibe-coding-cn claude-cookbooks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/2025Emma/vibe-coding-cn.git skills-src && mkdir -p .claude/skills && cp -r skills-src/i18n/zh/skills/claude-cookbooks .claude/skills/claude-cookbooks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
claude-cookbooks
GitHub stars
23k
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
731 words
Files
11 (incl. scripts, references)
Skills in repo
13
Repo updated
First seen
Licence
MIT

At a glance

Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.

  • Works in 7 steps: Classification → Retrieval Augmented Generation (RAG) → Summarization → …
  • Learning how to call the Claude API from Python
  • SKILL.md covers When to Use This Skill, Quick Reference, Key Capabilities Covered and Repository Structure, plus 4 more sections
  • Runs Python scripts from its folder

What it does

Material from the Anthropic cookbooks is packaged here as a reference for building with the Claude API. A quick-reference section shows basic API usage, a tool definition for function calling, image analysis and prompt caching in Python, and the folder adds notes on capabilities, tool use, multimodal work, patterns and third-party services.

Covered capabilities include text classification, retrieval-augmented generation with vector search, summarization of documents and meetings, text-to-SQL, tool use with parameter validation and multi-tool flows, image and chart analysis, and advanced patterns such as agent architectures, sub-agent delegation and caching for cost control. A script, memory_tool.py, accompanies the notes.

When your agent uses it

  • Learning how to call the Claude API from Python
  • Adding tool use or function calling to an application
  • Building a RAG pipeline on top of Claude
  • Looking for patterns for sub-agents and prompt caching

Example prompts

  • “Show me how to define a weather tool and let Claude call it.”
  • “Walk me through sending an image to Claude for analysis.”
  • “How do I add prompt caching to this request to cut cost?”

Requirements

  • An Anthropic API key
  • Python with the anthropic package

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Classification
  2. Retrieval Augmented Generation (RAG)
  3. Summarization
  4. Text-to-SQL
  5. Tool Use & Function Calling
  6. Multimodal
  7. Advanced Patterns

What it can do on your machine

Read from SKILL.md and the folder at commit 9b42dd1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.claude.com
    • github.com
    • support.anthropic.com
    • anthropic.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Claude Cookbooks Reference loads about 2.2k tokens when it runs, and up to ~9k if it reads all its reference files. Until then it costs about 55 tokens; SKILL.md has 731 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~55
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from 2025Emma/vibe-coding-cn at commit 9b42dd1, republished under its MIT licence (© 2025Emma). 731 words, ~2,168 tokens.

Download SKILL.mdSave it as .claude/skills/claude-cookbooks/SKILL.md (or your agent's skills folder). This skill also uses 10 other files; get the full folder from GitHub.
name
claude-cookbooks
description
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.

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
Show full SKILL.md (283 more words)Show less
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

© 2025Emma, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 10 other files (scripts, references) in i18n/zh/skills/claude-cookbooks of 2025Emma/vibe-coding-cn.

  • SKILL.md
  • references/CONTRIBUTING.md
  • references/README.md
  • references/capabilities.md
  • references/index.md
  • references/main_readme.md
  • references/multimodal.md
  • references/patterns.md
  • references/third_party.md
  • references/tool_use.md
  • scripts/memory_tool.py

Open the folder on GitHubat commit 9b42dd1

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in 2025Emma/vibe-coding-cn, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Claude Cookbooks Reference next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Claude Cookbooks Reference compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Claude Cookbooks Reference this skill2025Emma/vibe-coding-cn23k1 repos~2.2kAutomated safety check: PassMIT
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0
Prompt Engineering Patternswshobson/agents40k—~1.3kAutomated safety check: PassMIT
Azure Openai To Responsesmicrosoft/ai-agents-for-beginners77k—~6kAutomated safety check: NotesMIT
Anthropic Product Knowledgesyahiidkamil/Software-Engineer-AI-Agent-Atlas4014 repos~651Automated safety check: PassNone
Claude APIloulanyue/awesome-claude-notes2722 repos~2.1kAutomated safety check: PassMIT

Similar skills

  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Reference for designing and tuning production LLM prompts: few-shot examples, chain-of-thought, structured outputs, templates and system prompts.

    40k GitHub stars~1.3k tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed
  • Azure Openai To Responses

    microsoft/ai-agents-for-beginners

    Official

    Migrate Python apps from Azure OpenAI Chat Completions to the Responses API.

    77k GitHub stars~6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • Anthropic Product Knowledge

    syahiidkamil/Software-Engineer-AI-Agent-Atlas

    Stop and consult this skill whenever your response would include specific facts about Anthropic's products.

    401 GitHub starsUsed in 4 repos~651 tokens
    AI & LLM EngineeringAuto-check passed
  • Claude API

    loulanyue/awesome-claude-notes

    Anthropic Claude API patterns for Python and TypeScript. An agent skill from loulanyue/awesome-claude-notes.

    272 GitHub starsUsed in 2 repos~2.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Claude API Development

    warpdotdev/warp

    Guides building, debugging and tuning apps on the Claude API and Anthropic SDK, including prompt caching, and migrating code between Claude model versions.

    65k GitHub starsUsed in 3 repos~8.2k tokens
    AI & LLM EngineeringAuto-check passed

More from 2025Emma/vibe-coding-cn

All 13 skills in this repo
  • Proxychains Network Fallback

    2025Emma/vibe-coding-cn

    Retries failed network commands through proxychains4 and a local proxy when it sees timeouts, DNS failures or blocked access.

    23k GitHub starsUsed in 1 repo~1.1k tokens
    Auto-check: notes
  • Skill Authoring and Refactoring

    2025Emma/vibe-coding-cn

    Builds new skills from scattered docs, specs or code, and refactors existing skills for clear triggers, reliable activation and a quality checklist.

    23k GitHub starsUsed in 2 repos~2k tokens
    Auto-check passed
  • CCXT Crypto Exchange Library

    2025Emma/vibe-coding-cn

    Reference help for the CCXT library covering crypto exchange APIs, market data, trading and order management across 150+ exchanges in JavaScript, Python and PHP.

    23k GitHub starsUsed in 1 repo~4.4k tokens
    Auto-check passed
  • CoinGecko API Reference

    2025Emma/vibe-coding-cn

    CoinGecko API documentation - cryptocurrency market data API, price feeds, market cap, volume, historical data. Use when integrating CoinGecko API, building…

    23k GitHub starsUsed in 1 repo~646 tokens
    Auto-check passed
  • Hummingbot Trading Bot Reference

    2025Emma/vibe-coding-cn

    Reference documentation for building, configuring and debugging automated trading strategies, market making and exchange connectors with Hummingbot.

    23k GitHub starsUsed in 1 repo~998 tokens
    Auto-check passed
  • SnapDOM Capture Guide

    2025Emma/vibe-coding-cn

    Explains how to use the snapDOM library to turn an HTML element into an SVG, PNG, JPG or WebP image while keeping its fonts, pseudo-elements and shadows.

    23k GitHub starsUsed in 1 repo~1.9k tokens
    Auto-check passed

Questions about Claude Cookbooks Reference

What does Claude Cookbooks Reference do?

Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns. Material from the Anthropic cookbooks is packaged here as a reference for building with the Claude API. A quick-reference section shows basic API usage, a tool definition for function calling, image analysis and prompt caching in Python, and the folder adds notes on capabilities, tool use, multimodal work, patterns and third-party services.

When should I use Claude Cookbooks Reference?

Claude Cookbooks Reference fits situations like: learning how to call the Claude API from Python; adding tool use or function calling to an application; building a RAG pipeline on top of Claude; looking for patterns for sub-agents and prompt caching.

How do I install Claude Cookbooks Reference in Claude Code?

Run `npx skills add 2025Emma/vibe-coding-cn --skill claude-cookbooks -a claude-code`. Or copy the skill folder (i18n/zh/skills/claude-cookbooks in 2025Emma/vibe-coding-cn) into .claude/skills/claude-cookbooks in your project. Claude Code loads it when a task matches its description.

How do I install Claude Cookbooks Reference in Codex?

Run `npx skills add 2025Emma/vibe-coding-cn --skill claude-cookbooks -a codex`. Or copy the skill folder (i18n/zh/skills/claude-cookbooks in 2025Emma/vibe-coding-cn) into .agents/skills/claude-cookbooks in your project. Codex loads it when a task matches its description.

Can I use Claude Cookbooks Reference in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add 2025Emma/vibe-coding-cn --skill claude-cookbooks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/claude-cookbooks, .gemini/skills/claude-cookbooks, .github/skills/claude-cookbooks and .opencode/skills/claude-cookbooks in your project.

What does Claude Cookbooks Reference need to run?

Going by SKILL.md and its folder, Claude Cookbooks Reference needs Python for the scripts in its folder. Our summary lists: An Anthropic API key; Python with the anthropic package.

Does Claude Cookbooks Reference access the network?

SKILL.md names 4 domains. As links in the text: docs.claude.com, github.com, support.anthropic.com and anthropic.com. This is read from the text; nothing was executed.

Is Claude Cookbooks Reference safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Claude Cookbooks Reference use?

Claude Cookbooks Reference is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Claude Cookbooks Reference use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.8k tokens, read only when the agent opens those files.

What are the alternatives to Claude Cookbooks Reference?

Skills that share tags, products or a category with Claude Cookbooks Reference: Gemini API Dev (google-gemini/gemini-skills, 4.3k stars), Prompt Engineering Patterns (wshobson/agents, 40k stars), Azure Openai To Responses (microsoft/ai-agents-for-beginners, 77k stars) and Anthropic Product Knowledge (syahiidkamil/Software-Engineer-AI-Agent-Atlas, 401 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Claude Cookbooks Reference?

2025Emma (a GitHub user) maintains it in 2025Emma/vibe-coding-cn, which has 23,041 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on December 17, 2025.

Source: 2025Emma/vibe-coding-cn on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.