sparc-debug

A set of instructions for finding and fixing software bugs by examining runtime behaviour, logs, traces, and stack information. A stack trace is a record of the calls that led to an error.

In plain words
What is it for?
Use it to investigate crashes, memory leaks, incorrect results, and failures between connected systems, then apply a focused fix or delegate a targeted change.
Why use it?
It provides a structured way to narrow an integration failure or logic error without changing environment settings directly.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/glassbead-tc/widescreen-research/debug
Clone the repo
git clone --depth 1 https://github.com/glassBead-tc/widescreen-research

Made for: Claude Code.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 544 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.00544
Opus 5 $0.00014 $0.00272
Sonnet 5 $0.00006 $0.00109
Haiku 4.5 $0.00003 $0.00054

Measured 2d ago against content hash b5d5309737df, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sparc-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to sparc-debug — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/commands/sparc/debug.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

🪲 Debugger

Role Definition

You troubleshoot runtime bugs, logic errors, or integration failures by tracing, inspecting, and analyzing behavior.

Custom Instructions

Use logs, traces, and stack analysis to isolate bugs. Avoid changing env configuration directly. Keep fixes modular. Refactor if a file exceeds 500 lines. Use new_task to delegate targeted fixes and return your resolution via attempt_completion.

Available Tools

  • read: File reading and viewing
  • edit: File modification and creation
  • browser: Web browsing capabilities
  • mcp: Model Context Protocol tools
  • command: Command execution

Usage

Option 1: Using MCP Tools (Preferred in Claude Code)

mcp__claude-flow__sparc_mode {
  mode: "debug",
  task_description: "fix memory leak in service",
  options: {
    namespace: "debug",
    non_interactive: false
  }
}

Option 2: Using NPX CLI (Fallback when MCP not available)

# Use when running from terminal or MCP tools unavailable
npx claude-flow sparc run debug "fix memory leak in service"

# For alpha features
npx claude-flow@alpha sparc run debug "fix memory leak in service"

# With namespace
npx claude-flow sparc run debug "your task" --namespace debug

# Non-interactive mode
npx claude-flow sparc run debug "your task" --non-interactive

Option 3: Local Installation

# If claude-flow is installed locally
./claude-flow sparc run debug "fix memory leak in service"

Memory Integration

Using MCP Tools (Preferred)

// Store mode-specific context
mcp__claude-flow__memory_usage {
  action: "store",
  key: "debug_context",
  value: "important decisions",
  namespace: "debug"
}

// Query previous work
mcp__claude-flow__memory_search {
  pattern: "debug",
  namespace: "debug",
  limit: 5
}

Using NPX CLI (Fallback)

# Store mode-specific context
npx claude-flow memory store "debug_context" "important decisions" --namespace debug

# Query previous work
npx claude-flow memory query "debug" --limit 5

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 84 lines · 28 tokens per session scan A b5d5309737df

Subscribe to this mod's changes

sparc-debug is a command published in the GitHub repository glassBead-tc/widescreen-research (6 stars, last pushed 10mo ago), licensed MIT. It adds 28 tokens to every session and 544 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to sparc-debug, differing in 0 lines, and is treated as a copy.