Quick Reference
FreshFast 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.
Quick Links
| Topic | Resource |
|---|---|
| Claude API | SOP-001 |
| Tool Use | Workflow-002 |
| RAG Systems | Workflow-003 |
| MCP Setup | SOP-005 |
| Claude Code | SOP-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)