trace-fix

trace-fix is a skill for Claude Code 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 Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it for bugs, unexpected behavior, and test failures that require investigation, a targeted code change, and full verification.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cukas/patrol/trace-fix
View source ↗ cukas/patrol
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 cukas/patrol --skill trace-fix
Clone the repo
git clone --depth 1 https://github.com/cukas/patrol

Made for: Claude Code.

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/github.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/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 trace-fix

Your own site · 80×15
<a href="https://agentmods.dev/skills/cukas/patrol/trace-fix"><img src="https://agentmods.dev/badge/skills/cukas/patrol/trace-fix.svg" alt="Reviewed on agentmods" width="80" 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. 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.00030 $0.00467
Opus 5.5 $0.00012 $0.00187
Sonnet 5.5 $0.00006 $0.00093
Haiku 4.5 $0.00003 $0.00047

Measured 1mo ago against content hash 4802f66b8ed9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 7mo ago), licensed MIT. It adds 30 tokens to every session and 467 once invoked, about $0.0001 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

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

ai-development-guide

Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates. Use when reviewing general/backend implementation choices, code smells, failures, or implementation completeness.

shinpr/claude-code-workflows · 43 tokens

recipe-diagnose

Investigate problem, verify findings, and derive solutions.

shinpr/claude-code-workflows · 15 tokens

health-check

Runs plugin health checks (venv packages, skill registration, and album slug collisions). Use when the user asks to check plugin health, verify setup, or troubleshoot missing skills.

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

cloudflare-workers-observability

Cloudflare Workers observability with logging, Analytics Engine, Tail Workers, metrics, and alerting. Use for monitoring, debugging, tracing, or encountering log parsing, metric aggregation, alert configuration errors.

secondsky/claude-skills · 47 tokens

cloudflare-workers-dev-experience

Cloudflare Workers local development with Wrangler, Miniflare, hot reload, debugging. Use for project setup, wrangler.jsonc configuration, or encountering local dev, HMR, binding simulation errors.

secondsky/claude-skills · 47 tokens