/ Verzeichnis / Playground / Anthropic Cookbook
● Offiziell anthropics ⚡ Sofort

Anthropic Cookbook

von anthropics · anthropics/anthropic-cookbook

Anthropics offizielles Rezeptbuch für Claude — Caching, Batching, RAG, Agenten, Multimodal, Citations — mit lauffähigen Notebooks.

anthropics/anthropic-cookbook ist die offizielle Rezeptsammlung für die Claude-API. Jedes Rezept ist ein fokussiertes Notebook: Prompt-Caching, Message-Batching, agentische Loops, RAG mit Citations, Multimodal-Vision, Klassifizierung und Evaluierung. Als Skill-Ressource verwenden damit Claude Implementierungsvorschläge auf getesteten Beispielen aufbauen kann.

Warum nutzen

Hauptfunktionen

Live-Demo

In der Praxis

bereit

Installieren

Wählen Sie Ihren Client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "anthropic-cookbook-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anthropics/anthropic-cookbook",
        "~/.claude/skills/anthropic-cookbook"
      ],
      "_inferred": true
    }
  }
}

Öffne Claude Desktop → Settings → Developer → Edit Config. Nach dem Speichern neu starten.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "anthropic-cookbook-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anthropics/anthropic-cookbook",
        "~/.claude/skills/anthropic-cookbook"
      ],
      "_inferred": true
    }
  }
}

Cursor nutzt das gleiche mcpServers-Schema wie Claude Desktop. Projektkonfiguration schlägt die globale.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "anthropic-cookbook-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anthropics/anthropic-cookbook",
        "~/.claude/skills/anthropic-cookbook"
      ],
      "_inferred": true
    }
  }
}

Klicken Sie auf das MCP-Servers-Symbol in der Cline-Seitenleiste, dann "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "anthropic-cookbook-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anthropics/anthropic-cookbook",
        "~/.claude/skills/anthropic-cookbook"
      ],
      "_inferred": true
    }
  }
}

Gleiche Struktur wie Claude Desktop. Windsurf neu starten zum Übernehmen.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "anthropic-cookbook-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/anthropics/anthropic-cookbook",
        "~/.claude/skills/anthropic-cookbook"
      ]
    }
  ]
}

Continue nutzt ein Array von Serverobjekten statt einer Map.

~/.config/zed/settings.json
{
  "context_servers": {
    "anthropic-cookbook-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/anthropics/anthropic-cookbook",
          "~/.claude/skills/anthropic-cookbook"
        ]
      }
    }
  }
}

In context_servers hinzufügen. Zed lädt beim Speichern neu.

claude mcp add anthropic-cookbook-skill -- git clone https://github.com/anthropics/anthropic-cookbook ~/.claude/skills/anthropic-cookbook

Einzeiler. Prüfen mit claude mcp list. Entfernen mit claude mcp remove.

Anwendungsfälle

Praxisnahe Nutzung: Anthropic Cookbook

Prompt-Caching hinzufügen um die Claude-API-Rechnung zu senken

👤 Engineers, die Claude in Produktion betreiben ⏱ ~60 min intermediate

Wann einsetzen: API-Ausgaben steigen und du hast wiederholten Kontext pro Anfrage.

Ablauf
  1. Rezept lesen
    Use anthropic-cookbook. Show me the prompt caching pattern for repeated system prompts.✓ Kopiert
    → cache_control-Beispiel
  2. Auf meinen Code anwenden
    Adapt to my service that re-sends a 5k-token style guide every call.✓ Kopiert
    → Gecachter System-Prompt; Kostenprognose
  3. Ersparnisse verifizieren
    Measure cache hit rate and cost delta over 100 calls.✓ Kopiert
    → Konkrete Kosteneinsparung

Ergebnis: Echte Kosteneinsparungen (~50-80% am gecachten Teil).

Fallstricke
  • Cache-Lebensdauer ist kurz — hochfrequente Workloads profitieren am meisten — Niedrigfrequente API sieht eventuell keine Hits; vor der Optimierung kalibrieren
Kombinieren mit: anthropic-courses-skill

Offline-Scoring-Jobs auf Message-Batching umstellen für 50% Rabatt

👤 Teams, die große Eval/Klassifizierungs-Jobs ausführen ⏱ ~45 min intermediate

Wann einsetzen: Job ist asynchron und du hast >100 Aufrufe.

Ablauf
  1. Batch-Rezept verwenden
    Apply batching from the cookbook to my classification job.✓ Kopiert
    → Batch-Endpunkt-Integration gezeigt
  2. Fertigstellung + Kosten verifizieren
    Compare batched cost vs sync for 1000 prompts.✓ Kopiert
    → Kosten um ~50% reduziert

Ergebnis: Günstigere Offline-Workloads, gleiche Genauigkeit.

Ein RAG-System bauen das seine Quellen ordentlich zitiert

👤 Entwickler, die Q&A über Dokumente bauen ⏱ ~90 min intermediate

Wann einsetzen: Nutzer werden Antworten anfechten; du brauchst Zitate die sie verifizieren können.

Ablauf
  1. Citations-Muster übernehmen
    Use the citations recipe. Apply to my doc set.✓ Kopiert
    → Antworten referenzieren Quell-IDs
  2. Inline-Links hinzufügen
    Map source IDs to URLs so users can click through.✓ Kopiert
    → Verlinkte Citations

Ergebnis: Vertrauenswürdiges RAG mit Audit-Trail.

Kombinationen

Mit anderen MCPs für 10-fache Wirkung

anthropic-cookbook-skill + anthropic-courses-skill

Cookbook = Praxis, Kurse = Theorie

anthropic-cookbook-skill + anthropic-quickstarts-skill

App-Skeleton + Cookbook-Rezepte

Werkzeuge

Was dieses MCP bereitstellt

WerkzeugEingabenWann aufrufenKosten
(Notebook-Rezepte) natürliches Nachschlagen Wenn ein bekanntes Claude-Muster benötigt wird 0

Kosten & Limits

Was der Betrieb kostet

API-Kontingent
Rezepte rufen die API auf — Nutzungsgebühren gelten beim Ausführen
Tokens pro Aufruf
Variabel pro Rezept
Kosten in €
Kostenlos (MIT)
Tipp
Sonnet während der Entwicklung verwenden; nur für Prompts die es brauchen auf Opus wechseln

Sicherheit

Rechte, Secrets, Reichweite

Minimale Scopes: anthropic-api-key
Credential-Speicherung: ANTHROPIC_API_KEY in Umgebungsvariable
Datenabfluss: Anthropic-API

Fehlerbehebung

Häufige Fehler und Lösungen

Rezept verwendet alte SDK-Version

Anthropic SDK erhöhen; kleinere API-Änderungen erfordern eventuell 2-Zeilen-Updates

Cache-Hits zeigen 0 in Produktion

Cache-Schlüssel ist inhaltsempfindlich; sogar ein einzelner Token-Unterschied = Miss. Präfixe stabilisieren.

Alternativen

Anthropic Cookbook vs. andere

AlternativeWann stattdessenKompromiss
anthropics/anthropic-quickstartsDu möchtest ganze Apps, keine RezepteAndere Granularität
anthropics/coursesDu möchtest Pädagogik, keine ImplementierungTheorie vs Praxis

Mehr

Ressourcen

📖 Offizielle README auf GitHub lesen

🐙 Offene Issues ansehen

🔍 Alle 400+ MCP-Server und Skills durchsuchen