本文へ移動
cccskills
無料GitHub で公開

anth-debug-bundle

Collect Anthropic Claude API debug evidence for support and troubleshooting. Use when encountering persistent API issues, preparing support tickets, or collecting diagnostic information including request IDs and rate limit headers. Trigger with phrases like "anthropic debug", "claude debug bundle", "collect anthropic logs", "anthropic diagnostic", "claude support ticket".

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Anthropic Debug Bundle

Overview

Collect diagnostic information for Claude API issues. Every API response includes a request-id header — this is the single most important piece of data for Anthropic support.

Prerequisites

  • Anthropic SDK installed
  • Access to application logs
  • ANTHROPIC_API_KEY set in environment

Instructions

Step 1: Capture Request ID

import anthropic

client = anthropic.Anthropic()

try:
    message = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=64,
        messages=[{"role": "user", "content": "test"}]
    )
    print(f"Request ID: {message._request_id}")  # req_01A1B2C3...
except anthropic.APIStatusError as e:
    print(f"Request ID: {e.response.headers.get('request-id')}")
    print(f"Status: {e.status_code}")
    print(f"Error: {e.message}")
// TypeScript — access raw response headers
const response = await client.messages.create({
  model: 'claude-sonnet-4-20250514',
  max_tokens: 64,
  messages: [{ role: 'user', content: 'test' }],
}).asResponse();

console.log('Request ID:', response.headers.get('request-id'));
console.log('Rate limit remaining:', response.headers.get('anthropic-ratelimit-requests-remaining'));

Step 2: Debug Bundle Script

#!/bin/bash
# anthropic-debug-bundle.sh
BUNDLE_DIR="anthropic-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"

echo "=== Anthropic Debug Bundle ===" > "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$BUNDLE_DIR/summary.txt"

# SDK versions
echo -e "\n--- SDK Versions ---" >> "$BUNDLE_DIR/summary.txt"
pip show anthropic 2>/dev/null | grep -E "^(Name|Version)" >> "$BUNDLE_DIR/summary.txt"
npm list @anthropic-ai/sdk 2>/dev/null >> "$BUNDLE_DIR/summary.txt"
python3 --version >> "$BUNDLE_DIR/summary.txt" 2>&1
node --version >> "$BUNDLE_DIR/summary.txt" 2>&1

# API key status (NEVER log the key itself)
echo -e "\n--- Auth Status ---" >> "$BUNDLE_DIR/summary.txt"
echo "ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:+SET (${#ANTHROPIC_API_KEY} chars)}" >> "$BUNDLE_DIR/summary.txt"

# Connectivity test with headers
echo -e "\n--- API Connectivity ---" >> "$BUNDLE_DIR/summary.txt"
curl -s -w "\nHTTP %{http_code} | Time: %{time_total}s" \
  -o "$BUNDLE_DIR/api-response.json" \
  -D "$BUNDLE_DIR/response-headers.txt" \
  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":"claude-sonnet-4-20250514","max_tokens":8,"messages":[{"role":"user","content":"1"}]}' \
  >> "$BUNDLE_DIR/summary.txt"

# Rate limit headers
echo -e "\n--- Rate Limit Headers ---" >> "$BUNDLE_DIR/summary.txt"
grep -i "ratelimit\|request-id\|retry-after" "$BUNDLE_DIR/response-headers.txt" >> "$BUNDLE_DIR/summary.txt"

# API status page
echo -e "\n--- API Status ---" >> "$BUNDLE_DIR/summary.txt"
curl -s https://status.anthropic.com/api/v2/status.json | python3 -c \
  "import sys,json; d=json.load(sys.stdin); print(d['status']['description'])" >> "$BUNDLE_DIR/summary.txt" 2>&1

# Package and clean up
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "Bundle: $BUNDLE_DIR.tar.gz"

Step 3: Redaction Rules

ALWAYS REDACT: API keys, user content/PII, authorization headers

SAFE TO INCLUDE: Request IDs, error messages, rate limit headers, SDK versions, status codes, timestamps

Output

The result is a timestamped compressed bundle containing a redacted summary, SDK and runtime versions, connection status, response headers, and request IDs that support can correlate. It must not contain an API key, authorization header, or customer prompt/response content; inspect the archive before it is attached to a ticket.

Error Handling

If the connectivity request returns an HTTP error, retain its status, request ID, and rate-limit headers in the bundle and record the time of the attempt. If the status endpoint or package lookup is unavailable, note that collection step as unavailable rather than inventing a result. If redaction cannot be verified, do not share the archive; recreate it after removing the unsafe source data.

Examples

When a production request repeatedly receives a 429, capture the request ID from the SDK exception, run the bundle script in a controlled environment, and attach only the reviewed archive plus the affected time window to support. When a response appears malformed, include the SDK version and a redacted error message, but replace the original user prompt with a short synthetic example that reproduces the behavior.

Key Headers for Debugging

HeaderExampleUse
request-idreq_01A1B2C3...Support ticket reference
anthropic-ratelimit-requests-limit1000Your RPM cap
anthropic-ratelimit-requests-remaining995Requests left
anthropic-ratelimit-tokens-limit80000Your TPM cap
anthropic-ratelimit-tokens-remaining79000Tokens left
retry-after30Seconds to wait (on 429)

Resources

Next Steps

For rate limit issues, see anth-rate-limits.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Build a synthetic-data CI gate for customer-controlled Abridge integration code without calling undocumented vendor interfaces. Use when adding regression checks to an Abridge deployment repository. Trigger with "test the Abridge integration".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Triage Abridge recording, note-review, Epic handoff, and access failures from observed evidence without inventing vendor error codes. Use when an Abridge clinical workflow is degraded. Trigger with "diagnose this Abridge issue".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Design and verify the clinician workflow from consent through recording, draft review, Linked Evidence, and final note disposition. Use when implementing or auditing an Abridge clinical documentation pathway. Trigger with "map the Abridge note workflow".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Verify the approved handoff of clinician-reviewed Abridge note sections into Epic templates and downstream workflows. Use when configuring or auditing Abridge-to-Epic documentation flow. Trigger with "verify the Abridge Epic handoff".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Evaluate Abridge adoption, workflow value, and avoidable operational friction without inventing prices or vendor billing meters. Use when reviewing an Abridge rollout or renewal. Trigger with "analyze Abridge value".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

Produce a PHI-minimized Abridge support bundle with provenance, redaction, and protected escalation boundaries. Use when support needs reproducible evidence for an Abridge issue. Trigger with "build an Abridge debug bundle".

日本語の概要は準備中です。原文の説明を表示しています。

jeremylongshore/tons-of-skills-marketplace2,8322026年10月13日 更新

jeremylongshore のスキルをすべて見る

このスキルの問題を報告する