Integration
Claude Developer Platform
Build applications with the Claude API and Anthropic SDK covering tool use, streaming, system prompts, and the Agent SDK.
Last reviewed Mar 2, 2026
Install
Create this file in your project:
.claude/skills/claude-developer-platform/SKILL.md---
name: claude-developer-platform
description: Use this skill when building applications that integrate with the Claude API, using the Anthropic SDK, or implementing AI features with Claude.
---
# Claude Developer Platform
## When to Use
- Building an application that calls the Claude API
- Implementing tool use (function calling) with Claude
- Setting up streaming responses for real-time UI
- Using the Anthropic Agent SDK for agentic workflows
- Configuring system prompts and conversation management
## Process
1. **Set up the SDK** -- Install the Anthropic SDK for your language (`@anthropic-ai/sdk` for TypeScript, `anthropic` for Python). Configure the API key from environment variables.
2. **Design the conversation** -- Structure the system prompt, define the message format, and decide on conversation management (stateless vs. multi-turn).
3. **Implement the integration**:
- For simple completions: Use `messages.create()` with appropriate model, system prompt, and messages.
- For streaming: Use `messages.stream()` and handle `text`, `content_block_start`, and `message_stop` events.
- For tool use: Define tools with JSON Schema input schemas, handle `tool_use` content blocks, return `tool_result` messages.
- For agents: Use the Agent SDK with tool definitions and an agentic loop.
4. **Handle errors** -- Implement retry logic for rate limits (429), handle API errors gracefully, and set appropriate timeouts.
## Rules
- Use the latest Claude model IDs: `claude-sonnet-4-20250514` for fast tasks, `claude-opus-4-20250514` for complex reasoning.
- Never hardcode API keys. Always use environment variables (`ANTHROPIC_API_KEY`).
- Implement exponential backoff for rate limit errors (HTTP 429).
- Set `max_tokens` explicitly. Do not rely on defaults.
- For tool use: validate tool inputs before executing them. Never trust model-generated inputs blindly.
- For streaming: handle all event types, including errors mid-stream.
- Keep system prompts concise and specific. Long, vague system prompts degrade performance.
- Use `messages` API, not the deprecated `completions` API.
- For multi-turn conversations, manage token budgets by summarizing or truncating old messages.What this skill does
Claude Developer Platform helps you build applications that integrate with the Claude API correctly and efficiently. It covers the core patterns: basic message completion, streaming for real-time UIs, tool use for giving Claude the ability to take actions, and the Agent SDK for building autonomous agent workflows.
The skill emphasizes production readiness. It's straightforward to get a basic API call working, but handling rate limits, managing conversation token budgets, validating tool inputs, and streaming partial responses correctly are where real applications succeed or fail.
Tool use (function calling) is particularly important as it's the foundation for building AI agents and assistants that can interact with external systems. The skill covers defining tools with proper JSON Schema, handling the tool use loop, and validating inputs before execution -- a critical security step that's easy to overlook.
Example workflow
You ask the agent to add a Claude-powered chat feature to your app. The agent will:
- Install
@anthropic-ai/sdkand set up the client with the API key from environment variables. - Create a chat API route that accepts messages and streams responses using
messages.stream(). - Define tools for the chat (e.g.,
search_products,check_inventory) with JSON Schema input definitions. - Implement the agentic loop: send messages, check for tool use blocks, execute tools, send tool results back.
- Add error handling: retry on 429 with exponential backoff, timeout after 30 seconds, graceful error messages for users.
- Implement token budget management: count tokens in the conversation, summarize when approaching the limit.
Tips
- Start with
claude-sonnet-4-20250514for development and testing -- it's faster and cheaper, then switch toclaude-opus-4-20250514for tasks that need it - For streaming UIs, buffer partial words and render at content block boundaries for smoother text display
- When defining tools, write clear descriptions -- Claude uses them to decide when to call each tool
- Test tool use flows with edge cases: what happens when a tool fails, returns empty results, or times out
Best with tools
Related MCP servers
- No linked MCP servers yet.