debug

debug is a command for Claude Code from lgbarn/shipyard. It costs 11 tokens per session (640 once invoked), scanned A, original, MIT.

A guided bug-investigation command that examines an error or unexpected behavior and looks for its underlying cause.

In plain words
What is it for?
Use it to investigate error messages, failing tests, or behavior that does not match expectations in a Git project.
Why use it?
It gives a structured way to investigate failures instead of relying on guesswork.

Command for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the shipyard plugin — 25 skills, 25 commands, 20 agents, 6 hooks shipped together

Good fit Use it to investigate error messages, failing tests, or behavior that does not match expectations in a Git project.

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

Made for: Claude Code.

Or install shipyard, the plugin that ships this one along with the rest of its 25 skills, 25 commands, 20 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/lgbarn/shipyard/debug/github.svg)](https://agentmods.dev/commands/lgbarn/shipyard/debug)
Your own site
<a href="https://agentmods.dev/commands/lgbarn/shipyard/debug"><img src="https://agentmods.dev/badge/commands/lgbarn/shipyard/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/lgbarn/shipyard/debug"><img src="https://agentmods.dev/badge/commands/lgbarn/shipyard/debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 640 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.00011 $0.00640
Opus 5.5 $0.00004 $0.00256
Sonnet 5.5 $0.00002 $0.00128
Haiku 4.5 $0.00001 $0.00064

Measured 1mo ago against content hash 322b630b1394, 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 1mo 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.

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.

/shipyard:debug - Root Cause Analysis

You are executing the Shipyard debugging workflow. This dispatches a dedicated debugger agent for systematic root-cause investigation.

Step 1: Parse Arguments

  • If an error description is provided, use it as the problem statement.
  • If no argument is provided, ask the user:

    "What issue are you investigating? Provide the error message, failing test, or describe the unexpected behavior."

Step 2: Gather Context

  1. Read .shipyard/STATE.json if it exists (for current phase context)
  2. Read .shipyard/config.json for model routing
  3. Follow Worktree Protocol (detect if running in a git worktree; if so, use worktree root for paths and record the branch name; see docs/PROTOCOLS.md)
  4. Follow Model Routing Protocol (select the correct model for the debugger role using model_routing.debugging from config; see docs/PROTOCOLS.md)

Step 3: Dispatch Debugger

Dispatch a debugger agent (subagent_type: "shipyard:debugger") following the Model Routing Protocol with:

  • The problem statement (error description, test name, or unexpected behavior)
  • Working directory, current branch, and worktree status
  • Codebase docs per Codebase Docs Protocol (resolve configured codebase docs path and load CONVENTIONS.md, STACK.md, ARCHITECTURE.md, etc.; see docs/PROTOCOLS.md)
  • .shipyard/PROJECT.md if it exists
  • Recent git log (git log --oneline -20)
  • Any error output or stack traces the user provided

The debugger agent performs:

  1. Root cause investigation (reproduce, trace, gather evidence)
  2. Pattern analysis (compare working vs broken code)
  3. Hypothesis testing (minimal changes, one variable at a time)
  4. Remediation plan (documented steps for the builder)

Step 4: Present Results

Read the debugger's ROOT-CAUSE.md output and present to the user:

  • Root cause summary
  • Evidence chain
  • Remediation plan

Step 5: Route Forward

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. 1mo ago First seen · 69 lines · 11 tokens per session scan A 322b630b1394

Subscribe to this mod's changes

debug is a command published in the GitHub repository lgbarn/shipyard (65 stars, last pushed 8d ago), licensed MIT. It adds 11 tokens to every session and 640 once invoked, about $0.0000 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-30.