costguard-fix

costguard-fix is a command for Claude Code from mbanderas/costguard. It costs 36 tokens per session (509 once invoked), scanned A, original, MIT.

A command that previews or applies automatic fixes to reduce wasted work in continuous integration (CI), the automated process that builds and tests code.

In plain words
What is it for?
Use it to inspect or apply timeout, concurrency, and paths-ignore changes across registered workspaces; it can also create local pull-request files.
Why use it?
It identifies missing time limits, duplicate-run controls, and path filters that can make CI jobs run longer or more often than needed.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the costguard plugin — 1 skill, 4 commands, 1 MCP server 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 commands/mbanderas/costguard/costguard-fix
Clone the repo
git clone --depth 1 https://github.com/mbanderas/costguard

Made for: Claude Code.

Or install costguard, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/mbanderas/costguard/costguard-fix.svg)](https://agentmods.dev/commands/mbanderas/costguard/costguard-fix)
Your own site
<a href="https://agentmods.dev/commands/mbanderas/costguard/costguard-fix"><img src="https://agentmods.dev/badge/commands/mbanderas/costguard/costguard-fix.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 509 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.00036 $0.00509
Opus 5 $0.00018 $0.00254
Sonnet 5 $0.00007 $0.00102
Haiku 4.5 $0.00004 $0.00051

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

Security

Grade A, and why

costguard-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.

commands/costguard-fix.md · 45 lines

What it actually says

Apply Costguard's CI auto-fixes (or preview them).

Requested action: $ARGUMENTS

Costguard is a built CLI bundled with this plugin at ${CLAUDE_PLUGIN_ROOT}/dist/cli/index.js. It reads a workspaces.json registry from the current working directory.

  1. Run the fixer, passing the user's arguments straight through:

    node "${CLAUDE_PLUGIN_ROOT}/dist/cli/index.js" fix $ARGUMENTS
    
    • Default is dry-run: with no --apply, the CLI prints a unified-diff preview of every change and writes nothing. Show that preview to the user.
    • --apply writes the surgical edits to the workspace's CI files on disk (only the deterministic ADD-rule fixers: timeout, concurrency, paths-ignore). It is idempotent — re-running applies nothing new.
    • --pr additionally writes local PR artifacts (branch.txt, fix.patch, pr-body.md); it does not push or open anything by itself.
    • A name or --all is required, else the CLI prints Error: specify workspaces or --all.
  2. Report the CLI's stdout verbatim (the diff preview, or the applied-rules summary). Relay any Error: line on non-zero exit.

Notes:

  • Prerequisite: the plugin runs the built dist/. If ${CLAUDE_PLUGIN_ROOT}/dist/cli/index.js is missing, run pnpm build once from the costguard checkout.
  • Costguard never pushes git. --open-pr is gated and refuses without an explicit token; even then it only opens a PR, never force-pushes. For the normal flow, prefer --apply (or --pr for reviewable artifacts) and let the human commit.
  • Only auto-fixable findings (the in-repo CI files) are touched. Cloud/provider findings are advisory and never 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. 5d ago First seen · 45 lines · 36 tokens per session scan A fb907ee2048e

Subscribe to this mod's changes

costguard-fix is a command published in the GitHub repository mbanderas/costguard (2 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 509 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.