Agent skill

Anth Advanced Troubleshooting

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems.

MITAuto-check passedAI & LLM Engineering

Install Anth Advanced Troubleshooting

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-advanced-troubleshooting -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace anth-advanced-troubleshooting --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/anth-advanced-troubleshooting .claude/skills/anth-advanced-troubleshooting && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anth-advanced-troubleshooting
GitHub stars
2.8k
Token cost
~2.1k tokens
SKILL.md length
516 words
Files
1
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems.

  • Works in 5 steps: Reproduce the smallest failing case in… → For context failures, count tokens… → For streaming failures, count received… → …
  • With phrases like anthropic advanced debug
  • SKILL.md covers Issue: Context Window Overflow, Issue: Tool Use Not Triggering, Issue: Streaming Drops or… and Issue: Unexpected Stop Reason, plus 10 more sections
  • Calls curl; reaches api.anthropic.com; needs ANTHROPIC_API_KEY

What it does

Anth Advanced Troubleshooting is an agent skill from jeremylongshore/tons-of-skills-marketplace. 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".

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for Claude Code

It sits in AI & LLM Engineering, covering Context engineering and LLM API integration. It works with Anthropic API. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • With phrases like anthropic advanced debug
  • Claude complex issue
  • Claude tool use failing
  • Claude context overflow

Example prompts

  • “anthropic advanced debug”
  • “claude complex issue”
  • “claude tool use failing”
  • “/anth-advanced-troubleshooting”

Requirements

  • Python 3
  • A credential in ANTHROPIC_API_KEY
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Bash(curl:*), Grep

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Reproduce the smallest failing case in the sandbox and record a correlation ID. Change one input at a time, starting with token count and…
  2. For context failures, count tokens before sending and trim or summarize using an explicit policy that keeps required system context. For…
  3. For streaming failures, count received events and restart the complete non-resumable request with a bounded retry; deduplicate downstream…
  4. Compare stop reason, usage, latency, and output-shape assertions against the known-good baseline. Run one canary against the approved…
  5. If the canary changes scope, output policy, retention, or error rate, halt and roll back the prompt/model/configuration change. Remove…

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Bash(curl:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.anthropic.com

    Also links to:

    • platform.claude.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • ANTHROPIC_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Anth Advanced Troubleshooting loads about 2.1k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 516 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 516 words, ~2,099 tokens.

Download SKILL.mdSave it as .claude/skills/anth-advanced-troubleshooting/SKILL.md (or your agent's skills folder).
name
anth-advanced-troubleshooting
description
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".
allowed-tools
Read, Bash(curl:*), Grep
compatibility
Designed for Claude Code
version
1.7.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, ai, anthropic

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,
    tools=tools,
    tool_choice={"type": "any"},  # Must call at least one tool
    messages=[{"role": "user", "content": "Find products under $50"}]
)

Issue: Streaming Drops or Corruption

python
# Symptom: stream ends prematurely or text is garbled
# Cause: network interruption, proxy timeout, or large response

# Fix: implement reconnection with content tracking
def resilient_stream(client, **kwargs):
    """Stream with reconnection on failure."""
    collected_text = ""
    max_retries = 3

    for attempt in range(max_retries):
        try:
            with client.messages.stream(**kwargs) as stream:
                for text in stream.text_stream:
                    collected_text += text
                    yield text
                return  # Success
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            # Note: Claude streams are NOT resumable
            # Must restart from beginning
            collected_text = ""
            print(f"Stream interrupted, retrying ({attempt + 1}/{max_retries})")

Issue: Unexpected Stop Reason

Stop ReasonMeaningAction
end_turnNormal completionExpected
max_tokensHit token limitIncrease max_tokens
stop_sequenceHit stop sequenceCheck stop_sequences array
tool_useWants to call a toolProcess tool call and continue
python
# Debug unexpected truncation
msg = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=4096,  # Was it too low?
    messages=[{"role": "user", "content": long_prompt}]
)
print(f"Stop reason: {msg.stop_reason}")
print(f"Output tokens: {msg.usage.output_tokens}")
print(f"Max tokens: 4096")
# If output_tokens == max_tokens, response was truncated

Issue: Response Quality Degradation

python
# Checklist for quality issues:
# 1. System prompt too long or contradictory?
# 2. Conversation history too noisy (too many turns)?
# 3. Wrong model for task complexity?
# 4. Temperature too high for deterministic tasks?

# Debug: log the full request for review
import json
request_params = {
    "model": model,
    "max_tokens": max_tokens,
    "system": system[:200] + "...",  # Truncated for logging
    "message_count": len(messages),
    "temperature": temperature,
}
print(f"Request config: {json.dumps(request_params, indent=2)}")

Diagnostic Curl Commands

bash
# Test specific model availability
for model in claude-haiku-4-20250514 claude-sonnet-4-20250514 claude-opus-4-20250514; do
  echo -n "$model: "
  curl -s -o /dev/null -w "%{http_code}" https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d "{\"model\":\"$model\",\"max_tokens\":8,\"messages\":[{\"role\":\"user\",\"content\":\"hi\"}]}"
  echo
done

Overview

This guide isolates difficult Claude API failures by testing one variable at a time: token budget, tool schema and choice, stream transport, stop reason, or prompt configuration. It complements the common status-code guide and should produce evidence that is safe to share with an operator.

Prerequisites

  • Use an approved sandbox workspace, a pinned model ID, and synthetic messages/tools that cannot access production data or perform side effects.
  • Have a bounded request timeout, retry cap, token-counting access where enabled, and a known-good baseline request for comparison.
  • Configure telemetry to retain request ID, model, token counts, stop reason, event counts, and latency only; redact prompts, completions, tool arguments, headers, and secrets.

Instructions

  1. Reproduce the smallest failing case in the sandbox and record a correlation ID. Change one input at a time, starting with token count and request shape.
  2. For context failures, count tokens before sending and trim or summarize using an explicit policy that keeps required system context. For tool failures, validate the schema and use a no-op tool before enabling any real action.
  3. For streaming failures, count received events and restart the complete non-resumable request with a bounded retry; deduplicate downstream presentation by correlation ID.
  4. Compare stop reason, usage, latency, and output-shape assertions against the known-good baseline. Run one canary against the approved environment before promotion.
  5. If the canary changes scope, output policy, retention, or error rate, halt and roll back the prompt/model/configuration change. Remove synthetic fixtures after the receipt is written.
Show full SKILL.md (209 more words)Show less

Output

Return a troubleshooting receipt with correlation_id, hypothesis, changed variable, model, input/output token counts, stop reason, stream event counts, retry attempts, baseline comparison, canary status, rollback reference, and cleanup status. Keep all prompt, completion, tool-input, and credential fields redacted.

Error Handling

  • A token-counting call that fails is not evidence that the message call is safe; stop at the preflight gate and report the provider error without sending the full request.
  • Never treat a partial stream as a complete answer. Mark it incomplete, discard or quarantine it, and restart only when the operation is safe to repeat.
  • A tool-use response is untrusted input to the tool executor. Validate name and arguments against an allowlist, require approval for side effects, and reject unknown or malformed calls.
  • If a quality regression cannot be isolated, freeze promotion, preserve the redacted baseline comparison, and revert to the last known-good model/prompt pair.

Examples

Use a synthetic tool lookup_fixture whose only permitted input is fixture_id=demo-001; run the same prompt with and without tool_choice, and record tool_call_count, schema result, and side_effects=0. For a dropped stream, record events_received=17, complete=false, restart once with the same correlation policy, and expose only the final redacted result.

Resources

Next Steps

For load testing, see anth-load-scale.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/.curated/anth-advanced-troubleshooting of jeremylongshore/tons-of-skills-marketplace.

Open the folder on GitHubat commit cfae287

Compare with similar skills

Anth Advanced Troubleshooting next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anth Advanced Troubleshooting compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anth Advanced Troubleshooting this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.1kAutomated safety check: PassMIT
Gemini Video Understandingeinverne/dotfiles121—~2.6kAutomated safety check: NotesMIT
Compact Memory Implementationsimbajigege/book2skills183—~2.5kAutomated safety check: PassMIT
Cc GuidemikeOnBreeze/cc-crossbeam293—~668Automated safety check: PassMIT
Implement Universaliusztinpaul/designing-real-world-ai-agents-workshop512—~5.6kAutomated safety check: PassMIT
Claude Cookbooks Reference2025Emma/vibe-coding-cn23k1 repos~2.2kAutomated safety check: PassMIT

Similar skills

  • Analyze videos using Google's Gemini API - describe content, answer questions, transcribe audio with visual descriptions, reference timestamps, clip videos, and process YouTube URLs.

    121 GitHub stars~2.6k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Compact Memory Implementation

    simbajigege/book2skills

    A developer guide to adding compact memory to an agent: when to trigger compaction, how to fork a compactor sub-agent, what the summary holds, and how to restore it.

    183 GitHub stars~2.5k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Cc Guide

    mikeOnBreeze/cc-crossbeam

    Claude Code documentation expert. An agent skill from mikeOnBreeze/cc-crossbeam.

    293 GitHub stars~668 tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed
  • Implement Universal

    iusztinpaul/designing-real-world-ai-agents-workshop

    Harness-agnostic version of /implement. An agent skill from iusztinpaul/designing-real-world-ai-agents-workshop.

    512 GitHub stars~5.6k tokensUpdated 4 mo ago
    AI & LLM EngineeringAuto-check passed
  • Claude Cookbooks Reference

    2025Emma/vibe-coding-cn

    Reference of Claude API examples and guides covering tool use, vision, RAG, classification, summarization, text-to-SQL, prompt caching and agent patterns.

    23k GitHub starsUsed in 1 repo~2.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Gives text-only models sight by running the modlens CLI on an image path or URL and returning structured JSON evidence with transcribed text, layout and semantics.

    4.2k GitHub stars~1.3k tokensUpdated 7 days ago
    AI & LLM EngineeringAuto-check: notes

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Anth Advanced Troubleshooting

What does Anth Advanced Troubleshooting do?

Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems. Anth Advanced Troubleshooting is an agent skill from jeremylongshore/tons-of-skills-marketplace. Debug complex Claude API issues including context window overflow, tool use failures, streaming corruption, and response quality problems.

When should I use Anth Advanced Troubleshooting?

Anth Advanced Troubleshooting fits situations like: with phrases like anthropic advanced debug; Claude complex issue; Claude tool use failing; Claude context overflow.

How do I install Anth Advanced Troubleshooting in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-advanced-troubleshooting -a claude-code`. Or copy the skill folder (skills/.curated/anth-advanced-troubleshooting in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/anth-advanced-troubleshooting in your project. Claude Code loads it when a task matches its description.

How do I install Anth Advanced Troubleshooting in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-advanced-troubleshooting -a codex`. Or copy the skill folder (skills/.curated/anth-advanced-troubleshooting in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/anth-advanced-troubleshooting in your project. Codex loads it when a task matches its description.

Can I use Anth Advanced Troubleshooting in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-advanced-troubleshooting -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anth-advanced-troubleshooting, .gemini/skills/anth-advanced-troubleshooting, .github/skills/anth-advanced-troubleshooting and .opencode/skills/anth-advanced-troubleshooting in your project.

What does Anth Advanced Troubleshooting need to run?

Going by SKILL.md and its folder, Anth Advanced Troubleshooting needs the command-line tools its instructions call (curl) and credentials named ANTHROPIC_API_KEY. Our summary lists: Python 3; A credential in ANTHROPIC_API_KEY. Its frontmatter pre-approves these tools: Read, Bash(curl:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Anth Advanced Troubleshooting access the network?

SKILL.md names 2 domains. In commands or code: api.anthropic.com; the agent is likely to contact it when it follows the instructions. As links in the text: platform.claude.com. This is read from the text; nothing was executed.

Is Anth Advanced Troubleshooting safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Anth Advanced Troubleshooting use?

Anth Advanced Troubleshooting is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anth Advanced Troubleshooting use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Anth Advanced Troubleshooting?

Skills that share tags, products or a category with Anth Advanced Troubleshooting: Gemini Video Understanding (einverne/dotfiles, 121 stars), Compact Memory Implementation (simbajigege/book2skills, 183 stars), Cc Guide (mikeOnBreeze/cc-crossbeam, 293 stars) and Implement Universal (iusztinpaul/designing-real-world-ai-agents-workshop, 512 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anth Advanced Troubleshooting?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.