build-guard

build-guard is a skill for Claude Code from cukas/patrol. It costs 33 tokens per session (816 once invoked), scanned A, original, MIT.

A skill that plans and then implements features, refactors, or changes across multiple files with review points and regression checks.

In plain words
What is it for?
Use it to explore a codebase, prepare an approved implementation plan, decide whether to work directly or use subagents, make changes, and verify them.
Why use it?
It reduces the risk of coding before the affected files, dependencies, and likely breakages are understood.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions subagents; names the ExitPlanMode tool.

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/build-guard
Any agent
npx skills add cukas/patrol --skill build-guard
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 build-guard

README.md
[![agentmods](https://agentmods.dev/badge/skills/cukas/patrol/build-guard.svg)](https://agentmods.dev/skills/cukas/patrol/build-guard)
Your own site
<a href="https://agentmods.dev/skills/cukas/patrol/build-guard"><img src="https://agentmods.dev/badge/skills/cukas/patrol/build-guard.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 816 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.1 $0.00033 $0.00816
Opus 5 $0.00016 $0.00408
Sonnet 5 $0.00007 $0.00163
Haiku 4.5 $0.00003 $0.00082

Measured 6d ago against content hash 6f6451765565, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

build-guard 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 6d 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/build-guard/SKILL.md · 73 lines

How it starts

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

Build-Guard

Plan in isolation, implement with guardrails. Fully autonomous after approval.

Phase 1 — PLAN (read-only)

  1. Enter plan mode — call EnterPlanMode. No code changes until Phase 2
  2. Explore — use Read, Grep, Glob to understand every file related to the task, plus their direct callers and dependents
  3. Write a numbered plan:
    • Each file to change and what changes are needed
    • Dependencies between changes (order matters)
    • Potential regression risks per change
    • Estimated complexity: small (1-2 files), medium (3-5 files), large (6+ files)
  4. Present the plan for user approval
digraph plan_decision {
    "Plan approved" [shape=diamond];
    "Small (1-2 files)" [shape=diamond];
    "Exit plan mode, implement inline" [shape=box];
    "Exit plan mode, dispatch subagents" [shape=box];
    "Context heavy?" [shape=diamond];
    "Handoff plan, clear context, resume" [shape=box];

    "Plan approved" -> "Small (1-2 files)";
    "Small (1-2 files)" -> "Exit plan mode, implement inline" [label="yes"];
    "Small (1-2 files)" -> "Context heavy?" [label="no"];
    "Context heavy?" -> "Handoff plan, clear context, resume" [label="yes"];
    "Context heavy?" -> "Exit plan mode, dispatch subagents" [label="no"];
}

If context is heavy after planning (exploration consumed significant context): run /handoff to save the plan, then the user can clear context and resume with full budget for implementation. If remembrall is not installed, save the plan to docs/plans/ as a file instead.

Phase 2 — IMPLEMENT

  1. Exit plan mode — call ExitPlanMode

Small plans (1-2 files): implement directly, one file at a time.

Medium/large plans: dispatch subagents.

  • One subagent per file or logical chunk (files that must change together)
  • Each subagent receives: the plan, its specific task, and relevant file context
  • Use Agent tool with a clear prompt describing exactly what to change and why
  1. After each file/subagent completes:
    • Review the changes (read the modified files)
    • Run the project's type checker — fix errors before moving on
  2. After every 3 completed files, or sooner if a change touches a shared interface:
    • Run the full test suite
    • If any test breaks: stop immediately, analyze root cause, explain before continuing
    • If the approach is fundamentally wrong: revise the plan, inform the user
  3. After all changes: run the full test suite and type checker one final time

Read the full file on GitHub · 73 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. 6d ago First seen · 73 lines · 33 tokens per session scan A 6f6451765565

Subscribe to this mod's changes

build-guard is a skill published in the GitHub repository cukas/patrol (3 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 816 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.