coverage-gate

coverage-gate is a command for coding agents from juanmhidalgo/claude-plugins. It costs 33 tokens per session (1,026 once invoked), scanned A, original, MIT.

A command that checks changed source files against the code-coverage limits configured in continuous integration, the automated checks that run on code changes.

In plain words
What is it for?
Use it to find the configured coverage thresholds and check new or modified files against them.
Why use it?
It can reveal coverage failures before you push changes, while leaving the actual test run to your normal test command.

Command

Part of the code-review plugin — 5 skills, 14 commands, 13 agents 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/juanmhidalgo/claude-plugins/coverage-gate
Clone the repo
git clone --depth 1 https://github.com/juanmhidalgo/claude-plugins

Or install code-review, the plugin that ships this one along with the rest of its 5 skills, 14 commands, 13 agents.

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 coverage-gate

README.md
[![agentmods](https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/coverage-gate.svg)](https://agentmods.dev/commands/juanmhidalgo/claude-plugins/coverage-gate)
Your own site
<a href="https://agentmods.dev/commands/juanmhidalgo/claude-plugins/coverage-gate"><img src="https://agentmods.dev/badge/commands/juanmhidalgo/claude-plugins/coverage-gate.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,026 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.00033 $0.01026
Opus 5 $0.00016 $0.00513
Sonnet 5 $0.00007 $0.00205
Haiku 4.5 $0.00003 $0.00103

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

Security

Grade A, and why

coverage-gate 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 4d 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.

code-review/commands/coverage-gate.md · 146 lines

How it starts

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

Context

  • Current branch: !git branch --show-current
  • Base branch argument: $ARGUMENTS
  • Working tree: !git status --short

Phase 1: Detect CI Coverage Configuration

  1. Search for .github/workflows/*.yml files using Glob
  2. Grep for coverage action patterns: orgoro/coverage, CodeCoverageReport, cobertura-action, codecov
  3. If found, read the workflow file and extract thresholds from the with: block
  4. Normalize thresholds to 0-100 percentage scale
  5. If codecov/codecov-action found, also check for codecov.yml at repo root

If NO coverage config found: Report "No CI coverage configuration detected" and STOP.

Report detected thresholds:

## Detected Coverage Thresholds

Source: [workflow file] ([action name])
- All files: [X]%
- New files: [X]%
- Modified files: [X]%

Phase 2: Determine Base Branch and Categorize Files

  1. Determine base branch:
    • Use $ARGUMENTS if provided
    • Otherwise detect: git symbolic-ref refs/remotes/origin/HEAD --short (strips origin/ prefix)
  2. Categorize changed source files (exclude test files, __init__.py, configs, docs, migrations):
    • New files: git diff --name-only --diff-filter=A <base>...HEAD
    • Modified files: git diff --name-only --diff-filter=M <base>...HEAD

Report file categorization:

## Changed Files

### New ([count])
- [file paths]

### Modified ([count])
- [file paths]

Phase 3: Run Coverage

  1. Detect coverage tool — check GHA workflow for the coverage command, then fall back to project config
  2. Run the test suite with coverage report generation
  3. Parse per-file coverage from the report

Phase 4: Check Thresholds

For each changed source file, check coverage against its category threshold.

Report results:

## Coverage Gate Results

### Overall: [X]% (threshold: [X]%) — PASS/FAIL

### New Files
| File | Coverage | Threshold | Status |
|------|----------|-----------|--------|
| path/to/file.py | 53% | 80% | FAIL |

### Modified Files
| File | Coverage | Threshold | Status |
|------|----------|-----------|--------|
| path/to/file.py | 77% | 65% | PASS |

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

Subscribe to this mod's changes

coverage-gate is a command published in the GitHub repository juanmhidalgo/claude-plugins (8 stars, last pushed 9d ago), licensed MIT. It adds 33 tokens to every session and 1,026 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.