moth-debug-first-fix

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 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/stfade/moth/moth-debug-first-fix
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, Codex.

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. 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.00064 $0.00338
Opus 5 $0.00032 $0.00169
Sonnet 5 $0.00013 $0.00068
Haiku 4.5 $0.00006 $0.00034

Measured 2d ago against content hash aa7a6f544bbb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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. 2d 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 4mo ago), licensed MIT. It adds 64 tokens to every session and 338 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-31.

Related

Other skills, from other repositories

agy-delegate

Delegate a coding task to the Google Antigravity CLI (agy) as a background implementer, then review its diff and land it yourself. Use this whenever the user wants to hand implementation work to Antigravity or agy - phrasings like "have Antigravity do X", "delegate this to agy", "run it through agy", or "use…

amElnagdy/delegate-skills · 132 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens

opik-diagnose

Surface the Opik traces worth a developer's attention, ranked by signal — errors, failed tool calls, latency, regressions, and low online-eval scores — plus Diagnostics issues. Reads live/production traces via the SDK (searchtraces and agentinsights) and works with no MCP; uses the MCP issue entity when connected.…

comet-ml/opik-mcp · 147 tokens

mcp-server

Use when exposing Spring Boot 3 application capabilities through Model Context Protocol tools, resources, or prompts. Covers Spring AI 1.x tool callback registration, transports, schemas, errors, security, and standalone MCP Java SDK compatibility.

rrezartprebreza/spring-boot-skills · 49 tokens

client-scripts

Write ServiceNow client scripts (onLoad/onChange/onSubmit/onCellEdit) using gform, guser, GlideAjax, field visibility/mandatory toggles, and validation with debounced server calls.

serac-labs/serac · 45 tokens

Presentations

Read, create or edit PowerPoint or Google Slides decks. Use for presentation, slide deck, PowerPoint, PPT, PPTX, or Google Slides requests.

rojim666/SztuCode · 35 tokens