Claude
Skills
Sign in
Back

debug-tools

Included with Lifetime
$97 forever

Iterative debugging workflow with confidence scoring, pattern comparison, and strategic log injection. Investigate, fix, verify loop with auto-cleanup of debug logs and escalation to architectural review after 3 failed attempts. Use when diagnosing unexpected behavior, silent errors, intermittent failures, "tests pass but app fails", or "works in dev but not in prod". Triggers: "debug this", "investigate", "trace issue", "add debug logs", "cleanup debug logs", "why is this broken", "why is X not working". Not for known one-line fixes where the user names file and line, runtime error review on deployed services, or PM bug-report triage.

Code Review

What this skill does


# Debug Tools

Iterative debugging workflow with flexible technique selection and escalation.

## Workflow

```
investigate --> fix --> verify --> done
  ^_______________________|  (max 3 attempts, then escalate)
```

Core loop: investigate, fix, verify. Techniques (log injection, pattern
comparison, focus area analysis) are tools within investigation, not
mandatory phases. Log cleanup happens automatically after verification
succeeds.

## Triggers

- **Debug a bug** ("debug this", "investigate", "trace issue", "fix bug",
  "why is X broken") → [investigation.md](references/investigation.md)
- **Add debug logs** ("add debug logs", "inject logs", "trace with logs")
  → [log-injection.md](references/log-injection.md)
- **Cleanup logs** ("remove debug logs", "cleanup logs") →
  [log-cleanup.md](references/log-cleanup.md)
- **Pattern lookup** ("debug patterns", "common bugs", "log format") →
  [debugging-patterns.md](references/debugging-patterns.md)

Multiple references may load during one debugging session — investigation
often leads to log injection, then back to investigation.

## Guidelines

- Use confidence scoring honestly: ≥70 reports as probable cause, 50-69
  suggests logs, <50 stays internal
- Compare broken code against working examples when root cause is unclear
- Always use `[DEBUG]` prefix for injected logs (enables grep + cleanup)
- Apply minimal fix: smallest change that resolves the issue
- Redact sensitive values (passwords, tokens, PII) in injected logs
- Track fix attempts: escalate to architectural review on the 4th

## Anti-Pattern: Confidence Inflation

Reporting a "fix" with confidence below 70 wastes attempts. Inflated
scores hide the real picture: a fix offered at 60 confidence is a guess.
When evidence is missing, drop down — load logs, gather runtime data,
re-rank — instead of pushing a low-confidence fix through.

## Anti-Pattern: Symptom Whack-a-Mole

Fixing the same symptom in multiple places signals an architectural
issue, not a localized bug. When fix N introduces bug N+1, stop. The
4th attempt must escalate to architectural review: re-examine the
abstraction, the missing layer, or the flawed assumption — not retry a
deeper version of the same approach.

## Anti-Pattern: Production Log Residue

Debug logs left after verification become noise in production output and
risk leaking sensitive context. Cleanup is part of the verify phase, not
a polish step. Run `grep '\[DEBUG\]'` after every fix; remaining matches
are bugs in the workflow.

Related in Code Review