anth-known-pitfalls

Featured

Identify and avoid common Claude API anti-patterns and integration mistakes. Use when reviewing code, onboarding developers, or debugging subtle issues with Anthropic integrations. Trigger with phrases like "anthropic pitfalls", "claude anti-patterns", "claude mistakes", "anthropic common issues", "claude gotchas".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Known Pitfalls ## Pitfall 1: Wrong Import / Class Name ```python # WRONG — common mistake from OpenAI muscle memory from anthropic import AnthropicClient # Does not exist # CORRECT import anthropic client = anthropic.Anthropic() ``` ```typescript // WRONG import { Anthropic } from '@anthropic-ai/sdk'; // CORRECT import Anthropic from '@anthropic-ai/sdk'; // Default export ``` ## Pitfall 2: Forgetting max_tokens (Required) ```python # WRONG — max_tokens is REQUIRED, unlike OpenAI msg = client.messages.create( model="claude-sonnet-4-20250514", messages=[{"role": "user", "content": "Hello"}] ) # Error: max_tokens is required # CORRECT msg = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, # Always specify messages=[{"role": "user", "content": "Hello"}] ) ``` ## Pitfall 3: System Prompt in Messages Array ```python # WRONG — putting system message in messages array (OpenAI pattern) messages = [ {"role": "system", "content": "You are helpful."}, # Will cause error {"role": "user", "content": "Hello"} ] # CORRECT — use the system parameter msg = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, system="You are helpful.", # Separate parameter messages=[{"role": "user", "content": "Hello"}] ) ``` ## Pitfall 4: Accessing Response Wrong ```python # WRONG — OpenAI response pattern text = response.choices[0].message.content # AttributeError # CORRECT — Anthropic ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

clade-known-pitfalls

Common mistakes when building with the Anthropic API and how to avoid them. Use when working with known-pitfalls patterns. Trigger with "anthropic mistakes", "claude pitfalls", "anthropic gotchas", "common claude errors", "anthropic anti-patterns".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-common-errors

Diagnose and fix Anthropic Claude API errors by HTTP status code. Use when encountering API errors, debugging failed requests, or troubleshooting authentication, rate limiting, or input validation issues. Trigger with phrases like "anthropic error", "claude api error", "fix anthropic 429", "claude not working", "debug claude api".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-common-errors

Diagnose and fix Anthropic API errors — authentication, rate limits, Use when working with common-errors patterns. overloaded, context length, and content policy issues. Trigger with "anthropic error", "claude 429", "claude overloaded", "anthropic not working", "debug claude api".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-sdk-patterns

Apply production-ready Anthropic SDK patterns for TypeScript and Python. Use when implementing Claude integrations, building reusable wrappers, or establishing team coding standards for the Messages API. Trigger with phrases like "anthropic SDK patterns", "claude best practices", "anthropic code patterns", "production claude code".

2,266 Updated today
jeremylongshore
AI & Automation Featured

anth-hello-world

Create a minimal working Anthropic Claude Messages API example. Use when starting a new Claude integration, testing your setup, or learning basic Messages API patterns for text, vision, and streaming. Trigger with phrases like "anthropic hello world", "claude api example", "anthropic quick start", "simple claude code", "first messages api call".

2,266 Updated today
jeremylongshore