```Claude 食谱```
Claude Cookbook

原始链接: https://platform.claude.com/cookbook/

这份文档与教程集涵盖了从 2023 年到 2026 年中期,基于 Claude 构建 AI 智能体(Agent)及工作流的演进历程。 内容按关键开发类别组织如下: * **智能体工作流 (Agentic Workflows):** 用于多智能体编排的高级模式,包括点对点通信、子智能体生成以及自主事件响应(SRE)。 * **托管智能体与 SDK:** 关于 Claude Agent SDK 和托管智能体的综合指南,涵盖部署层级(Docker、Kubernetes)、持久化用户记忆、工具作用域以及生产生命周期管理。 * **工具与 RAG:** 程序化工具调用、知识图谱构建,以及利用语义嵌入(semantic embeddings)和上下文压缩(context compaction)实现高性能检索增强生成(RAG)的技术实现。 * **评估与可靠性:** 用于构建“评分-修订”循环、提示词版本控制/回滚以及稳健安全护栏的框架。 * **能力与集成:** 多模态分析(视觉/裁剪工具)、语音助手、财务数据处理,以及与 Slack 和向量数据库等外部生态系统集成的实用示例。 总体而言,这些资源为将 Claude 从基础的“提示-响应”任务扩展为复杂、自主且具备自验证能力的智能体系统提供了路线图。

这篇 Hacker News 帖子讨论了人工智能“指南”(cookbooks)和提示词工程(prompt engineering)教程的价值,许多用户对此持怀疑态度。 主流观点认为,随着模型能力的提升并原生集成这些功能,许多正式的“提示词工程”建议(例如复杂的思维链或繁琐的 `CLAUDE.md` 文件)正变得过时。许多参与讨论者认为,花费时间学习这些转瞬即逝的框架适得其反;他们更倾向于直接与模型进行自然对话,并指出清晰、高质量的人类语言通常就已足够。 一些用户表达了对那些“凭感觉编码”(vibe-coded)的教程的失望,这些教程往往提供可疑的设计或编程建议,而用户认为简单直接的沟通通常能产生最好的效果。虽然有些人认为这些指南在培训团队成员或了解模型基础能力方面有一定价值,但另一些人则将其视为一种“表演”,认为这分散了开发软件这一主要目标的注意力。 讨论还简要延伸到了 AI 在烹饪实践中的应用,许多用户称赞大语言模型在食谱改编和替代食材方面的作用,并幽默地表达了他们对“Claude Cookbook”并非一本真正的烹饪指南的共同失望。
相关文章

原文
Reproduce Claude's agentic search benchmark scores in the Messages API

Build a Messages API harness that reproduces published DeepSearchQA and BrowseComp scores, using programmatic tool calling, server-side compaction, and task budgets.

EvalsTools

Jun 2026Classifier fallback and billing for Claude Fable 5
Jun 2026

ResponsesSafeguardsBilling

Detect safety classifier blocks on Fable 5 and fall back to Opus 4.8 with server-side or SDK-based client-side fallback, including streaming behavior and the new billing changes.

ResponsesSafeguardsBilling

Jun 2026Async multi-agent orchestration
Jun 2026

Agent Patterns

Two async multi-agent patterns — a fixed N-agent team with peer messaging through a shared hub, and dynamically spawned async subagents — reduced to their bare messaging and lifecycle mechanics.

Agent Patterns

Jun 2026Hosting your agent
May 2026

Claude Agent SDK

Deploy the research agent from notebook 00 through three tiers of operational maturity (Docker, Modal, Kubernetes) with the same container image and HTTP interface at every tier.

Claude Agent SDK

May 2026Multiagent: coordinate a specialist team
May 2026

Claude Managed AgentsTools

Heterogeneous team via the multiagent coordinator config — a coordinator runs three specialists (web-search researcher, file-reading librarian, rules-based pricer) with scoped toolsets to assemble a sales proposal. Covers the multiagent field, the thread_created / thread_message_received event types, and per-role tool scoping.

Claude Managed AgentsTools

May 2026Outcomes: agents that verify their own work
May 2026

Claude Managed AgentsEvals

Build a grade-and-revise loop with Outcomes: a writer drafts a cited research brief, a stateless grader fetches every URL and checks every quote against a rubric, and feedback drives revisions until the brief passes. Covers user.define_outcome, the span.outcome_evaluation_* events, and how to write a rubric the grader can act on.

Claude Managed AgentsEvals

May 2026Build agents that remember your users
Apr 2026

Claude Managed AgentsTools

Give your Claude Managed Agents a Memory store so they learn and remember your users' preferences across multiple interactions.

Claude Managed AgentsTools

Apr 2026The vulnerability detection agent
Apr 2026

Claude Agent SDKCybersecurity

Build a vulnerability-discovery agent with the Claude Agent SDK that threat-models a C target, hunts memory-safety bugs with built-in file tools, and triages findings into a structured report.

Claude Agent SDKCybersecurity

Apr 2026Build an SRE incident response agent with Claude Managed Agents
Apr 2026

Claude Managed AgentsObservability

Wire Claude into your on-call flow: when an alert fires, the agent reads logs and runbooks, pinpoints the root cause, opens a fix PR, and waits for your approval before merging.

Claude Managed AgentsObservability

Apr 2026Build a data analyst agent with Claude Managed Agents
Apr 2026

Claude Managed AgentsTools

Build an analyst that turns a CSV into a narrative HTML report with interactive charts, using a sandboxed environment and file mounting.

Claude Managed AgentsTools

Apr 2026Build a Slack data analyst bot with Claude Managed Agents
Apr 2026

Claude Managed AgentsIntegrations

Mention the bot with a CSV to get an analysis report in-thread, with multi-turn follow-ups on the same session.

Claude Managed AgentsIntegrations

Apr 2026Managed Agents tutorial: iterate on a failing test suite
Apr 2026

Claude Managed AgentsTools

Entry-point tutorial for the Claude Managed Agents API. Walks through agent / environment / session creation, file mounts, and the streaming event loop by getting an agent to fix three planted bugs in a calc.py package.

Claude Managed AgentsTools

Apr 2026Managed Agents tutorial: production setup
Apr 2026

Claude Managed AgentsIntegrations

End-to-end production story for Managed Agents — vault-backed MCP credentials, the session.status_idled webhook pattern for human-in-the-loop without long-lived connections, and the resource lifecycle CRUD verbs.

Claude Managed AgentsIntegrations

Apr 2026Managed Agents tutorial: prompt versioning and rollback
Apr 2026

Claude Managed AgentsEvals

Server-side prompt versioning — create v1, evaluate against a labelled test set, ship v2, detect a regression, roll back by pinning sessions to version 1. Covers agents.update, version pinning on sessions.create, and where the review gate moves when prompts are not code.

Claude Managed AgentsEvals

Apr 2026Threat intelligence enrichment agent
Apr 2026

ToolsAgent PatternsCybersecurity

Build an agent that autonomously investigates IOCs by querying multiple threat intel sources, cross-referencing findings, mapping to MITRE ATT&CK, and producing structured reports for SIEM and SOAR integration.

ToolsAgent PatternsCybersecurity

Apr 2026Building a session browser
Mar 2026

Claude Agent SDKAgent Patterns

List, read, rename, tag, and fork Agent SDK sessions on disk to build a conversation history sidebar without writing a transcript parser.

Claude Agent SDKAgent Patterns

Mar 2026Knowledge graph construction with Claude
Mar 2026

RAG & RetrievalTools

Build knowledge graphs from unstructured text using Claude for entity extraction, relation mining, deduplication, and multi-hop graph querying.

RAG & RetrievalTools

Mar 2026Context engineering: memory, compaction, and tool clearing
Mar 2026

ToolsAgent Patterns

Compare context engineering strategies for long-running agents and learn when each applies, what it costs, and how they compose.

ToolsAgent Patterns

Mar 2026Migrating from the OpenAI Agents SDK
Mar 2026

Claude Agent SDKAgent Patterns

Port an OpenAI Agents SDK app to the Claude Agent SDK, mapping each primitive (tools, guardrails, sessions, handoffs) through a single expense-approval agent example.

Claude Agent SDKAgent Patterns

Mar 2026The site reliability agent
Feb 2026

Claude Agent SDKAgent Patterns

Build an incident response agent with read-write MCP tools for autonomous diagnosis, remediation, and post-mortem documentation.

Claude Agent SDKAgent Patterns

Feb 2026Session memory compaction
Jan 2026

Agent PatternsResponses

Manage long-running Claude conversations with instant session memory compaction using background threading and prompt caching.

Agent PatternsResponses

Jan 2026Programmatic tool calling (PTC)

Reduce latency and token consumption by letting Claude write code that calls tools programmatically in the code execution environment.

Tools

Nov 2025Tool search with embeddings
Nov 2025

ToolsRAG & Retrieval

Scale Claude applications to thousands of tools using semantic embeddings for dynamic tool discovery.

ToolsRAG & Retrieval

Nov 2025Automatic context compaction
Nov 2025

ToolsAgent Patterns

Manage context limits in long-running agentic workflows by automatically compressing conversation history.

ToolsAgent Patterns

Nov 2025Low latency voice assistant with ElevenLabs

Build a low-latency voice assistant using ElevenLabs for speech-to-text and text-to-speech combined with Claude.

Integrations

Nov 2025Giving Claude a crop tool for better image analysis
Nov 2025

MultimodalTools

Give Claude a crop tool to zoom into image regions for detailed analysis of charts, documents, and diagrams.

MultimodalTools

Nov 2025Prompting for frontend aesthetics
Oct 2025

ResponsesSkills

Guide to prompting Claude for distinctive, polished frontend designs avoiding generic aesthetics.

ResponsesSkills

Oct 2025Claude Skills for financial applications

Build financial dashboards and portfolio analytics using Claude's Excel, PowerPoint, PDF skills.

Skills

Oct 2025Building custom Skills for Claude

Create, deploy, and manage custom skills extending Claude with specialized organizational workflows.

Skills

Oct 2025Introduction to Claude Skills

Create documents, analyze data, automate workflows with Claude's Excel, PowerPoint, PDF skills.

Skills

Oct 2025The one-liner research agent
Sep 2025

Claude Agent SDKAgent Patterns

Build a research agent using Claude Code SDK with WebSearch for autonomous research.

Claude Agent SDKAgent Patterns

Sep 2025The chief of staff agent
Sep 2025

Claude Agent SDKAgent Patterns

Build multi-agent systems with subagents, hooks, output styles, and plan mode features.

Claude Agent SDKAgent Patterns

Sep 2025The observability agent
Sep 2025

Claude Agent SDKAgent Patterns

Connect agents to external systems via MCP servers for GitHub monitoring and CI workflows.

Claude Agent SDKAgent Patterns

Sep 2025Tool evaluation

Run parallel agent evaluations on tools independently from evaluation task files.

Evals

Sep 2025Usage & cost Admin API cookbook

Programmatically access and analyze your Claude API usage and cost data via Admin API.

Observability

Aug 2025Memory & context management with Claude Sonnet 4.6
May 2025

ToolsAgent Patterns

Build AI agents with persistent memory using Claude's memory tool and context editing.

ToolsAgent Patterns

May 2025Speculative prompt caching

Reduce time-to-first-token by warming cache speculatively while users formulate their queries.

Responses

May 2025Parallel tool calls on Claude 3.7 Sonnet

Enable parallel tool calls on Claude 3.7 Sonnet using batch tool meta-pattern workaround.

Tools

Mar 2025Extended thinking

Use Claude's extended thinking for transparent step-by-step reasoning with budget management.

Thinking

Feb 2025Extended thinking with tool use

Combine extended thinking with tools for transparent reasoning during multi-step workflows.

ThinkingTools

Feb 2025Basic workflows
Dec 2024

Agent Patterns

Three simple multi-LLM workflow patterns trading cost or latency for improved performance.

Agent Patterns

Dec 2024Evaluator optimizer
Dec 2024

Agent PatternsEvals

Workflow pattern using one LLM for generation and another for evaluation feedback loop.

Agent PatternsEvals

Dec 2024Orchestrator workers
Dec 2024

Agent Patterns

Central LLM dynamically delegates tasks to worker LLMs and synthesizes their combined results.

Agent Patterns

Dec 2024Batch processing with Message Batches API

Process large volumes of Claude requests asynchronously with 50% cost reduction using batches.

Responses

Oct 2024Text to SQL with Claude
Sep 2024

RAG & Retrieval

Convert natural language queries to SQL using RAG, chain-of-thought, and self-improvement techniques.

RAG & Retrieval

Sep 2024Enhancing RAG with contextual retrieval
Sep 2024

RAG & Retrieval

Improve RAG accuracy by adding context to chunks before embedding with prompt caching.

RAG & Retrieval

Sep 2024Finetuning Claude 3 Haiku on Bedrock

Step-by-step guide to finetuning Claude 3 Haiku on Amazon Bedrock for custom tasks.

Fine-Tuning

Aug 2024Generate synthetic test data for your prompt template

Generate synthetic test cases to evaluate and improve your Claude prompt templates effectively.

Evals

Aug 2024Prompt caching through the Claude API

Cache and reuse prompt context for cost savings and faster responses with detailed instructions.

Responses

Aug 2024Summarization with Claude
Aug 2024

RAG & RetrievalResponses

Comprehensive guide to summarizing legal documents with evaluation and advanced techniques.

RAG & RetrievalResponses

Aug 2024Retrieval augmented generation
Jul 2024

RAG & Retrieval

Build and optimize RAG systems with Claude using summary indexing and reranking techniques.

RAG & Retrieval

Jul 2024Classification with Claude
May 2024

RAG & Retrieval

Build classification systems with Claude using RAG and chain-of-thought for insurance tickets.

RAG & Retrieval

May 2024Tool choice

Control how Claude selects tools using tool_choice parameter for forced or auto selection.

Tools

May 2024Using vision with tools
May 2024

MultimodalTools

Combine Claude's vision with tools to extract structured data from images like nutrition labels.

MultimodalTools

May 2024Sampling responses from Claude beyond the max tokens limit

Generate longer responses beyond max_tokens limit using prefill technique with message continuation.

Responses

May 2024Best practices for using vision with Claude

Tips and techniques for optimal image processing performance with Claude's vision capabilities.

Multimodal

May 2024Note-saving tool with Pydantic and Anthropic tool use

Create validated tools using Pydantic models for type-safe Claude tool use interactions.

Tools

Apr 2024Transcribe an audio file with Deepgram & use Anthropic to prepare interview questions!
Apr 2024

IntegrationsMultimodal

Transcribe audio with Deepgram and generate interview questions using Claude for preparation.

IntegrationsMultimodal

Apr 2024Using the Wolfram Alpha LLM API as a tool with Claude
Apr 2024

IntegrationsTools

Integrate Wolfram Alpha LLM API as Claude tool for computational queries and answers.

IntegrationsTools

Apr 2024Using a calculator tool with Claude

Provide Claude with calculator tool for arithmetic operations and mathematical problem solving.

Tools

Apr 2024Creating a customer service agent with client-side tools
Apr 2024

ToolsAgent Patterns

Build customer service chatbot with Claude using tools for customer lookup and order management.

ToolsAgent Patterns

Apr 2024Extracting structured JSON using Claude and tool use
Apr 2024

ResponsesTools

Extract structured JSON data from various inputs using Claude's tool use capabilities.

ResponsesTools

Apr 2024Metaprompt

Prompt engineering tool that generates starting prompts for your tasks to solve blank-page problem.

Responses

Mar 2024Citations
Mar 2024

ResponsesRAG & Retrieval

Enable Claude to provide detailed source citations when answering document-based questions for verification.

ResponsesRAG & Retrieval

Mar 2024Claude 3 RAG agents with LangChain v1
Mar 2024

IntegrationsRAG & RetrievalAgent Patterns

Build RAG agents with Claude 3 using LangChain v1's updated agent framework patterns.

IntegrationsRAG & RetrievalAgent Patterns

Mar 2024Summarizing web page content with Claude 3 Haiku
Mar 2024

RAG & Retrieval

Fetch and summarize web page content using Claude 3 Haiku via URL extraction.

RAG & Retrieval

Mar 2024Using Haiku as a sub-agent
Mar 2024

Agent Patterns

Analyze financial reports using Haiku sub-agents for extraction and Opus for synthesis.

Agent Patterns

Mar 2024Multi-modal
Mar 2024

IntegrationsMultimodal

Use LlamaIndex's Anthropic MultiModal LLM abstraction for image understanding and reasoning.

IntegrationsMultimodal

Mar 2024How to build a RAG system using Claude 3 and MongoDB
Mar 2024

IntegrationsRAG & Retrieval

Build chatbot RAG system with Claude and MongoDB using tech news as knowledge base.

IntegrationsRAG & Retrieval

Mar 2024Building evals

Build robust evaluation systems to measure and improve Claude's performance on key metrics.

Evals

Mar 2024Building a moderation filter with Claude

Build customizable content moderation filters by defining rules and categories in prompts.

Responses

Mar 2024Prompting Claude for "JSON mode"

Get reliable JSON output from Claude using effective prompting techniques without constrained sampling.

Responses

Mar 2024How to make SQL queries with Claude
Mar 2024

RAG & Retrieval

Generate SQL queries from natural language questions using Claude with database schema context.

RAG & Retrieval

Mar 2024Getting started - how to pass images into Claude

Tutorial on passing images to Claude 3 API for vision-based text analysis.

Multimodal

Mar 2024How to transcribe documents with Claude

Extract and structure unstructured text from images and PDFs using Claude 3's vision.

Multimodal

Mar 2024Working with charts, graphs, and slide decks

Extract insights from charts, graphs, and presentations using Claude's vision analysis capabilities.

Multimodal

Mar 2024Multi-document agents
Mar 2024

IntegrationsRAG & RetrievalAgent Patterns

Build RAG for large document collections using DocumentAgents with ReAct Agent pattern.

IntegrationsRAG & RetrievalAgent Patterns

Mar 2024ReAct agent
Mar 2024

IntegrationsAgent PatternsTools

Create ReAct agents with LlamaIndex for tool-based reasoning and action workflows.

IntegrationsAgent PatternsTools

Mar 2024RAG pipeline with LlamaIndex
Mar 2024

IntegrationsRAG & Retrieval

Build basic RAG pipeline with LlamaIndex for document retrieval and question answering.

IntegrationsRAG & Retrieval

Mar 2024RouterQuery engine
Mar 2024

IntegrationsRAG & Retrieval

Route queries to different indices using LlamaIndex RouterQueryEngine for multi-document search.

IntegrationsRAG & Retrieval

Mar 2024SubQuestionQueryEngine
Mar 2024

IntegrationsRAG & Retrieval

Decompose complex queries into sub-questions across multiple documents using LlamaIndex engine.

IntegrationsRAG & Retrieval

Mar 2024Retrieval-augmented generation using Pinecone
Feb 2024

IntegrationsRAG & Retrieval

Connect Claude with Pinecone vector database for retrieval-augmented generation and semantic search.

IntegrationsRAG & Retrieval

Feb 2024"Uploading" PDFs to Claude via the API
Aug 2023

RAG & Retrieval

Process and summarize PDF documents using Claude API with text extraction and encoding.

RAG & Retrieval

Aug 2023Iteratively searching Wikipedia with Claude

Legacy notebook showing iterative Wikipedia searches with Claude 2 for research workflows.

Integrations

Aug 2023
联系我们 contact @ memedata.com