debugging

A method for finding the cause of a software failure when the cause is not yet known. It narrows the possible causes, gathers evidence, and tests explanations that could be proven wrong.

In plain words
What is it for?
Use it to investigate flaky behavior in production code, unknown stack traces, regressions without a clear trigger, and failures that are difficult to reproduce.
Why use it?
It prevents random fixes when an error is intermittent, environment-specific, unexplained, or caused by a recent change. The goal is to identify the underlying cause before changing the 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/thixpin/pitway/debugging
Any agent
npx skills add thixpin/pitway --skill debugging
Clone the repo
git clone --depth 1 https://github.com/thixpin/pitway

Made for: Claude Code, Codex.

Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,014 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.00086 $0.01014
Opus 5 $0.00043 $0.00507
Sonnet 5 $0.00017 $0.00203
Haiku 4.5 $0.00009 $0.00101

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

Security

Grade A, and why

debugging 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 2d 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.

src/integrations/common/skills/debugging/SKILL.md · 53 lines

How it starts

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

Debugging

Locate the cause by narrowing the search space, not by guessing at fixes. A hypothesis you cannot disprove is not a diagnosis.

Scope

Use for investigation where the cause is unknown: irreproducible or intermittent failures, unexplained stack traces, environment-dependent behavior, regressions with no known trigger, any symptom you would otherwise "try a fix" against.

Do not use for:

  • A defect you can already reproduce and explain — bug-fix owns everything from the named cause onward. Hand off as soon as this skill names it.
  • Flaky test infrastructure over sound production code — isolation, execution order, shared fixtures, and nondeterministic assertions belong to testing.
  • Code with no failure report — use code-quality-review.

On flaky behavior, the line is which code is unreliable. Production code misbehaving intermittently is a mystery — debug it here. A test failing at random over sound code is a test-design problem — testing owns it. If you cannot yet determine whether the production code or the test is at fault, start here.

Method

  1. Pin the observable. Verbatim error, actual versus expected, failing input, environment — written down before theorizing. "It's broken" is not an observable.
  2. Find the last known-good state. A commit, release, config, machine. The delta between known-good and known-bad is the search space.
  3. Make it reproducible before explaining it. A reliable trigger is far easier to investigate, so build one first — a loop, fixed seed, captured payload, restored dataset. If it stays intermittent, treat reproduction rate as a number to raise (1 in 100 → 1 in 3), not a yes/no gate.
  4. Shrink the case. Cut to the minimum that still fails. Every element removed while the failure survives is a ruled-out suspect.
  5. Bisect, don't browse. Halve each step — git bisect over history, layer by layer through the stack, or by disabling half the config or data. Prefer halving the search space over reading code sequentially or relying on intuition.
  6. One falsifiable hypothesis at a time. State the suspected cause and the observation that would disprove it, then go get that observation. Two changes at once make the result uninterpretable.
  7. Observe, do not infer. Full stack trace, actual values, real request and response, timestamps — via debugger, logs, or temporary instrumentation. Assuming what the code "does" is why bugs survive an hour of reading.
  8. Trust the evidence over the story. When a measurement contradicts your model, update the model. Re-check you are running the code you think you are: right branch, rebuilt binary, cleared cache, no stale container, the environment you are actually hitting.
  9. State the cause in one sentence, with its evidence. A cause you cannot state plainly has not been found. Then hand off to bug-fix: confirmed cause, supporting evidence, reproduction steps, affected components.

Read the full file on GitHub · 53 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. 2d ago First seen · 53 lines · 86 tokens per session scan A 894b757d7bb7

Subscribe to this mod's changes

debugging is a skill published in the GitHub repository thixpin/pitway (19 stars, last pushed 3d ago), licensed MIT. It adds 86 tokens to every session and 1,014 once invoked, about $0.0004 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.