anth-advanced-troubleshooting

Featured

Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems. Trigger with phrases like "anthropic advanced debug", "claude complex issue", "claude tool use failing", "claude context overflow".

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 Advanced Troubleshooting ## Issue: Context Window Overflow ```python # Symptom: invalid_request_error about token count # Diagnosis: pre-check with Token Counting API import anthropic client = anthropic.Anthropic() count = client.messages.count_tokens( model="claude-sonnet-4-20250514", messages=conversation_history, system=system_prompt ) print(f"Input tokens: {count.input_tokens}") # Claude Sonnet: 200K context, Claude Opus: 200K context # Fix: truncate oldest messages or summarize def trim_conversation(messages: list, max_tokens: int = 180_000) -> list: """Keep recent messages within token budget.""" # Always keep first (system context) and last 5 messages if len(messages) <= 5: return messages return messages[:1] + messages[-5:] # Crude but effective ``` ## Issue: Tool Use Not Triggering ```python # Symptom: Claude responds with text instead of calling tools # Diagnosis checklist: # 1. Tool description must clearly state WHEN to use the tool # 2. User message must match the tool's trigger condition # BAD description (too vague): {"name": "search", "description": "Search for things"} # GOOD description (clear trigger): {"name": "search_products", "description": "Search the product catalog by name, category, or price range. Use whenever the user asks about products, pricing, or availability."} # Force tool use if needed: message = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, ...

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-advanced-troubleshooting

Debug complex Claude issues — inconsistent outputs, tool use failures, Use when working with advanced-troubleshooting patterns. streaming problems, and edge cases. Trigger with "claude inconsistent", "anthropic advanced debug", "claude tool use broken", "anthropic streaming issues".

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

anth-core-workflow-a

Build Claude tool use (function calling) workflows with the Messages API. Use when implementing tool use, function calling, agent loops, or building AI assistants that interact with external systems. Trigger with phrases like "claude tool use", "anthropic function calling", "claude tools", "agent loop anthropic", "tool_use blocks".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

1 Updated 1 weeks ago
DROOdotFOO
AI & Automation Featured

anth-known-pitfalls

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".

2,266 Updated today
jeremylongshore