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".
Best use case
clade-advanced-troubleshooting is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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".
Teams using clade-advanced-troubleshooting should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/clade-advanced-troubleshooting/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How clade-advanced-troubleshooting Compares
| Feature / Agent | clade-advanced-troubleshooting | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Anthropic Advanced Troubleshooting
## Overview
Debug complex Claude integration issues that go beyond basic error handling — inconsistent outputs, tool use failures where Claude calls nonexistent tools, streaming connection drops, max_tokens truncation, and image/vision format problems.
## Inconsistent Outputs
**Symptom:** Same prompt gives different answers each time.
**Cause:** `temperature` defaults to 1.0 (maximum randomness).
```typescript
// Fix: Set temperature to 0 for deterministic outputs
const message = await client.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
temperature: 0, // Deterministic
messages,
});
```
## Tool Use Failures
**Symptom:** Claude calls a tool that doesn't exist or sends wrong parameters.
```typescript
// Always validate tool calls before executing
const toolUse = response.content.find(b => b.type === 'tool_use');
if (toolUse) {
const validTools = tools.map(t => t.name);
if (!validTools.includes(toolUse.name)) {
console.error(`Claude requested unknown tool: ${toolUse.name}`);
// Send error back as tool_result
messages.push({ role: 'assistant', content: response.content });
messages.push({ role: 'user', content: [{
type: 'tool_result',
tool_use_id: toolUse.id,
is_error: true,
content: `Tool "${toolUse.name}" does not exist. Available: ${validTools.join(', ')}`,
}]});
}
}
```
## Streaming Connection Drops
**Symptom:** Stream stops mid-response without `message_stop` event.
```typescript
// Detect incomplete streams
const stream = client.messages.stream({ ... });
let gotStop = false;
for await (const event of stream) {
if (event.type === 'message_stop') gotStop = true;
// ... process events
}
if (!gotStop) {
console.error('Stream ended without message_stop — connection dropped');
// Retry the request
}
```
## `max_tokens` Truncation
**Symptom:** Response cuts off mid-sentence.
```typescript
const message = await client.messages.create({ ... });
if (message.stop_reason === 'max_tokens') {
console.warn('Response truncated — increase max_tokens or ask for shorter output');
// Option 1: Increase max_tokens
// Option 2: Add "Be concise" to system prompt
// Option 3: Continue the response with another call
}
```
## Image/Vision Issues
**Symptom:** Claude says it can't see the image.
- Max image size: 5MB
- Supported: PNG, JPEG, GIF, WebP
- Max 20 images per request
- Base64 encoding must be correct (no data URI prefix in the `data` field)
```typescript
// Correct image format
{
type: 'image',
source: {
type: 'base64',
media_type: 'image/png', // Must match actual format
data: buffer.toString('base64'), // Raw base64, no "data:image/png;base64," prefix
},
}
```
## Output
- Inconsistent outputs fixed via temperature control
- Tool use validated against defined tool names before execution
- Streaming connection drops detected and retried
- Truncated responses identified via `stop_reason` check
- Image format issues resolved (correct media_type, raw base64, size limits)
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| API Error | Check error type and status code | See `clade-common-errors` |
## Examples
See Inconsistent Outputs (temperature fix), Tool Use Failures (validation), Streaming Connection Drops (detection), max_tokens Truncation (stop_reason check), and Image/Vision Issues (correct format) above.
## Resources
- [Error Types](https://docs.anthropic.com/en/api/errors)
- [Tool Use Guide](https://docs.anthropic.com/en/docs/build-with-claude/tool-use)
- [Vision Docs](https://docs.anthropic.com/en/docs/build-with-claude/vision)
## Next Steps
See `clade-debug-bundle` for collecting support evidence.
## Prerequisites
- Completed `clade-common-errors` for basic error handling
- Familiarity with Claude API response structure
- Access to application logs with full request/response data
## Instructions
### Step 1: Review the patterns below
Each section contains production-ready code examples. Copy and adapt them to your use case.
### Step 2: Apply to your codebase
Integrate the patterns that match your requirements. Test each change individually.
### Step 3: Verify
Run your test suite to confirm the integration works correctly.Related Skills
troubleshooting-guide-creator
Troubleshooting Guide Creator - Auto-activating skill for Technical Documentation. Triggers on: troubleshooting guide creator, troubleshooting guide creator Part of the Technical Documentation skill category.
exa-advanced-troubleshooting
Apply advanced debugging techniques for hard-to-diagnose Exa issues. Use when standard troubleshooting fails, investigating latency spikes, or preparing evidence bundles for Exa support escalation. Trigger with phrases like "exa hard bug", "exa mystery error", "exa deep debug", "difficult exa issue", "exa latency spike".
customerio-advanced-troubleshooting
Apply Customer.io advanced debugging and incident response. Use when diagnosing complex delivery issues, investigating campaign failures, or running incident playbooks. Trigger: "debug customer.io", "customer.io investigation", "customer.io troubleshoot", "customer.io incident", "customer.io not delivering".
cursor-advanced-composer
Advanced Cursor Composer techniques: agent mode, parallel agents, complex refactoring, and multi-step orchestration. Triggers on "advanced composer", "composer patterns", "multi-file generation", "composer refactoring", "agent mode", "parallel agents".
clay-advanced-troubleshooting
Deep-debug complex Clay enrichment failures, provider degradation, and data flow issues. Use when standard troubleshooting fails, investigating intermittent enrichment failures, or preparing detailed evidence for Clay support escalation. Trigger with phrases like "clay hard bug", "clay mystery error", "clay impossible to debug", "difficult clay issue", "clay deep debug".
clade-webhooks-events
Use Anthropic Message Batches for async bulk processing and event handling. Use when working with webhooks-events patterns. Trigger with "anthropic batches", "claude batch api", "anthropic async", "bulk claude processing", "anthropic webhook".
clade-upgrade-migration
Upgrade Anthropic SDK versions and migrate between Claude model generations. Use when working with upgrade-migration patterns. Trigger with "upgrade anthropic sdk", "migrate claude model", "anthropic breaking changes", "new claude model".
clade-security-basics
Secure your Anthropic integration — API key management, input validation, Use when working with security-basics patterns. prompt injection defense, and data privacy. Trigger with "anthropic security", "claude api key security", "anthropic prompt injection", "secure claude integration".
clade-sdk-patterns
Production-ready Anthropic SDK patterns — client config, retries, timeouts, Use when working with sdk-patterns patterns. error handling, TypeScript types, and async patterns. Trigger with "anthropic sdk", "claude client setup", "anthropic typescript", "anthropic python patterns".
clade-reliability-patterns
Build fault-tolerant Claude integrations — retries, circuit breakers, Use when working with reliability-patterns patterns. fallbacks, timeouts, and graceful degradation. Trigger with "anthropic reliability", "claude fault tolerance", "anthropic circuit breaker", "claude fallback".
clade-reference-architecture
Build Claude Code plugins — skills, agents, MCP servers, hooks, and slash commands. Use when working with reference-architecture patterns. The complete guide to extending Claude Code with the Anthropic plugin system. Trigger with "claude code plugin", "build a skill", "create mcp server", "anthropic plugin architecture", "claude code hooks".
clade-rate-limits
Handle Anthropic rate limits — understand tiers, implement backoff, Use when working with rate-limits patterns. optimize throughput, and monitor usage. Trigger with "anthropic rate limit", "claude 429", "anthropic throttling", "anthropic usage limits", "claude tokens per minute".