build-fix

build-fix is a command for Claude Code from sefaertunc/Worclaude. It costs 9 tokens per session (555 once invoked), scanned A, original, MIT.

A command that finds and fixes the current project's build, type-checking, test, and lint errors.

In plain words
What is it for?
Use it after code changes when the project does not build, type-check, pass tests, or meet lint rules.
Why use it?
It organizes failures by type and checks each fix, so errors can be resolved in a clear order instead of being handled all at once.

Command for Claude Code

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 commands/sefaertunc/worclaude/build-fix
Clone the repo
git clone --depth 1 https://github.com/sefaertunc/Worclaude

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/sefaertunc/worclaude/build-fix.svg)](https://agentmods.dev/commands/sefaertunc/worclaude/build-fix)
Your own site
<a href="https://agentmods.dev/commands/sefaertunc/worclaude/build-fix"><img src="https://agentmods.dev/badge/commands/sefaertunc/worclaude/build-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 555 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.00009 $0.00555
Opus 5 $0.00005 $0.00278
Sonnet 5 $0.00002 $0.00111
Haiku 4.5 $0.00001 $0.00056

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

Security

Grade A, and why

build-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 5d 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.

.claude/commands/build-fix.md · 65 lines

How it starts

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

Fix the current build failures. Delegates to the build-fixer agent for diagnosis and resolution.

Process

  1. Run /verify to capture test + lint failures (delegate; do not open-code the same checks). Then run the project's build command and type checker separately to capture compilation errors — these are intentionally outside /verify's read-only-fast contract, so /build-fix discovers them as part of the fix loop.

  2. Read the error output carefully. Categorize:

    • Build/compilation errors → fix first (nothing else works)
    • Type errors → fix second (often cascade into test failures)
    • Test failures → fix third (read test intent before changing)
    • Lint/format → fix last (auto-fix what you can)
  3. Fix one category at a time. Re-run /verify (and the build/type commands as relevant) after each fix.

  4. After all fixes, run /verify one more time plus the build to confirm everything passes.

Escalation: 3-attempt rule

If you make 3 unsuccessful fix attempts on the same error category, delegate that category to the bug-fixer agent (worktree-isolated).

Agent({
  subagent_type: "bug-fixer",
  description: "Diagnose stuck <category> errors",
  prompt: "build-fix has failed 3 times on <category>: <error summary>.
           Investigate root cause, propose fix, write regression test."
})

The user is the last resort, not the third. Hand off to bug-fixer before asking the human — it has the worktree isolation to safely explore root causes, can run scoped tests, and frees the main session to keep moving on other fixable errors.

Rules

  • Never silence a test by deleting it or adding .skip
  • Never weaken lint rules to make errors disappear — fix the code
  • If a test is genuinely wrong (tests old behavior that was intentionally changed), update it with a clear commit message
  • After 3 failed attempts on the same error category, delegate to bug-fixer (see Escalation above). Do not loop forever.

When to Use

  • Build is broken after a merge or rebase
  • Tests failing after dependency update
  • CI is red and you need to fix locally before pushing
  • After a large refactor that introduced errors

Read the full file on GitHub · 65 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. 5d ago First seen · 65 lines · 9 tokens per session scan A f9f2cc581b69

Subscribe to this mod's changes

build-fix is a command published in the GitHub repository sefaertunc/Worclaude (4 stars, last pushed 26d ago), licensed MIT. It adds 9 tokens to every session and 555 once invoked, about $0.0000 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.