sparc-debug

sparc-debug is a command for Claude Code from spencermarx/open-code-review. It costs 28 tokens per session (544 once invoked), scanned A, a copy of sparc-debug, Apache-2.0.

A debugging workflow for finding runtime bugs, logic errors, and integration failures by examining logs, traces, stack information, and program behavior.

In plain words
What is it for?
Use it to investigate memory leaks, inspect errors and variables, trace call stacks, profile memory, and verify fixes.
Why use it?
It provides a structured way to isolate the cause of a failure without directly changing environment configuration.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

Good fit Use it to investigate memory leaks, inspect errors and variables, trace call stacks, profile memory, and verify fixes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/spencermarx/open-code-review/debug
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.

Clone the repo
git clone --depth 1 https://github.com/spencermarx/open-code-review

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sparc-debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/spencermarx/open-code-review/debug.svg)](https://agentmods.dev/commands/spencermarx/open-code-review/debug)
Your own site
<a href="https://agentmods.dev/commands/spencermarx/open-code-review/debug"><img src="https://agentmods.dev/badge/commands/spencermarx/open-code-review/debug.svg" alt="Measured on agentmods" height="20"></a>
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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00028 $0.00544
Opus 5 $0.00014 $0.00272
Sonnet 5 $0.00006 $0.00109
Haiku 4.5 $0.00003 $0.00054

Measured 4d ago against content hash b5d5309737df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, 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 4d 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. 4d 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 spencermarx/open-code-review (355 stars, last pushed 1mo ago), licensed Apache-2.0. 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.