Skip to content

Quick Reference

Fresh

Fast lookup for common commands, patterns, and troubleshooting.

Sections

Commands & Snippets

Common code patterns, API calls, and CLI commands.

Troubleshooting

Solutions to common errors and issues.

Courses Overview

Complete list of Anthropic Academy courses.

4D Framework

Quick guide to AI Fluency framework.

TopicResource
Claude APISOP-001
Tool UseWorkflow-002
RAG SystemsWorkflow-003
MCP SetupSOP-005
Claude CodeSOP-004

Essential Patterns

Basic API Call

python
import anthropic

client = anthropic.Anthropic()

response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Hello, Claude!"}
    ]
)

print(response.content[0].text)

Tool Definition

python
tools = [{
    "name": "get_data",
    "description": "Retrieve data from source",
    "input_schema": {
        "type": "object",
        "properties": {
            "query": {"type": "string"}
        },
        "required": ["query"]
    }
}]

MCP Server Skeleton

python
from mcp.server import Server
from mcp.server.stdio import stdio_server

server = Server("my-server")

@server.list_tools()
async def list_tools():
    return [{"name": "my_tool", ...}]

@server.call_tool()
async def call_tool(name, arguments):
    return {"result": "..."}

async def main():
    async with stdio_server() as (read, write):
        await server.run(read, write)

Based on Anthropic Academy courses