trace-fix

trace-fix is a skill for Claude Code, Codex from cukas/patrol. It costs 30 tokens per session (467 once invoked), scanned A, original, MIT.

A bug-fixing workflow that traces the root cause first, writes a test that reproduces the problem, and then applies the smallest fix.

In plain words
What is it for?
Use it for bugs, unexpected behavior, and test failures that require investigation, a targeted code change, and full verification.
Why use it?
It prevents premature edits and makes sure the fix addresses the actual cause while preserving a regression test.

Skill for Claude CodeCodex

Part of the patrol plugin — 4 skills, 7 commands, 3 hooks shipped together

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/cukas/patrol/trace-fix
Any agent
npx skills add cukas/patrol --skill trace-fix
Clone the repo
git clone --depth 1 https://github.com/cukas/patrol

Made for: Claude Code, Codex.

Or install patrol, the plugin that ships this one along with the rest of its 4 skills, 7 commands, 3 hooks.

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 trace-fix

README.md
[![agentmods](https://agentmods.dev/badge/skills/cukas/patrol/trace-fix.svg)](https://agentmods.dev/skills/cukas/patrol/trace-fix)
Your own site
<a href="https://agentmods.dev/skills/cukas/patrol/trace-fix"><img src="https://agentmods.dev/badge/skills/cukas/patrol/trace-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 467 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.00030 $0.00467
Opus 5 $0.00015 $0.00234
Sonnet 5 $0.00006 $0.00093
Haiku 4.5 $0.00003 $0.00047

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

Security

Grade A, and why

trace-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 3d 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.

skills/trace-fix/SKILL.md · 41 lines

What it actually says

Trace-Fix

Trace the root cause, then fix it with tests. Fully autonomous.

Phase 1 — TRACE (do not edit any code yet)

  1. Read every file involved — use Read, Grep, Glob to trace the full call chain from entry point to where it breaks
  2. Document the root cause — state what is wrong, where, and why. Not symptoms — the actual cause
  3. If uncertain — say so explicitly. Do not guess. List hypotheses ranked by likelihood

Never edit a file you haven't read. Never propose a fix before tracing.

Phase 2 — FIX (test-driven)

  1. Write a failing test that reproduces the exact bug. Place it adjacent to the module under test using the project's existing test framework
  2. Run the test — confirm it fails for the right reason
  3. Implement the minimal fix — smallest change that makes the test pass
  4. Run the full test suite + type checker
  5. If any test fails — analyze the failure, adjust the fix, go back to step 7
  6. If 5 iterations pass without all tests green — STOP. Present what you've tried, what failed, and ask the user for direction. Do not spin indefinitely

Document assumptions at the top of your first response before writing test code.

Phase 3 — VERIFY

  1. Invoke review-gate — execute the review-gate skill now. Do not summarize or declare done until review-gate has completed and all findings are resolved

Rules

  • Read before edit — always. No exceptions
  • If no test framework exists: state this, write the fix without TDD, but still trace first
  • If no type checker exists: skip type checking, proceed with tests
  • Do not ask clarifying questions — make reasonable assumptions and document them
  • Do not show intermediate results — present final diff and test results when green
  • If patrol plugin is active and fires a warning: comply immediately. Read the files it flags before continuing
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. 3d ago First seen · 41 lines · 30 tokens per session scan A 4802f66b8ed9

Subscribe to this mod's changes

trace-fix is a skill published in the GitHub repository cukas/patrol (3 stars, last pushed 5mo ago), licensed MIT. It adds 30 tokens to every session and 467 once invoked, about $0.0002 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

slopmop

Trigger when you would normally reach for pytest, gh, mypy, black, or other raw repo tooling. Redirect to sm swab, sm scour, sm buff, sm sail, sm refit, or sm doctor so remediation follows the established rails. Also trigger when asked to "install" or "set up" slop-mop in a repo, or when you find a repo with sm…

ScienceIsNeato/slop-mop · 186 tokens

new-skill

Scaffold a new brooks-lint analysis skill so it passes npm run validate and npm run evals on the first try — generates skills/{name}/SKILL.md (with the mandatory "Do NOT trigger for:" clause and a Process section citing guide step ranges) plus skills/{name}/{name}-guide.md (sequentially numbered steps), then appends…

hyhmrright/brooks-lint · 145 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

promote-idea

Converts an album idea from IDEAS.md into an actual album project in one step. Use when the user says "promote [idea title]", "turn idea into album", or "start working on [idea]".

bitwize-music-studio/claude-ai-music-skills · 50 tokens

sheet-music-publisher

Converts mastered audio to sheet music and creates printable songbooks. Use after mastering when the user wants sheet music or a songbook for their album.

bitwize-music-studio/claude-ai-music-skills · 36 tokens

genre-creator

Create new genre documentation files for the bitwize-music genre library. Use when the user wants to add a genre, says "/genre-creator", "neues Genre erstellen", "Genre hinzufuegen", "add genre", or asks to create genre documentation. Takes a genre name as argument.

bitwize-music-studio/claude-ai-music-skills · 66 tokens