debug

debug is a command for coding agents from joaquimscosta/arkhe-claude-plugins. It costs 48 tokens per session (1,768 once invoked), scanned A, original, MIT.

A command for investigating bugs through evidence gathering and a four-phase debugging process. It can examine errors, stack traces, failed tests, or unexpected behavior, with an optional deeper investigation.

In plain words
What is it for?
Use it to investigate errors, test failures, stack traces, and bugs in a codebase.
Why use it?
It turns a vague symptom into a structured diagnosis based on the code, changes, and error details.

Command

Part of the core plugin — 5 skills, 7 commands, 6 agents shipped together

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/joaquimscosta/arkhe-claude-plugins/debug
Clone the repo
git clone --depth 1 https://github.com/joaquimscosta/arkhe-claude-plugins

Or install core, the plugin that ships this one along with the rest of its 5 skills, 7 commands, 6 agents.

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 debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/joaquimscosta/arkhe-claude-plugins/debug.svg)](https://agentmods.dev/commands/joaquimscosta/arkhe-claude-plugins/debug)
Your own site
<a href="https://agentmods.dev/commands/joaquimscosta/arkhe-claude-plugins/debug"><img src="https://agentmods.dev/badge/commands/joaquimscosta/arkhe-claude-plugins/debug.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 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,768 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.00048 $0.01768
Opus 5 $0.00024 $0.00884
Sonnet 5 $0.00010 $0.00354
Haiku 4.5 $0.00005 $0.00177

Measured 4d ago against content hash c8d321440ee4, 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 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.

plugins/core/commands/debug.md · 214 lines

How it starts

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

Systematic Debug

Ultrathink!

Systematically investigate and diagnose the issue using evidence-based debugging.

Parse arguments from: $ARGUMENTS

  • If arguments contain --deep, enable deep mode (agent-assisted debugging) and strip --deep from issue description
  • Remaining text is the issue description (error message, bug description, or symptom)
  • If no arguments provided: analyze the current conversation context to identify the error, bug, or unexpected behavior

Step 1: Evidence Gathering

Gather targeted evidence about the issue. This step runs in both default and deep modes.

1a. Parse the Issue

Extract structured information from the issue description or conversation context:

  • File paths mentioned in error messages or stack traces
  • Line numbers from stack traces
  • Error types/names (e.g., TypeError, NullPointerException, panic)
  • Function/method names referenced in the error

1b. Git Context

Run these commands to understand the current state:

!git status --short !git diff --stat !git log -5 --oneline

If specific files were identified in the error, run git diff -- <file> and git log -3 --oneline -- <file> for each relevant file.

1c. Ecosystem Detection

!ls package.json pyproject.toml build.gradle build.gradle.kts pom.xml Cargo.toml go.mod Makefile 2>/dev/null || true

1d. Error Reproduction

Detect the test runner from the ecosystem and attempt to reproduce the error:

Node.js (if package.json exists): !node -e "try{const s=require('./package.json').scripts||{};console.log(JSON.stringify({test:s.test||null}))}catch(e){}" 2>/dev/null

  • If a specific test file is mentioned in the error: run only that test
  • If a source file is mentioned: find and run its corresponding test file
  • Otherwise: run the full test suite

Python (if pyproject.toml exists): !grep -c '\[tool\.pytest' pyproject.toml 2>/dev/null && echo "pytest detected" || true

  • Run pytest with the specific test file or function if identifiable

Read the full file on GitHub · 214 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 · 214 lines · 48 tokens per session scan A c8d321440ee4

Subscribe to this mod's changes

debug is a command published in the GitHub repository joaquimscosta/arkhe-claude-plugins (21 stars, last pushed 20d ago), licensed MIT. It adds 48 tokens to every session and 1,768 once invoked, about $0.0002 per session on Opus 5. 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.