champion-epic-guard-invariants

champion-epic-guard-invariants is a command for Claude Code from rjwalters/kicad-tools. It costs 0 tokens per session (2,344 once invoked), scanned A, original, MIT.

Maintainer notes for the guard that stops a Champion pass from repeatedly commenting on an unchanged epic. An epic is a large tracked piece of work that can contain smaller issues.

In plain words
What is it for?
They are for developers editing the epic-review guard or its completion step, and for checking that its invariants still hold.
Why use it?
They explain how the guard detects real edits and preserves its counters, reducing the risk of duplicate comments after future changes.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit They are for developers editing the epic-review guard or its completion step, and for checking that its invariants still hold.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rjwalters/kicad-tools/champion-epic-guard-invariants
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/rjwalters/kicad-tools

Made for: Claude Code.

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 champion-epic-guard-invariants

README.md
[![agentmods](https://agentmods.dev/badge/commands/rjwalters/kicad-tools/champion-epic-guard-invariants/github.svg)](https://agentmods.dev/commands/rjwalters/kicad-tools/champion-epic-guard-invariants)
Your own site
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/champion-epic-guard-invariants"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/champion-epic-guard-invariants/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 champion-epic-guard-invariants

Your own site · 80×15
<a href="https://agentmods.dev/commands/rjwalters/kicad-tools/champion-epic-guard-invariants"><img src="https://agentmods.dev/badge/commands/rjwalters/kicad-tools/champion-epic-guard-invariants.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,344 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.00000 $0.02344
Opus 5.5 $0.00000 $0.00938
Sonnet 5.5 $0.00000 $0.00469
Haiku 4.5 $0.00000 $0.00234

Measured 2d ago against content hash f0c3bebab6b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

champion-epic-guard-invariants 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 2d 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.

.claude/commands/loom/champion-epic-guard-invariants.md · 124 lines

How it starts

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

Champion: Idempotency Guard for Unrevised Epics — Maintainer Notes

Editor-facing notes for champion-epic.md → "Idempotency Guard for Unrevised Epics": why the marker keys on a body hash, what each counter counts, the cycle-by-cycle trace, and the invariants a future edit must preserve. A running Champion pass needs nothing here — the guard's own code and outcome table are complete without it. Split out so champion-epic.md stays under its markdown-token ratchet (#7725), the same move #7666 made for Step 0.5. Read this before editing the guard or Step 4.

Why a hash of title + body, and NOT the epic's updatedAt

updatedAt is self-invalidating — posting the verdict comment bumps it, so the marker could never match and every pass would re-comment. A title + body hash changes if and only if the epic is actually edited. Full derivation: champion-issue-promo.md → "Why a body hash and NOT the issue's updatedAt (#4966)".

The counters, and why the skip must cost something

Mechanism Counts Written by Survives a silent skip?
PRIOR_REJECTIONS posted Champion Review: Epic Needs Revision comments (any revision) Step 4's reject branch Yes, but frozen while skipping — it cannot advance on its own
SKIP_STREAK silent skips recorded for the current body hash the skip path's in-place PATCH of the existing verdict comment Yes — this is the counter that keeps advancing
UNREVISED_EVALS = PRIOR_REJECTIONS + SKIP_STREAK evaluation cycles spent on an unrevised epic derived Yes — the single escalation gate, used identically by the skip path and Step 4

Suppressing duplicate comments must never suppress the escalation that puts a stuck epic in front of a human (#4967). Traced against an epic that fails at body hash H1 and is never revised:

Cycle Marker match? PRIOR_REJECTIONS SKIP_STREAK UNREVISED_EVALS Outcome Comments posted
1 no (H1 unseen) 0 0 0 evaluate → reject → post "Epic Needs Revision" carrying VERDICT_MARKER + epic-unrevised-skips:H1:0 1
2 yes (H1) 1 0 1 < 2 silent skip; PATCH the tally to 1 0
3 yes (H1) 1 1 2 ≥ 2 ESCALATE_UNREVISED=yes → Step 4 escalation → loom:operator 1 (escalation)
4+ — — — — ALREADY_ROUTED=yes drops it from every future pass 0

Read the full file on GitHub · 124 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. 2d ago Changed f0c3bebab6b8
  2. 21d ago Changed · +11 lines b43dee733ecf
  3. 24d ago Changed · +10 lines 7db2dd559b2e
  4. 29d ago Changed · +18 lines 5a9299f6ec71
  5. 1mo ago First seen · 85 lines · 0 tokens per session scan A 6b7b821e54a5

Subscribe to this mod's changes

champion-epic-guard-invariants is a command published in the GitHub repository rjwalters/kicad-tools (70 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,344 tokens. 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-09-17.