claude-workspace: Command for Claude Code

.claude/commands/build-fix.md

build-fix is a command for Claude Code from Piyush8296/claude-workspace. It costs 12 tokens per session (535 once invoked), scanned A, original, MIT.

An iterative build-error troubleshooter that runs the project build, identifies the underlying causes, applies fixes, and checks the result again.

In plain words
What is it for?
Use it for TypeScript, linting, missing-import, module-resolution, runtime, or other build failures, followed by type and quality checks after the build succeeds.
Why use it?
It helps turn a long or confusing list of compile and build errors into a prioritized sequence of problems to resolve.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is Piyush8296/claude-workspace's own configuration. It tells Claude Code how to work on claude-workspace itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-workspace configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Piyush8296/claude-workspace. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Piyush8296/claude-workspace/main/.claude/commands/build-fix.md
Clone the repo
git clone --depth 1 https://github.com/Piyush8296/claude-workspace

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/piyush8296/claude-workspace/build-fix/github.svg)](https://agentmods.dev/commands/piyush8296/claude-workspace/build-fix)
Your own site
<a href="https://agentmods.dev/commands/piyush8296/claude-workspace/build-fix"><img src="https://agentmods.dev/badge/commands/piyush8296/claude-workspace/build-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 build-fix

Your own site · 80×15
<a href="https://agentmods.dev/commands/piyush8296/claude-workspace/build-fix"><img src="https://agentmods.dev/badge/commands/piyush8296/claude-workspace/build-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 535 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.00012 $0.00535
Opus 5 $0.00006 $0.00267
Sonnet 5 $0.00002 $0.00107
Haiku 4.5 $0.00001 $0.00053

Measured 8d ago against content hash 2a3cb8ae7666, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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 · 92 lines

What it actually says

Build Fix

Diagnose and fix build errors: $ARGUMENTS

Instructions

1. Run the build

# Try project's build command
pnpm build 2>&1 || npm run build 2>&1

Capture the full error output.

2. Parse errors

For each error, identify:

  • File and line number
  • Error type (TypeScript, ESLint, import resolution, runtime)
  • Root cause (not just the symptom)

Group errors by type. Fix in this priority order:

  1. Import/module resolution errors (missing deps, wrong paths)
  2. TypeScript type errors
  3. ESLint errors
  4. Runtime/logic errors

3. Fix iteratively

For each error group:

a. Read the failing file and surrounding context
b. Identify the root cause (not just the error line)
c. Apply the fix
d. Run build again to verify
e. If new errors appear, continue the loop
f. If the same error persists after 3 attempts, STOP and report

Rules:

  • Fix root causes, not symptoms
  • Never suppress errors with @ts-ignore or eslint-disable unless explicitly approved
  • If a fix introduces new errors, revert and try a different approach
  • Maximum 10 fix iterations before stopping

4. Run full verification

After build passes:

# Type check
npx tsc --noEmit

# Lint
npx eslint src/ --no-error-on-unmatched-pattern

# Tests
npx vitest run --reporter=verbose 2>&1 | tail -30

5. Commit if clean

git add -A
git diff --cached --stat
git commit -m "fix: resolve build errors"

6. Report

## Build Fix Summary

**Status**: FIXED / PARTIALLY FIXED / BLOCKED
**Errors found**: X
**Errors fixed**: Y
**Iterations**: Z

### Fixes Applied
- [file:line] — description of fix

### Remaining Issues (if any)
- [file:line] — why this couldn't be auto-fixed
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. 8d ago First seen · 92 lines · 12 tokens per session scan A 2a3cb8ae7666

Subscribe to this mod's changes

build-fix is a command published in the GitHub repository Piyush8296/claude-workspace (2 stars, last pushed 4mo ago), licensed MIT. It adds 12 tokens to every session and 535 once invoked, about $0.0001 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.