build-and-fix

A command that builds the project, checks its TypeScript code, and finds services or packages changed in the current session. It then works through compilation and build errors.

In plain words
What is it for?
Use it to check changed services in a project or monorepo—a repository containing multiple related packages—and repair errors so the project builds cleanly.
Why use it?
It helps locate broken parts after code changes and reduces the need to find and repair build errors manually.

Command

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/blencorp/claude-code-kit/build-and-fix
Clone the repo
git clone --depth 1 https://github.com/blencorp/claude-code-kit
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 579 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00011 $0.00579
Opus 5 $0.00005 $0.00290
Sonnet 5 $0.00002 $0.00116
Haiku 4.5 $0.00001 $0.00058

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

Security

Grade B, and why

build-and-fix scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

!cat "$CLAUDE_PROJECT_DIR/.claude/tsc-cache"/*/affected-repos.txt 2>/dev/null | sort -u || echo "No services modified yet"
cli/core/commands/build-and-fix.md · 98 lines

How it starts

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

You are a build engineer focused on ensuring zero compilation errors and a clean build state.

Philosophy: #NoMessLeftBehind

We NEVER leave broken builds. Every change must compile cleanly.

Context

Services modified this session (auto-generated):

!cat "$CLAUDE_PROJECT_DIR/.claude/tsc-cache"/*/affected-repos.txt 2>/dev/null | sort -u || echo "No services modified yet"

User-specified services: $ARGUMENTS

Your Task

Build the project and fix all errors:

  1. Detect Build System

    • Check for TypeScript (tsconfig.json)
    • Check for build scripts in package.json
    • Identify monorepo structure if present
  2. Run Builds

    • For each service/package that was modified:
      • Run TypeScript compilation (tsc --noEmit or equivalent)
      • Run build script if defined (npm run build or similar)
      • Capture all errors and warnings
  3. Fix Errors Automatically

    • Use the Task tool to launch the auto-error-resolver agent with:
      • subagent_type: auto-error-resolver
      • description: fix build errors
      • prompt: List all services with build errors and ask the agent to:
        • Run the builds and analyze errors
        • Fix errors systematically
        • Verify each fix by re-running the build
        • Continue until achieving zero errors
  4. Verify Clean Build

    • Re-run builds after fixes
    • Ensure zero errors and zero warnings
    • Report final build status

Build Commands by Project Type

Frontend (React/Vite):

npm run build
# or
npx tsc --noEmit

Backend (Node.js/Express):

npx tsc --noEmit
# or for specific tsconfig
npx tsc --project tsconfig.build.json --noEmit

Monorepo:

# Build specific service
cd services/[service-name]
npm run build

Quality Standards

  • Must achieve zero compilation errors
  • Must achieve zero build errors
  • Report all warnings even if they don't fail the build
  • Provide clear summary of what was fixed
  • Include build time and success confirmation

Read the full file on GitHub · 98 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. 3d ago First seen · 98 lines · 11 tokens per session scan B 9e6ec568f551

Subscribe to this mod's changes

build-and-fix is a command published in the GitHub repository blencorp/claude-code-kit (101 stars, last pushed 9mo ago), licensed MIT. It adds 11 tokens to every session and 579 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.