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.
Provides code examples and best practices for building with Claude API. Use when implementing tool use, RAG, multimodal features, or advanced patterns like agents and prompt caching.
/plugin marketplace add tianzecn/myclaudecode/plugin install docs@tianzecn-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/CONTRIBUTING.mdreferences/README.mdreferences/capabilities.mdreferences/index.mdreferences/main_readme.mdreferences/multimodal.mdreferences/patterns.mdreferences/third_party.mdreferences/tool_use.mdscripts/memory_tool.pyComprehensive code examples and guides for building with Claude AI, sourced from the official Anthropic cookbooks repository.
This skill should be triggered when:
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!"
}]
)
# 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?"}]
)
# 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"}
]
}]
)
# 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"}]
)
The cookbooks are organized into these main categories:
This skill includes comprehensive documentation in references/:
See: references/tool_use.md#customer-service
See: references/capabilities.md#rag
See: references/multimodal.md#vision
See: references/patterns.md#agents
Start with references/main_readme.md and explore basic examples in references/capabilities.md
references/tool_use.mdreferences/multimodal.mdreferences/capabilities.md#ragreferences/patterns.md#agentsEach reference file contains practical, copy-pasteable code examples
The cookbook includes 50+ practical examples including:
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
Create employment contracts, offer letters, and HR policy documents following legal best practices. Use when drafting employment agreements, creating HR policies, or standardizing employment documentation.
Implement GDPR-compliant data handling with consent management, data subject rights, and privacy by design. Use when building systems that process EU personal data, implementing privacy controls, or conducting GDPR compliance reviews.