debug

debug is a command for Claude Code from HigorAlves/orc. It costs 53 tokens per session (2,253 once invoked), scanned A, original, MIT.

A structured debugging workflow that investigates the root cause before changing code. TDD, or test-driven development, means using a test to describe the expected fix and protect it from breaking again.

In plain words
What is it for?
Use it for hard bugs, failing tests, and failures that may originate in another repository, with an optional link to a Jira ticket.
Why use it?
It prevents guessing at fixes for difficult or unexpected failures. The diagnosis and regression test are saved in session state so the work can be resumed.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; names the AskUserQuestion tool.

Part of the orc plugin — 84 skills, 31 commands, 14 agents, 6 hooks shipped together

Good fit Use it for hard bugs, failing tests, and failures that may originate in another repository, with an optional link to a Jira ticket.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/higoralves/orc/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/HigorAlves/orc

Made for: Claude Code.

Or install orc, the plugin that ships this one along with the rest of its 84 skills, 31 commands, 14 agents, 6 hooks.

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/higoralves/orc/debug/github.svg)](https://agentmods.dev/commands/higoralves/orc/debug)
Your own site
<a href="https://agentmods.dev/commands/higoralves/orc/debug"><img src="https://agentmods.dev/badge/commands/higoralves/orc/debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for debug

Your own site · 80×15
<a href="https://agentmods.dev/commands/higoralves/orc/debug"><img src="https://agentmods.dev/badge/commands/higoralves/orc/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,253 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 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.1 $0.00053 $0.02253
Opus 5.5 $0.00021 $0.00901
Sonnet 5.5 $0.00011 $0.00451
Haiku 4.5 $0.00005 $0.00225

Measured 10d ago against content hash c61bc47ea0b2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 10d 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.

orc/commands/debug.md · 140 lines

How it starts

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

/orc:debug

Hard bugs and unexpected failures get the systematic-debugging discipline. NO FIXES WITHOUT A ROOT CAUSE.

Arguments

  • --jira <KEY> — link a Jira ticket key (e.g. BUG-42) to this session silently. Suppresses the Phase 1 link prompt.
  • The bug description / failing test name is the rest of the argument string.

Workflow

Phase 0 — Detect context

!orc-workspace-detect --banner

Context is injected above (ORC_* vars are exported for any Bash you run — do not re-run detection).

In workspace mode, resolve targetRepos from flags or via AskUserQuestion. The default is the symptom-repo (the repo where the bug surfaces) plus any sibling repos the user suspects might be the actual cause — the investigator reads across all of them. Iron rule: no silent broadcast — confirm.

Phase 1 — Initialize workspace + link

  1. Determine the current branch: git branch --show-current (in workspace mode, prompt the user since cwd has no branch). Sanitize (/ → -).
  2. Create ${ORC_STATE_DIR}/<sanitized-branch>/files/ if it doesn't exist. In workspace mode, also create per-repo <workspaceRoot>/<repo>/.orc/<sanitized-branch>/ with workspace-link.json back-pointers for each target repo (the diagnosis is workspace-level; remediation slices land per repo).
  3. Resolve the Jira link.
    • If --jira <KEY> was passed: validate against ^[A-Z][A-Z0-9_]*-\d+$. Reject and stop on mismatch.
    • Otherwise: ask via AskUserQuestion — "Link a Jira ticket to this session?" with options: Paste a key / Skip — I'll bind later via /orc:jira bind / No ticket — this work has no tracker entry.
  4. Register state: orc-state init --command debug --total-phases 7 [--jira <KEY>]. Defer to orc:state-protocol for schema and rules; per phase, orc-state phase set <n> + orc-state digest write -.

Phase 2 — Investigate (no fixes)

Prime code discovery first (optional, non-blocking). Follow orc:code-discovery: if graphify is installed, ensure a fresh graph on the buggy branch before dispatching — build if missing (graphify extract . --code-only) or refresh if stale (graphify update .), so the investigator queries the graph from turn one instead of discovering staleness mid-investigation. Skip silently if graphify is absent or the build fails.

Read the full file on GitHub · 140 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. 10d ago Changed · +1 lines c61bc47ea0b2
  2. 1mo ago First seen · 139 lines · 53 tokens per session scan A dfef57d8dfee

Subscribe to this mod's changes

debug is a command published in the GitHub repository HigorAlves/orc (6 stars, last pushed 7d ago), licensed MIT. It adds 53 tokens to every session and 2,253 once invoked, about $0.0002 per session on Opus 5.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-31.