debug

A step-by-step workflow for finding and fixing software bugs. It starts by reproducing the problem, then traces the relevant code, identifies the underlying cause, applies a small fix, and checks that the problem is gone.

In plain words
What is it for?
Use it to investigate errors involving application logic, databases, configuration, permissions, migrations, imports, or timing-related behavior.
Why use it?
It prevents guesses and temporary workarounds by requiring evidence from logs, tests, requests, recent changes, and the execution path.

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/xsovad06/sova/debug
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 521 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found 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.00019 $0.00521
Opus 5 $0.00010 $0.00260
Sonnet 5 $0.00004 $0.00104
Haiku 4.5 $0.00002 $0.00052

Measured yesterday against content hash 81b35a811a19, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 1 finding 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 yesterday.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Try to reproduce the issue (via test, curl, or browser)
.claude/commands/debug.md · 69 lines

How it starts

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

Systematic Debugging

Debug an issue in the project.

Problem description: $ARGUMENTS

Workflow

1. Reproduce

  • Understand the problem from the description
  • Check application logs for errors
  • Try to reproduce the issue (via test, curl, or browser)
  • If the issue is unclear, ask the user for more details

2. Locate

  • Identify the relevant code path (URL -> view/controller -> service -> model)
  • Read the relevant source files to understand the flow
  • Check recent changes with git log --oneline -10 and git diff -- was something recently changed?
  • Search for related error messages in the codebase

3. Diagnose

  • Trace the execution flow from entry point to the error
  • Identify the root cause -- not just the symptom
  • Check common issues:
    • Missing migrations or schema changes
    • Import errors / circular imports
    • Configuration mismatches between environments
    • Authentication/permission issues
    • Database constraint violations
    • Race conditions or state management bugs

4. Fix

  • Apply the minimal fix that addresses the root cause
  • Do not introduce workarounds -- fix the actual problem
  • If the fix touches multiple files, explain the connection
  • Scout rule: while in each file, fix any pre-existing issues you notice (lint warnings, dead imports, obvious bugs adjacent to your fix). Keep scout fixes small and low-risk.

5. Verify

  • Write a test that reproduces the original issue (should fail before fix, pass after)
  • Run the project's test suite (see CLAUDE.md for commands)
  • Check that no regressions were introduced
  • Verify application logs are clean

6. Prevent

  • If this bug class could recur, suggest a test that would catch it
  • If it was caused by a missing convention, suggest updating AGENTS.md or project guidelines

Cross-References

  • Need to run tests? Run /test to iterate on failures
  • Want a review of the fix? Run /review before pushing

Rules

  • NEVER use emojis in any output
  • Focus on root cause, not symptoms

Read the full file on GitHub · 69 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. yesterday First seen · 69 lines · 19 tokens per session scan A 81b35a811a19

Subscribe to this mod's changes

debug is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 19 tokens to every session and 521 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.