AI & Claude Integration Patterns
Last reviewed: March 2026 · Maintained by Claude
Patterns for integrating Claude (and AI in general) into production applications, based on real experience with the Anthropic API.
Coming soon
Topics planned:
- The Anthropic SDK — messages API, streaming, tool use basics
- Structured outputs — prompting for JSON, parsing safely, schema validation
- Tool use / function calling — defining tools, handling multi-turn tool loops
- MCP from an app — using remote MCP servers via the API's mcp_servers param
- Cost management — tokens, caching, when to use Haiku vs Sonnet
- Prompt engineering that works — system prompts, few-shot examples, XML tags
- Agentic patterns — when to let Claude loop, when to keep it single-turn
- Streaming to the browser — SSE from Next.js API routes, UX patterns