smart-debug

smart-debug is a command for Claude Code from thapaliyabikendra/ai-artifacts. It costs 0 tokens per session (1,944 once invoked), scanned A, original, Apache-2.0.

A debugging workflow that analyzes an issue, optionally changes the code, runs verification, and performs a review. It uses reported errors, stack traces, reproduction steps, affected components, and failure patterns to investigate likely causes.

In plain words
What is it for?
Use it to diagnose bugs by default, or add fix, verification, and full options to implement a correction, run tests, and review the result.
Why use it?
It separates finding the cause from changing and checking the code. This helps avoid treating a symptom as the root problem and lets you choose how much of the workflow to run.

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/thapaliyabikendra/ai-artifacts/smart-debug
Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts

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 smart-debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/smart-debug.svg)](https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/smart-debug)
Your own site
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/smart-debug"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/smart-debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,944 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.01944
Opus 5 $0.00000 $0.00972
Sonnet 5 $0.00000 $0.00389
Haiku 4.5 $0.00000 $0.00194

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

Security

Grade A, and why

smart-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.

.claude/commands/debug/smart-debug.md · 279 lines

How it starts

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

Smart Debug Command

AI-powered debugging with optional fix and verification workflow.

Arguments: $ARGUMENTS

Workflow Overview

┌───────────┐   ┌───────────┐   ┌───────────┐   ┌───────────┐
│ 1.Diagnose│ → │ 2.Fix     │ → │ 3.Verify  │ → │ 4.Review  │
│ (debugger)│   │ (abp-     │   │ (qa-      │   │ (code-    │
│           │   │ developer)│   │ engineer) │   │ reviewer) │
└───────────┘   └───────────┘   └───────────┘   └───────────┘

Default: Stage 1 only (diagnosis) With --fix: Stages 1-2 (diagnosis + fix) With --verify: Stages 1-3 (diagnosis + fix + test) With --full: Stages 1-4 (full workflow)

Context

Process issue from: $ARGUMENTS

Parse for:

  • Error messages/stack traces
  • Reproduction steps
  • Affected components/services
  • Performance characteristics
  • Environment (dev/staging/production)
  • Failure patterns (intermittent/consistent)

Workflow

1. Initial Triage

Use Task tool (subagent_type="debugger") for AI-powered analysis:

  • Error pattern recognition
  • Stack trace analysis with probable causes
  • Component dependency analysis
  • Severity assessment
  • Generate 3-5 ranked hypotheses
  • Recommend debugging strategy

2. Observability Data Collection

For production/staging issues, gather:

  • Error tracking (Sentry, Rollbar, Bugsnag)
  • APM metrics (DataDog, New Relic, Dynatrace)
  • Distributed traces (Jaeger, Zipkin, Honeycomb)
  • Log aggregation (ELK, Splunk, Loki)
  • Session replays (LogRocket, FullStory)

Query for:

  • Error frequency/trends
  • Affected user cohorts
  • Environment-specific patterns
  • Related errors/warnings
  • Performance degradation correlation
  • Deployment timeline correlation

3. Hypothesis Generation

For each hypothesis include:

  • Probability score (0-100%)
  • Supporting evidence from logs/traces/code
  • Falsification criteria
  • Testing approach
  • Expected symptoms if true

Common categories:

  • Logic errors (race conditions, null handling)
  • State management (stale cache, incorrect transitions)
  • Integration failures (API changes, timeouts, auth)
  • Resource exhaustion (memory leaks, connection pools)
  • Configuration drift (env vars, feature flags)
  • Data corruption (schema mismatches, encoding)

Read the full file on GitHub · 279 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 · 279 lines · 0 tokens per session scan A dcde4ccd7aee

Subscribe to this mod's changes

smart-debug is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,944 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.