This skill should be used when the user asks to "debug this", "fix this bug", "why is this failing", "investigate error", "getting an error", "exception thrown", "crash", "not working", "what's causing this", "root cause", "diagnose this issue", or describes any software bug or error. Also activates when spawning subagents for debugging tasks, using Task tool for bug investigation, or coordinating multiple agents on a debugging problem. Provides memory-first debugging workflow that checks past incidents before investigating.
Checks debugging memory for similar past issues before investigating new bugs. Automatically activates when you request debugging help or spawn subagents for bug investigation.
/plugin marketplace add tyroneross/claude-code-debugger/plugin install claude-code-debugger@RossLabs-claude-pluginsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/incident-example.jsonreferences/incident-documentation.mdreferences/pattern-extraction.mdreferences/subagent-integration.mdThis skill integrates the claude-code-debugger memory system into debugging workflows. The core principle: never solve the same bug twice.
Before investigating any bug, always check the debugging memory:
npx @tyroneross/claude-code-debugger debug "<symptom description>"
Decision tree based on results:
When this skill activates, always announce it to the user:
This ensures users know the debugger is active and working.
When no past solution applies, follow this systematic approach:
Establish a reliable reproduction path:
Narrow down the problem space:
Find the root cause:
Implement the solution:
Confirm the fix works:
After fixing a bug, document it for future retrieval.
Claude Code should directly write incident files to .claude/memory/incidents/ using the Write tool. No CLI command needed.
Step 1: Generate incident ID
INC_YYYYMMDD_HHMMSS_xxxx
Where xxxx is 4 random alphanumeric characters. Example: INC_20241231_143052_a7b2
Step 2: Write JSON file
.claude/memory/incidents/INC_20241231_143052_a7b2.json
Minimal incident structure:
{
"incident_id": "INC_20241231_143052_a7b2",
"timestamp": 1735654252000,
"symptom": "User-facing description of the bug",
"root_cause": {
"description": "Technical explanation of why the bug occurred",
"file": "path/to/problematic/file.ts",
"category": "logic|config|dependency|performance|react-hooks",
"confidence": 0.85
},
"fix": {
"approach": "What was done to fix it",
"changes": [
{
"file": "path/to/file.ts",
"lines_changed": 10,
"change_type": "modify|add|delete",
"summary": "Brief description of change"
}
]
},
"verification": {
"status": "verified|unverified",
"regression_tests_passed": true,
"success_criteria_met": true
},
"tags": ["relevant", "keywords", "for", "search"],
"files_changed": ["list/of/all/files.ts"],
"quality_score": 0.75
}
Step 3: Ensure directory exists Before writing, create the directory if needed:
mkdir -p .claude/memory/incidents
The Stop hook automatically mines the session audit trail when a session ends:
npx @tyroneross/claude-code-debugger mine --days 1 --store
Audit Trail Limitations:
.claude/audit/ (markdown files from completed sessions)When mining returns 0 incidents:
Recommended workflow:
/debugger-scan to check what can be mined from past sessionsThe memory system scores incidents on:
Target 75%+ quality score for effective future retrieval.
Apply descriptive tags for better searchability:
react, typescript, api, databaselogic, config, dependency, performancecrash, render, timeout, validationWhen the memory system finds a match:
The memory system automatically extracts patterns when 3+ similar incidents exist. Patterns represent reusable solutions with higher reliability than individual incidents.
When a pattern matches:
| Command | Purpose |
|---|---|
/debugger "symptom" | Search memory for similar bugs |
/debugger-status | Show memory statistics |
/debugger-scan | Mine recent sessions for incidents |
/assess "symptom" | Run parallel domain assessment |
For complex issues that may span multiple areas (database, frontend, API, performance), use parallel assessment to diagnose all domains simultaneously.
Four specialized assessor agents are available:
| Assessor | Expertise |
|---|---|
database-assessor | Prisma, PostgreSQL, queries, migrations, connection issues |
frontend-assessor | React, hooks, rendering, state, hydration, SSR |
api-assessor | Endpoints, REST/GraphQL, auth, middleware, CORS |
performance-assessor | Latency, memory, CPU, bottlenecks, optimization |
Launch assessors in parallel using the Task tool:
For: "search is slow and returns wrong results"
Launch simultaneously:
- database-assessor (query performance)
- api-assessor (endpoint correctness)
- performance-assessor (latency analysis)
Each assessor returns a JSON assessment with:
confidence: 0-1 scoreprobable_causes: List of likely issuesrecommended_actions: Steps to fixrelated_incidents: Past memory matches| Domain | Trigger Keywords |
|---|---|
| Database | query, schema, migration, prisma, sql, connection, constraint, index |
| Frontend | react, hook, useEffect, render, component, state, hydration, browser |
| API | endpoint, route, request, response, auth, 500, 404, cors, middleware |
| Performance | slow, latency, timeout, memory, leak, cpu, bottleneck, optimization |
After parallel assessments complete:
The debugger can ingest traces from multiple sources to aid diagnosis:
When traces are available:
Traces are summarized to minimize token usage while preserving key diagnostic information.
The memory system uses tiered retrieval to minimize context size:
| Tier | Token Usage | Content |
|---|---|---|
| Summary | ~100 tokens | ID, symptom preview, category |
| Compact | ~200 tokens | Short keys, essential fields |
| Full | ~550 tokens | Complete incident details |
Default budget: 2500 tokens
The system automatically selects the appropriate tier based on available budget.
For detailed guidance, consult:
references/incident-documentation.md - Complete guide to documenting incidentsreferences/pattern-extraction.md - How patterns are extracted and usedreferences/subagent-integration.md - How to integrate with custom subagentsexamples/incident-example.json - Sample high-quality incidentWhen debugging involves subagents (your own or from other plugins), follow these guidelines to ensure debugging memory is utilized.
Before spawning debugging-related subagents:
npx @tyroneross/claude-code-debugger debug "<symptom>"Example subagent prompt with debugging context:
Investigate the database timeout issue.
DEBUGGING MEMORY CONTEXT:
- Found 2 similar incidents: INC_20241215_db_timeout, INC_20241201_pool_exhaust
- Pattern PTN_connection_pool suggests checking pool size and idle timeout
- Previous fix: Increased pool size from 10 to 25 in DATABASE_URL
Start your investigation considering this prior knowledge.
Inform the user when debugging memory cannot be used with subagents:
External MCP tools: "Note: The debugging subagent is using external MCP tools that cannot access local debugging memory. I searched memory beforehand and found [X matching incidents / no matches]."
Third-party agents: "Note: This third-party debugging agent doesn't have access to your project's debugging memory. Consider using /debugger first to check for similar past issues."
Sandboxed environments: "Note: The subagent runs in a sandboxed environment without access to debugging memory. I've pre-loaded relevant context from [X] matching incidents."
If you create custom debugging subagents, include this in their system prompt:
## Debugging Memory Integration
Before investigating, check the debugging memory:
\`\`\`bash
npx @tyroneross/claude-code-debugger debug "<symptom>"
\`\`\`
Use results to:
- Skip re-investigation of known issues (confidence >70%)
- Use past fixes as starting points (confidence 40-70%)
- Document new findings after resolution
After fixing, document the incident by writing a JSON file to:
\`\`\`
.claude/memory/incidents/INC_YYYYMMDD_HHMMSS_xxxx.json
\`\`\`
For full debugging memory access, subagents need:
Bash tool - to run CLI commandsRead tool - to examine incident files (optional but helpful)If a subagent lacks Bash access, it cannot query debugging memory directly. In this case:
When using parallel assessment (/assess) or multiple debugging subagents:
Example flow:
1. Search: npx @tyroneross/claude-code-debugger debug "app crashing on login"
2. Spawn parallel: database-assessor, api-assessor, frontend-assessor
- Each receives: symptom + relevant past incidents
3. Collect: assessments from all agents
4. Store: unified incident with root cause from winning assessment
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.