moth-debug-first-fix

moth-debug-first-fix is a skill for Claude Code from stfade/moth. It costs 64 tokens per session (338 once invoked), scanned A, original, MIT.

A workflow for investigating a software error before changing code. It covers failed tests, builds, type checks, lint checks, runtime errors, stack traces, and error logs.

In plain words
What is it for?
Use it to capture the failure, identify a likely cause and first fix, apply the change, run verification, and remember the result only when it clearly passed or failed.
Why use it?
It focuses the first fix on the evidence and smallest relevant code area instead of starting with a broad refactor or a guess.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the moth plugin — 3 skills shipped together

Good fit Use it to capture the failure, identify a likely cause and first fix, apply the change, run verification, and remember the result only when it clearly passed or failed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/stfade/moth/moth-debug-first-fix
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.

Any agent
npx skills add stfade/moth --skill moth-debug-first-fix
Clone the repo
git clone --depth 1 https://github.com/stfade/moth

Made for: Claude Code.

Or install moth, the plugin that ships this one along with the rest of its 3 skills.

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 moth-debug-first-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/stfade/moth/moth-debug-first-fix/github.svg)](https://agentmods.dev/skills/stfade/moth/moth-debug-first-fix)
Your own site
<a href="https://agentmods.dev/skills/stfade/moth/moth-debug-first-fix"><img src="https://agentmods.dev/badge/skills/stfade/moth/moth-debug-first-fix/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 moth-debug-first-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/stfade/moth/moth-debug-first-fix"><img src="https://agentmods.dev/badge/skills/stfade/moth/moth-debug-first-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 338 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.00064 $0.00338
Opus 5.5 $0.00026 $0.00135
Sonnet 5.5 $0.00013 $0.00068
Haiku 4.5 $0.00006 $0.00034

Measured 3mo ago against content hash aa7a6f544bbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

moth-debug-first-fix 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 3mo 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.

integrations/claude-code/skills/moth-debug-first-fix/SKILL.md · 25 lines

What it actually says

Moth Debug First Fix

Workflow

  1. Capture the exact failing command, error output, package context, and the smallest relevant file excerpts.
  2. Redact secrets before storing, quoting, or sending the error anywhere.
  3. Call analyze_error when available. Treat its likely_cause, best_first_fix, avoid, and confidence as a starting brief, not certainty.
  4. If context is missing, gather only the narrow missing context named by the brief.
  5. Patch the smallest code surface that explains the key error line.
  6. Follow the verified memory lifecycle: analyze_error -> apply/attempt fix -> run verification command -> call remember_fix_result with verification_command and verification_result.
  7. Call remember_fix_result only when a fix/change was actually attempted, the verification command was actually run, and the result is unambiguously passed or failed.

Guardrails

  • Do not start with a broad refactor.
  • Do not scan the whole repository unless the user explicitly asks.
  • Do not treat Moth confidence as proof.
  • Do not call remember_fix_result for suggestions, unapplied changes, skipped changes, missing verification, ambiguous results, or guesses.
  • Do not record full sensitive logs in memory.
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. 3mo ago First seen · 25 lines · 64 tokens per session scan A aa7a6f544bbb

Subscribe to this mod's changes

moth-debug-first-fix is a skill published in the GitHub repository stfade/moth (2 stars, last pushed 7mo ago), licensed MIT. It adds 64 tokens to every session and 338 once invoked, about $0.0003 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.

Related

moth-debug-first-fix compared with skills from other repositories

moth-debug-first-fix next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
moth-debug-first-fixstfade/mothSkill27mo agoMITA64Claude Code
report-issue-localcyanheads/obsidian-mcp-serverSkill72220d agoApache-2.0A44Claude Code
isuzu-unity-cliisuzu-shiranui/UnityMCPSkill34711d agoMITA73Claude Code, Codex
opik-diagnosecomet-ml/opik-mcpSkill2275d agoApache-2.0A187Claude Code
opik-explaincomet-ml/opik-mcpSkill2275d agoApache-2.0A113Claude Code
ssh-incidentbvisible/mcp-ssh-managerSkill557todayMITA46Claude Code, Codex
taskade-fix-flowstaskade/mcpSkill1705d agoMITA193Claude Code