본문으로 건너뛰기
cccskills
무료GitHub에 공개

claude-cookbooks

Develop applications with the Claude API using examples from Anthropic's official cookbooks. Explore document summarization, image analysis, document retrieval, external tool calls, and prompt caching through practical Python code and implementation guidance.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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.

연동 도구Discord
설치 방법 보기

이럴 때 유용합니다

  • Learning basic Claude API integration
  • Building an assistant that searches documents
  • Extracting text and information from images
  • Adding external tool calls to a chatbot
  • Using prompt caching for repeated context

포함된 파일(11)

  • SKILL.md8.5 KB
  • references/capabilities.md2.9 KB
  • references/CONTRIBUTING.md6.1 KB
  • references/index.md961 B
  • references/main_readme.md5.7 KB
  • references/multimodal.md1.8 KB
  • references/patterns.md688 B
  • references/README.md5.7 KB
  • references/third_party.md1.3 KB
  • references/tool_use.md1.7 KB
  • scripts/memory_tool.py12.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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

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)

# 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)

# 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

# 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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

ccxt

무료

Build cryptocurrency exchange integrations with CCXT in JavaScript, Python, or PHP. The skill helps retrieve market data, manage orders, automate trading workflows, check exchange-specific capabilities, and investigate API errors using reproducible examples and logs.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Retrieve market data from multiple cryptocurrency exchanges
  • Implement order management and trading automation
  • Check support for stop-loss and take-profit orders
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

Learn Claude Code workflows through a Chinese-language guide covering tool use, large-file analysis, task tracking, and troubleshooting. It also explains MCP, a protocol for connecting external systems, alongside development and review patterns.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Learn tool use and development workflows
  • Analyze large files in manageable sections
  • Study MCP connections to external systems
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

Turn documentation, code, and specifications into reusable Agent Skills. Define when each skill should activate, organize supporting references, add reproducible examples, and check new or existing skills with templates, a checklist, and a validator.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating an Agent Skill from documentation and code
  • Reorganizing an overly long SKILL.md
  • Clarifying skill activation conditions and boundaries
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

coingecko

무료

Use CoinGecko API documentation to build cryptocurrency price trackers and market data integrations. The skill supports implementation and debugging for access to prices, market capitalization, trading volume, and historical data.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Building a cryptocurrency price tracker
  • Integrating market capitalization and trading volume data
  • Exploring how to retrieve historical prices
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

Build Python applications that collect live cryptocurrency prices, trades, and order books with Cryptofeed. Covers consistent data formats across exchanges, price comparisons, and writing incoming data to storage systems for monitoring and analysis.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Monitoring prices across cryptocurrency exchanges
  • Analyzing order book depth
  • Analyzing executed trade flows
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

Develop cryptocurrency trading bots with Hummingbot documentation and code examples. Explore exchange connections, price and order book data, and strategies such as market making, which places buy and sell orders, or arbitrage across markets.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Developing a cryptocurrency trading bot
  • Exploring market making and arbitrage strategies
  • Checking exchange connection settings
2025Emma/vibe-coding-cn2.3만2025년 12월 17일 업데이트

2025Emma의 스킬 모두 보기

이 스킬의 문제 신고