coverage-gate

coverage-gate is a command for Claude Code from juanmhidalgo/claude-plugins. It costs 33 tokens per session (1,237 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 for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the code-review plugin — 6 skills, 14 commands, 14 agents shipped together

Good fit Use it to find the configured coverage thresholds and check new or modified files against them.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/juanmhidalgo/claude-plugins/coverage-gate
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.

Clone the repo
git clone --depth 1 https://github.com/juanmhidalgo/claude-plugins

Made for: Claude Code.

Or install code-review, the plugin that ships this one along with the rest of its 6 skills, 14 commands, 14 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/github.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/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 coverage-gate

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,237 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.00033 $0.01237
Opus 5.5 $0.00013 $0.00495
Sonnet 5.5 $0.00007 $0.00247
Haiku 4.5 $0.00003 $0.00124

Measured 17d ago against content hash bb1c9b4ec37d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 17d 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 · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 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
  • Configured base branch: ${user_config.base_branch}
  • Configured coverage threshold: ${user_config.coverage_threshold}

A configured value counts only if it is non-empty and does not still read as a user_config placeholder; otherwise treat it as unset.

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:

  • Configured coverage threshold set: use it for all three categories, report Source: plugin userConfig (coverage_threshold), and continue
  • Unset: report "No CI coverage configuration detected" and STOP

If CI config leaves a category without a threshold: use the configured coverage threshold when set, else the skill's default for that category. A CI-configured threshold always wins over the configured one.

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
    • Else the configured base branch, if set
    • 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:

Read the full file on GitHub · 155 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. 17d ago Changed · +9 lines bb1c9b4ec37d
  2. 1mo 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 5d ago), licensed MIT. It adds 33 tokens to every session and 1,237 once invoked, about $0.0001 per session on Opus 5.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.