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,926 stars 433 forks Updated yesterday 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
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category