debug

A structured method for debugging software failures by reproducing the problem, testing several possible causes, isolating the failing part, and identifying the upstream defect. Each fix is checked with a regression test, which ensures the same bug does not return.

In plain words
What is it for?
Use it when a bug, failed test, crash, exception, unexpected result, or regression needs a carefully verified root-cause fix.
Why use it?
It reduces guesswork and helps prevent fixes that only hide the visible error. It also keeps later investigations from repeating work or stopping at the wrong line of code.

Skill for Claude CodeCodex

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 skills/ariaxhan/kernel-claude/debug
Any agent
npx skills add ariaxhan/kernel-claude --skill debug
Clone the repo
git clone --depth 1 https://github.com/ariaxhan/kernel-claude

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,096 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.00052 $0.01096
Opus 5 $0.00026 $0.00548
Sonnet 5 $0.00010 $0.00219
Haiku 4.5 $0.00005 $0.00110

Measured yesterday against content hash 18939e83b03c, 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 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.

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.

skills/debug/SKILL.md · 88 lines

How it starts

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

Run agentdb recall with the exact error text, subsystem/library, failing test, and known files/symbols. Recall again when the hypothesis changes or a new failure appears; that is a new retrieval question. Reference on demand: skills/debug/reference/debug-research.md.

  1. HYPOTHESIZE: list 3 causes before pursuing any.

    • Read ALL error output first (anchoring bias mitigation).
    • Write each hypothesis to AgentDB. Prevents circular re-investigation.
    • (gate: 3 candidate hypotheses written; none pursued yet)
  2. ISOLATE: binary search, O(log n) not O(n).

    • Code: call chain A→B→C→D→E fails → check midpoint C → recurse into failing half.
    • Time: git bisect between known-good and known-bad commit. ~10 tests for 1000 commits.
    • Input: large failing input → split in half → recurse to minimal reproduction case.
    • Instrument at boundaries: log inputs/outputs at each layer boundary.
    • Mock external dependencies to isolate which one causes failure.
    • (gate: failure localized to a specific function/commit/input subset)
  3. ROOT CAUSE: the error line is the FAILURE. The DEFECT is upstream.

    • Ask: what assumption was violated? What invariant broke?
    • If you can't explain WHY it broke, you haven't found root cause.
    • Top causes by frequency: wrong input shape/type · off-by-one · missing null check · race condition · shared-state mutation · wrong comparison operator · variable scope · swallowed error · API contract mismatch · environment difference.
    • (gate: can state root cause in one sentence explaining the violated invariant)
  4. FIX: root cause, not symptom.

    • Fix the DEFECT, not the FAILURE site. (Null check at crash site = symptom fix.)
    • Write regression test that fails before fix, passes after.
    • Run: original failing case + edge cases + full regression suite.
    • Commit fix + test together.
    • (gate: regression test green; original failing case passes)

<anti_patterns> Shotgun (random changes until it works) · fix-and-pray (never re-run the original case) · symptom fixing (null check at the crash site) · printf flooding (binary search first, then targeted logging) · blame-the-framework (it's almost never the library) · unscoped "investigate" (scope narrowly or use a subagent so the file reads don't fill context). </anti_patterns>

<when_stuck> Explain the problem in writing · re-read the error message (the answer is there most of the time) · reduce to a minimal reproduction · ask "what changed?" (git log/diff, deps, env) · search the exact error message in quotes · step away, bias accumulates. Re-run the EXACT original failing case before declaring victory; "seems to work" is not evidence. </when_stuck>

Read the full file on GitHub · 88 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 88 lines · 52 tokens per session scan A 18939e83b03c

Subscribe to this mod's changes

debug is a skill published in the GitHub repository ariaxhan/kernel-claude (12 stars, last pushed yesterday), licensed MIT. It adds 52 tokens to every session and 1,096 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

prolong

Recover and use durable coding-session history from PRO-LONG's local append-only log. Use on long-running coding tasks, after context compaction or session resume, when reconstructing prior decisions or tool results, or before repeating work that may already have been attempted.

alexisfox7/PRO-LONG · 55 tokens

lemmalog

Externalize working memory and logical state into the lemmalog Datalog engine (MCP). Use for ANY multi-step task where state should outlive one context window or span agents: long investigations, debugging sessions, audits, multi-agent searches, systematic explorations, planning with many interdependent constraints…

JordyZomer/lemmalog · 105 tokens

causal-memory

Causal memory for agents — install/setup the causal-memory MCP server, then record decisions/outcomes and recall them before acting. Trigger when the user asks to install or set up causal-memory/agent memory, when causal-memory MCP tools are available and the agent faces a non-trivial decision (architecture, debugging…

JingxuanC/causal-memory · 88 tokens

a0-create-plugin

Create, extend, or modify Agent Zero plugins. Follows strict full-stack conventions (usr/plugins, plugin.yaml, Store Gating, AgentContext, plugin settings). Use for UI hooks, API handlers, lifecycle extensions, or plugin settings UI.

Gen-Verse/PAST-Bench · 54 tokens

a0-review-plugin

Full audit of Agent Zero plugins in usr/plugins/. Reviews manifest validity, directory structure, code patterns (Store Gating, notifications, imports), security, and duplicate detection against the community index. Use when asked to review, audit, validate, or check an existing plugin before using or contributing it.

Gen-Verse/PAST-Bench · 64 tokens

create-skill

Wizard for creating new Agent Zero skills. Guides users through creating well-structured SKILL.md files. Use when users want to create custom skills.

Gen-Verse/PAST-Bench · 33 tokens