Skip to main content
GSD’s debugging system uses the scientific method with subagent isolation to investigate issues systematically while keeping your main context lean.

Why /gsd:debug Exists

Debugging in chat sessions burns context fast - you read files, form hypotheses, test theories, and accumulate investigation artifacts. By the time you find the root cause, your context is polluted. GSD isolates debugging in fresh subagent contexts with persistent state across investigations.

How It Works

1

Gather symptoms

The orchestrator asks structured questions about the issue:
  • Expected behavior
  • Actual behavior
  • Error messages
  • Timeline (when did it start?)
  • Reproduction steps
2

Spawn debugger agent

A fresh gsd-debugger agent gets:
  • Full symptom context
  • 200K clean context window
  • Instructions to write findings to .planning/debug/{slug}.md
3

Investigation

The debugger uses scientific method:
  1. Form hypothesis
  2. Design test
  3. Execute test
  4. Record evidence
  5. Confirm or refute
  6. Repeat until root cause found
4

Checkpoints

When human input is needed, the debugger writes a checkpoint and returns. You respond, and a continuation agent spawns with the debug file as context.
5

Root cause or fix

When found, the debugger either:
  • Offers to spawn a fix agent immediately
  • Suggests creating a phase to address it properly
  • Leaves it for manual intervention

Basic Usage

Start new debug session

The system will ask follow-up questions to gather symptoms, then spawn the debugger.

Resume active session

If active sessions exist, GSD lists them with:
  • Current hypothesis
  • Evidence gathered
  • Next action
You can pick one to resume or start a new investigation.

Debug File Structure

Each debug session creates a persistent file:
The debug file contains:

Checkpoint Types

The debugger may return checkpoints for human input:

Handling Debugger Returns

GSD offers next steps based on severity and complexity.

Continuation Flow

When you respond to a checkpoint:
The continuation agent:
  1. Reads .planning/debug/users-cant-login.md
  2. Sees the checkpoint
  3. Processes your response
  4. Decides whether to finalize/resolve or continue investigating

Modes

The debugger has two modes:

find_and_fix (default)

Investigates and fixes if the fix is simple and safe:
  • Single-file changes
  • Config adjustments
  • Clear, low-risk fixes
For complex fixes, it recommends planning a proper phase.

investigate_only

Investigates but never touches code. Use when:
  • You want diagnosis only
  • The fix requires careful planning
  • Multiple services are involved

Examples

Best Practices

Do:

  • Be specific when describing symptoms
  • Include error messages verbatim
  • Note timeline (when did it start?)
  • Provide reproduction steps if known
  • Let debugger finish before trying fixes

Don’t:

  • Start debugging in main chat (wastes context)
  • Assume root cause (let debugger investigate)
  • Fix without understanding (may mask deeper issues)
  • Ignore checkpoints (debugger needs feedback)

When to Use /gsd:debug vs /gsd:quick

  • You don’t know the root cause
  • Multiple possible causes
  • Issue is intermittent or environmental
  • Need systematic investigation
  • Want evidence trail for postmortem
  • Complex system interactions

Integration with Phases

If debugging reveals a complex issue:
The debug file becomes part of the phase research context.

Model Selection

The debugger agent respects your model profile: Debugging gets Opus in quality mode because investigation quality matters more than speed.

Archival

When a debug session resolves:
Resolved sessions are kept for reference and postmortems.

Context Efficiency

The debug orchestrator stays lean:
  1. Gathers symptoms - Structured questions
  2. Spawns agent - Fresh 200K context
  3. Receives checkpoint - Brief summary only
  4. Spawns continuation - Fresh context again
Your main session never sees the investigation details - only the final result.
Debug sessions can spawn multiple continuation agents if needed. Each gets a fresh context, ensuring investigation quality never degrades.