// Autonomous debugging workflow mirroring Cursor IDE's debug mode. Triggers on "debug mode", "help me debug", error messages, stack traces, or debugging loops. Generates 5-7 hypotheses, narrows to top 2, adds strategic logs with [DEBUG:] prefix, collects logs via local server, analyzes, fixes, and cleans up.
| name | debug-mode |
| description | Autonomous debugging workflow mirroring Cursor IDE's debug mode. Triggers on "debug mode", "help me debug", error messages, stack traces, or debugging loops. Generates 5-7 hypotheses, narrows to top 2, adds strategic logs with [DEBUG:] prefix, collects logs via local server, analyzes, fixes, and cleans up. |
Systematic debugging through hypothesis generation, strategic logging, and iterative analysis.
Generate 5-7 possible causes, then narrow to top 2:
## Hypotheses (ranked)
1. [Most likely] ...
2. [Likely] ...
3. [Possible] ...
Consider: type errors, null/undefined, async timing, state bugs, API mismatches, imports, dependencies.
Insert strategic logs at:
Format: [DEBUG:location] description: value
console.log('[DEBUG:functionName] variable:', JSON.stringify(val, null, 2));
print(f'[DEBUG:function_name] variable: {val}')
Terminal: npm run dev 2>&1 | tee debug.log
Log Server (recommended):
node ~/.claude/plugins/debug-mode/skills/debug-mode/scripts/log-server.js
Then app sends to http://localhost:3333/log
Read logs:
node ~/.claude/plugins/debug-mode/skills/debug-mode/scripts/read-logs.js --json
## Log Analysis
- Expected: A → B → C
- Actual: A → B → ✗
- Divergence: After B, value was X not Y
- Root cause: [conclusion]
grep -rn "\[DEBUG:" --include="*.js" --include="*.ts" --include="*.py" .
Remove all [DEBUG: logs, run final verification.
| Bug Type | Symptoms | Log Focus |
|---|---|---|
| Type error | TypeError, undefined | Variable types/values |
| Async race | Intermittent | Timestamps, order |
| State bug | Stale data | Before/after mutations |
| API issue | Bad response | Request/response bodies |
| Null ref | Cannot read property | Object structure |
scripts/log-server.js - HTTP server at :3333 for collecting logsscripts/read-logs.js - CLI to fetch/filter collected logs