PRESENTATION 10 OF 10

Summary &
Quick Reference

The Complete Claude Cheat Sheet

Anthropic Claude Series · 2025

MODELS PRICING API TOOLS
OVERVIEW

The Complete Series

#PresentationKey Topics
01Introduction to ClaudeWhat Claude is, Constitutional AI, model family, capabilities
02Getting StartedAccount setup, first conversations, plans & pricing basics
03Claude.ai Deep DiveWeb UI, Projects, Artifacts, keyboard shortcuts, tips
04Claude CodeCLI installation, slash commands, CLAUDE.md, agentic coding
05API & SDKREST API, Python/TypeScript SDKs, streaming, tool use
06IntegrationsMCP servers, IDE plugins, CI/CD, third-party tools
07AgentsAgentic patterns, multi-agent, orchestration, guardrails
08Productivity & WorkflowsPrompt engineering, templates, batch processing, automation
09Future CapabilitiesRoadmap, computer use, extended thinking, research
10Summary & Quick ReferenceThis deck — cheat sheets, tables, templates, links
MODELS

Model Comparison Cheat Sheet

AttributeHaiku 3.5Sonnet 4Opus 4
Speed (tokens/sec)Fastest (~100+ t/s)Fast (~80 t/s)Moderate (~50 t/s)
Input $/1M tokens$0.80$3.00$15.00
Output $/1M tokens$4.00$15.00$75.00
Context Window200K tokens1M tokens1M tokens
Max Output8,192 tokens16,000 tokens32,000 tokens
VisionYesYesYes
Tool UseYesYesYes
Extended ThinkingNoYesYes
Best ForClassification, routing, high-volume tasks, chatCoding, analysis, general-purpose, daily driverComplex reasoning, research, agentic tasks
API Model IDclaude-3-5-haiku-latestclaude-sonnet-4-20250514claude-opus-4-20250514

Tip: Use Haiku for routing/classification, Sonnet as your default, Opus for hard problems.

PRICING

Pricing Quick Reference

Consumer & Business Plans

PlanPriceIncludes
Free$0/moLimited Sonnet access, basic features
Pro$20/moAll models, 5x more usage, Projects
Max$100–$200/moPro + highest usage limits
Team$30/seat/moPro + admin, sharing, higher limits
EnterpriseCustomSSO, SCIM, audit logs, SLA, dedicated

API Pricing (per 1M tokens)

ModelInputOutput
Haiku 3.5$0.80$4.00
Sonnet 4$3.00$15.00
Opus 4$15.00$75.00

Prompt caching: 90% discount on cache hits. Batches: 50% discount.

Claude Code

Included with Max plan ($100/mo) or uses API credits directly. Max includes 5x Pro usage for Claude Code.

SHORTCUTS

Claude.ai Keyboard Shortcuts

ActionShortcut
New conversationCtrl/Cmd + Shift + O
Focus chat inputCtrl/Cmd + Shift + ;
Send messageEnter
New line (without send)Shift + Enter
Copy last responseCtrl/Cmd + Shift + C
Stop generationEsc
Toggle sidebarCtrl/Cmd + Shift + S
ActionShortcut
Search conversationsCtrl/Cmd + K
Upload fileCtrl/Cmd + U
Select modelCtrl/Cmd + /
Toggle dark/light modeCtrl/Cmd + Shift + L
Create ArtifactAsk Claude to create one
Star conversationCtrl/Cmd + Shift + F
Delete conversationCtrl/Cmd + Shift + D

On macOS use Cmd, on Windows/Linux use Ctrl. Shortcuts may update — check Help menu.

CLAUDE CODE

Claude Code Command Reference

CommandDescription
/helpShow help and available commands
/clearClear conversation history
/compactCompact conversation to save context
/configOpen or edit configuration
/costShow token usage and cost
/doctorDiagnose setup issues
/initInitialize CLAUDE.md in project
CommandDescription
/loginAuthenticate with Anthropic
/logoutSign out of current session
/modelSwitch model (sonnet/opus)
/permissionsView and manage tool permissions
/reviewReview git changes / PR
/statusShow current session status
/terminal-setupInstall shell integration (Shift+Enter)

Run claude --help for CLI flags: --model, --allowedTools, --print, --dangerously-skip-permissions

TOOLS

Claude Code Tool Reference

ToolPurposeKey Parameters
ReadRead file contents (text, images, PDFs)file_path, offset, limit, pages
WriteCreate new files or full rewritesfile_path, content
EditExact string replacement in filesfile_path, old_string, new_string, replace_all
BashExecute shell commandscommand, timeout, run_in_background
GrepRegex search across files (ripgrep)pattern, path, glob, output_mode
GlobFind files by name patternpattern, path
AgentSpawn sub-agent for complex subtaskstask, tools
WebFetchFetch content from URLsurl, format
WebSearchSearch the webquery, max_results

Permissions: tools require approval on first use. Grant with /permissions or allowedTools in settings.

API

API Quick Reference

Key Endpoints

EndpointMethod
/v1/messagesPOST — Create message
/v1/messagesPOST (stream) — Stream response
/v1/messages/batchesPOST — Batch requests
/v1/messages/count_tokensPOST — Count tokens

Required Headers

x-api-key: YOUR_API_KEY
anthropic-version: 2023-06-01
content-type: application/json

Base URL: https://api.anthropic.com

Common Request Body Parameters

ParameterTypeRequiredDescription
modelstringYesModel ID (e.g., claude-sonnet-4-20250514)
messagesarrayYesConversation messages [{role, content}]
max_tokensintYesMaximum tokens in response
systemstringNoSystem prompt
temperaturefloatNo0.0 – 1.0 (default 1.0)
streamboolNoEnable SSE streaming
toolsarrayNoTool definitions for function calling
PYTHON

Python SDK Cheat Sheet

# Installation
pip install anthropic

# Basic usage
import anthropic
client = anthropic.Anthropic()  # uses ANTHROPIC_API_KEY

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[
        {"role": "user",
         "content": "Explain quantum computing"}
    ]
)
print(message.content[0].text)
# Streaming
with client.messages.stream(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{"role": "user",
               "content": "Write a poem"}]
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

# With system prompt
message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    system="You are a helpful tutor.",
    messages=[{"role": "user",
               "content": "Explain gravity"}]
)
# Tool use
tools = [{"name": "get_weather", "description": "Get current weather",
  "input_schema": {"type": "object", "properties": {"location": {"type": "string"}}, "required": ["location"]}}]
msg = client.messages.create(model="claude-sonnet-4-20250514", max_tokens=1024, tools=tools,
  messages=[{"role": "user", "content": "Weather in Tokyo?"}])
TYPESCRIPT

TypeScript SDK Cheat Sheet

// Installation
npm install @anthropic-ai/sdk

// Basic usage
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic(); // ANTHROPIC_API_KEY

const message = await client.messages.create({
  model: "claude-sonnet-4-20250514",
  max_tokens: 1024,
  messages: [
    { role: "user",
      content: "Explain quantum computing" }
  ],
});
console.log(message.content[0].text);
// Streaming
const stream = client.messages.stream({
  model: "claude-sonnet-4-20250514",
  max_tokens: 1024,
  messages: [
    { role: "user", content: "Write a poem" }
  ],
});

for await (const event of stream) {
  if (event.type === "content_block_delta"
   && event.delta.type === "text_delta") {
    process.stdout.write(event.delta.text);
  }
}

const finalMessage = await stream.finalMessage();
// Multi-turn conversation
const messages = [
  { role: "user", content: "What is the capital of France?" },
  { role: "assistant", content: "The capital of France is Paris." },
  { role: "user", content: "What is its population?" }
];
const resp = await client.messages.create({ model: "claude-sonnet-4-20250514", max_tokens: 1024, messages });
PROMPTING

Prompt Engineering Cheat Sheet

Do

  • Be specific and explicit about desired output
  • Use XML tags to structure input: <context>, <instructions>
  • Provide examples (few-shot) for complex formats
  • Set role in system prompt: "You are a senior engineer..."
  • Ask Claude to think step-by-step for reasoning
  • Specify output format: JSON, markdown, table
  • Use prefilled assistant responses to steer output
  • Break complex tasks into subtasks

Don't

  • Don't use vague instructions ("make it better")
  • Don't overload a single prompt with many tasks
  • Don't rely on implied context — be explicit
  • Don't ignore system prompts (they're powerful)
  • Don't set temperature to 0 unless determinism needed
  • Don't forget to handle tool_use stop reasons
  • Don't send huge contexts when a summary suffices
  • Don't skip testing with edge cases

Key Patterns

Chain of Thought: "Think step by step"   Few-Shot: Provide 2-3 examples   Role: System prompt persona   XML Tags: <doc>...</doc> for structure   Prefill: Start assistant response with desired prefix

TEMPLATE

CLAUDE.md Template

# CLAUDE.md - Project Instructions for Claude Code

## Project Overview
This is a [type] project using [stack]. The main entry point is [file].

## Tech Stack
- Language: TypeScript 5.x / Python 3.12
- Framework: Next.js 14 / FastAPI
- Database: PostgreSQL with Prisma / SQLAlchemy
- Testing: Jest / pytest

## Key Commands
- `npm run dev` — start dev server
- `npm test` — run test suite
- `npm run lint` — lint and format

## Code Conventions
- Use functional components with hooks (React)
- Prefer named exports over default exports
- All functions must have docstrings/JSDoc
- Error handling: use Result types, never throw

## Architecture
- /src/components — React components
- /src/lib — shared utilities
- /src/api — API route handlers
- /src/db — database models and migrations

## Important Notes
- Never modify files in /src/generated/
- Always run tests before committing
- Use conventional commit messages
TEMPLATE

agents.md Template

# agents.md - Instructions for Sub-Agents

## Role
You are a specialized agent focused on [specific task].
You have access to: Read, Grep, Glob tools only.

## Constraints
- Do NOT modify any files — only read and analyze
- Do NOT run shell commands
- Report findings in structured format
- Stay focused on the assigned subtask

## Output Format
Return your findings as:
1. Summary (1-2 sentences)
2. Relevant files (absolute paths)
3. Key findings (bulleted list)
4. Confidence level (high/medium/low)

## Context
The parent agent will provide you with a specific
question about the codebase. Answer it thoroughly
by searching and reading relevant files.

Where to Place

CLAUDE.md goes in project root (or ~/.claude/CLAUDE.md for global). agents.md is referenced from CLAUDE.md or passed to sub-agents via the Agent tool.

MCP

MCP Configuration Reference

Config Location

~/.claude/claude_desktop_config.json (Desktop)
.mcp.json (Project-level for Claude Code)

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/path/to/allowed/dir"
      ]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_xxx"
      }
    }
  }
}

Popular MCP Servers

ServerPurpose
server-filesystemLocal file read/write access
server-githubGitHub API (repos, PRs, issues)
server-postgresPostgreSQL database queries
server-sqliteSQLite database access
server-brave-searchWeb search via Brave
server-puppeteerBrowser automation
server-slackSlack workspace access
server-memoryPersistent knowledge graph
server-sequential-thinkingStep-by-step reasoning

Install: npx @modelcontextprotocol/create-server myserver

DECISION

Integration Decision Matrix

Use CaseBest OptionWhy
Quick questions & brainstormingClaude.aiNo setup, rich UI, artifacts
Coding in a repoClaude Code CLIFull repo context, file editing, git-aware
IDE-integrated codingVS Code / JetBrains pluginInline suggestions, stays in editor
Building a product/appAPI + SDKFull control, custom UI, production-grade
High-volume processingBatch API50% cheaper, async, up to 10K requests
Real-time chat productStreaming APISSE, token-by-token, low latency
Connecting external toolsMCPStandardized protocol, growing ecosystem
CI/CD automationClaude Code + GitHub ActionsHeadless mode, PR reviews, code gen
Multi-agent orchestrationAPI + Agent frameworkCustom routing, tool use, state management
Data analysis / researchClaude.ai ProjectsUpload docs, persistent context, artifacts
Team knowledge baseTeam plan + ProjectsShared projects, admin controls
ERRORS

Error Codes Reference

HTTP CodeError TypeCauseSolution
400invalid_request_errorMalformed request bodyCheck required fields, message format, model ID
401authentication_errorInvalid or missing API keyVerify x-api-key header, check key status
403permission_errorKey lacks required permissionsCheck API key scopes and workspace access
404not_found_errorInvalid endpoint or modelVerify URL path and model ID spelling
429rate_limit_errorToo many requests or tokensImplement exponential backoff, check tier limits
529overloaded_errorAPI is temporarily overloadedRetry with backoff, consider off-peak times
500api_errorInternal server errorRetry request; if persistent, check status page

Retry Strategy

Exponential backoff: 1s, 2s, 4s, 8s, 16s. Max 5 retries. Only retry 429, 529, 500. Add jitter to avoid thundering herd.

Rate Limits by Tier

Tier 1: 60 RPM, 60K tokens/min. Tier 2: 1000 RPM, 80K t/m. Tier 3: 2000 RPM, 160K t/m. Tier 4: 4000 RPM, 400K t/m. Check with x-ratelimit-* headers.

TOKENS

Token & Cost Calculator

Context Windows

ModelInputOutput
Haiku 4.5200K tokens8K tokens
Sonnet 4.6, Opus 4.61M tokens16K-32K tokens

1 token ~ 4 characters ~ 0.75 words (English). 1M tokens ~ 750K words ~ 2,500 pages.

Cost Formulas

input_cost = input_tokens * (price / 1M)
output_cost = output_tokens * (price / 1M)
total = input_cost + output_cost

# Example: Sonnet, 1K in / 500 out
# ($3 * 1000/1M) + ($15 * 500/1M)
# = $0.003 + $0.0075 = $0.0105

Optimization Tips

Prompt Caching
Cache static system prompts and long documents. 90% input discount on cache hits. Min 1024 tokens to cache.

Batch API
50% discount for non-urgent requests. Results within 24 hours. Up to 10,000 requests per batch.

Token Reduction
Summarize long docs before sending. Use smaller models for simple tasks. Set appropriate max_tokens.

SECURITY

Security Checklist

API Key Management

  • Store keys in environment variables or secrets manager
  • Never commit keys to version control
  • Use .env files locally + .gitignore
  • Rotate keys regularly
  • Use separate keys per environment (dev/staging/prod)
  • Set workspace-level key restrictions
  • Monitor key usage in Console

Data Handling

  • Don't send PII unless necessary
  • Sanitize user input before API calls
  • Use system prompts to prevent data exfiltration
  • Validate and sanitize model outputs
  • Log prompts/responses for audit trail
  • Implement output filtering for sensitive data
  • Review data retention policies

Compliance & Access

  • SOC 2 Type II certified (Enterprise)
  • HIPAA eligible (Enterprise BAA)
  • Use SSO/SCIM for team access (Enterprise)
  • Enable audit logs for all API calls
  • Set rate limits per user/team
  • Implement role-based access control
  • Review Anthropic's Usage Policy

Common Mistakes to Avoid

Hardcoding API keys in source code • Exposing keys in client-side JavaScript • Logging full API responses with sensitive data • Not validating model output before executing • Skipping input sanitization • Using production keys in development

GLOSSARY

Key Terms Defined

TermDefinition
Constitutional AI (CAI)Anthropic's alignment method using a set of principles to train helpful, harmless, honest AI
RLHFReinforcement Learning from Human Feedback — training technique using human preference rankings
TokensSmallest units of text processed by the model (~4 chars in English)
Context WindowMaximum number of tokens (input + output) a model can process in one call
System PromptSpecial instructions that set the model's behavior, role, and constraints
TemperatureControls randomness in output: 0 = deterministic, 1 = more creative
Stop SequenceString that causes the model to stop generating when encountered
TermDefinition
MCPModel Context Protocol — open standard (donated to the Linux Foundation's Agentic AI Foundation) for connecting AI to external tools and data
Tool UseAbility for Claude to call defined functions and process their results
ArtifactsRich, interactive outputs (code, documents, diagrams) in Claude.ai
Extended ThinkingMode where Claude shows its reasoning process (chain-of-thought)
Prompt CachingReuse previously sent context at 90% cost reduction
Batch APIAsync endpoint for processing many requests at 50% discount
Agentic CodingAI autonomously reads, writes, tests code with tool access
SSEServer-Sent Events — protocol for streaming API responses
RESOURCES

Links & Resources

Official Products

  • claude.ai — Web interface
  • console.anthropic.com — API Console
  • anthropic.com — Company site
  • claude.ai/download — Desktop apps

Documentation

  • docs.anthropic.com — API docs
  • docs.anthropic.com/en/docs/claude-code — Claude Code
  • modelcontextprotocol.io — MCP spec (Linux Foundation Agentic AI Foundation)
  • github.com/anthropics — SDKs

SDKs & Tools

  • anthropic-ai/anthropic-sdk-python
  • anthropic-ai/anthropic-sdk-typescript
  • anthropic-ai/anthropic-sdk-java
  • anthropic-ai/anthropic-sdk-go
  • anthropic-ai/anthropic-sdk-ruby, C#, PHP
  • anthropics/claude-code — CLI
  • modelcontextprotocol/servers — MCP

Community & Support

  • support.anthropic.com — Help center
  • status.anthropic.com — API status
  • discord.gg/anthropic — Discord community
  • anthropic.com/research — Research papers

Important Pages

  • anthropic.com/policies — Usage policy
  • anthropic.com/pricing — Current pricing
  • anthropic.com/news — Announcements
  • console.anthropic.com/settings — API keys

End of Series — Thank you for following along! Bookmark this reference deck.