debug

A guided workflow for investigating and fixing a specific software problem through repeated testing. It gathers the problem, examines evidence, applies a fix, and verifies the result in a loop.

In plain words
What is it for?
Use it when debugging, troubleshooting, or fixing a reported issue, including capturing baseline output, investigating the cause, applying changes, and checking each attempted fix.
Why use it?
It provides a structured way to move from an error or unexpected behaviour to a checked solution. It can use a reproduction command or work in manual-verification mode.

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

Made for: Claude Code, Codex.

Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,439 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00063 $0.01439
Opus 5 $0.00032 $0.00720
Sonnet 5 $0.00013 $0.00288
Haiku 4.5 $0.00006 $0.00144

Measured 2d ago against content hash ddd25d9fc4e2, 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 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Use AskUserQuestion: "What command reproduces or shows the problem? (e.g., `pytest tests/test_foo.py`, `npm test`, `curl ...`). Say 'none' for manual verification."
flywheel/skills/debug/SKILL.md · 187 lines

How it starts

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

Debug

Iterative debug loop: gather problem, investigate, fix loop (max 10 iterations) with verification after each fix.


Phase 0: Goal Definition

Parse $ARGUMENTS for a problem description.

If $ARGUMENTS is empty:

  • Use AskUserQuestion: "Describe the problem you're seeing. Include error messages, unexpected behavior, or what's broken."

Check for active work session:

  • Read .flywheel/session.md — if it exists, warn the user:
    • "A work session is currently active. Debugging may conflict with in-progress work."
    • Use AskUserQuestion: "Continue debugging anyway? (yes/no)"
    • If no, stop.

Get verification command:

  • Use AskUserQuestion: "What command reproduces or shows the problem? (e.g., pytest tests/test_foo.py, npm test, curl ...). Say 'none' for manual verification."

If command provided:

  • Run the command to capture baseline output
  • Truncate output to last 2000 characters
  • Store as BASELINE_OUTPUT

If "none":

  • Set MANUAL_MODE = true
  • Skip baseline capture

Phase 1: Investigation

Investigate inline (no subagent dispatch in V1).

Gather Context

  1. Read error output / BASELINE_OUTPUT carefully — identify file names, line numbers, error types
  2. Search codebase for relevant files:
    # Use Grep to find error strings, function names, class names from the output
    # Use Glob to locate test files, config files, related modules
    
  3. Check recent git changes:
    git log --oneline -10
    git diff
    git diff --cached
    

Form Hypotheses

Produce 2-3 ranked hypotheses based on the evidence. Format each as:

Hypothesis N: <one-line summary>
Evidence: <what points to this>
Likelihood: High / Medium / Low

Confirm Direction

Present hypotheses to user using AskUserQuestion:

  • "Here are my hypotheses. Which should I pursue first? (number, or describe a different direction)"

Phase 2: Fix Loop

ITERATION = 0
STRIKES = {}  # track failures per hypothesis
CURRENT_HYPOTHESIS = <user-selected hypothesis>

For each iteration (1 to 10):

  1. Implement ONE targeted fix
     - Minimum change needed
     - If fix requires >5 lines, explain why before implementing

  2. Verify:
     - Automated mode: run verification command, truncate to last 2000 chars
     - Manual mode: AskUserQuestion "Did this fix the problem? (describe what you see)"

  3. Evaluate:
     - If FIXED → go to Phase 3
     - If NOT FIXED → analyze new output, adjust approach

  4. Track strikes:
     - STRIKES[CURRENT_HYPOTHESIS] += 1
     - If STRIKES[CURRENT_HYPOTHESIS] >= 3 → move to next hypothesis

  5. If all hypotheses exhausted:
     - AskUserQuestion "All hypotheses exhausted. Describe what you're seeing or suggest a new direction."
     - Form new hypotheses from user input

Read the full file on GitHub · 187 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 · 187 lines · 63 tokens per session scan A ddd25d9fc4e2

Subscribe to this mod's changes

debug is a skill published in the GitHub repository wsauret/flywheel (14 stars, last pushed 5d ago), licensed MIT. It adds 63 tokens to every session and 1,439 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.