Guide for debugging with targeted log injection and runtime analysis.
Suggests `/debug-tools:debug` when users report "X is not working" or errors. Injects targeted console logs with file:line references to trace execution flow and capture runtime values, then auto-cleans logs after debugging.
/plugin marketplace add adeonir/claude-code-extras/plugin install debug-tools@claude-code-extrasThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Guide for debugging with targeted log injection and runtime analysis.
Suggest /debug-tools:debug when users describe:
console.log('[DEBUG] [file:line] description', { values });
[DEBUG] - Prefix for grep and cleanup[file:line] - Location for navigationdescription - What this log checks{ values } - Relevant data (no sensitive info)// Lifecycle
console.log('[DEBUG] [Component.tsx:10] mount', { props });
// Effect
useEffect(() => {
console.log('[DEBUG] [Component.tsx:15] effect run', { deps });
return () => console.log('[DEBUG] [Component.tsx:17] cleanup');
}, [deps]);
// State
console.log('[DEBUG] [Component.tsx:25] before setState', { current: state });
// Request
console.log('[DEBUG] [route.ts:10] request', { method: req.method, path: req.path });
// Error
console.log('[DEBUG] [service.ts:30] caught error', { name: err.name, message: err.message });
console.log('[DEBUG] [api.ts:10] fetch start', { url, method });
console.log('[DEBUG] [api.ts:15] fetch done', { status: res.status, ok: res.ok });
| Pattern | Symptom | Check |
|---|---|---|
| Null access | "Cannot read property X of undefined" | Optional chaining, defaults |
| Race condition | Works sometimes, fails randomly | Async ordering, state timing |
| Stale closure | Using old values in callbacks | useCallback deps, event bindings |
| API mismatch | Data not displaying | Response shape, null handling |
| Silent error | Nothing happens | Empty catch blocks, missing error state |
| Score | Meaning | Action |
|---|---|---|
| >= 70 | High - clear evidence | Report as probable cause |
| 50-69 | Medium - possible | Suggest logs to confirm |
| < 50 | Low - speculation | Do not report |
After debugging, all [DEBUG] logs are removed automatically.
Manual check:
grep -rn '\[DEBUG\]' . --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx'
| MCP | Provides |
|---|---|
| Console Ninja | Runtime values, test status, coverage |
| Chrome DevTools | Network inspection, browser console, DOM state |
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 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 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.