redteam

redteam is a command for Claude Code from CBirkbeck/mathlib-quality. It costs 111 tokens per session (5,700 once invoked), scanned A, original, MIT.

An adversarial review command for a Lean library, a codebase containing formally checked mathematics. It examines definitions and theorems, records findings, and fixes confirmed problems.

In plain words
What is it for?
Use it to audit a Lean library file by file, verify suspected errors, track which review rules missed them, and apply fixes.
Why use it?
It helps catch incorrect statements, unnecessary assumptions, duplicated work, and code smells that an earlier review missed. Findings are checked with compiling evidence before being treated as major problems.

Command for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT variable. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the mathlib-quality plugin — 2 skills, 24 commands, 2 hooks shipped together

Good fit Use it to audit a Lean library file by file, verify suspected errors, track which review rules missed them, and apply fixes.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add CBirkbeck/mathlib-quality
Claude Code
/plugin install mathlib-quality

Made for: Claude Code.

Or install mathlib-quality, the plugin that ships this one along with the rest of its 2 skills, 24 commands, 2 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 redteam

README.md
[![agentmods](https://agentmods.dev/badge/commands/cbirkbeck/mathlib-quality/redteam/github.svg)](https://agentmods.dev/commands/cbirkbeck/mathlib-quality/redteam)
Your own site
<a href="https://agentmods.dev/commands/cbirkbeck/mathlib-quality/redteam"><img src="https://agentmods.dev/badge/commands/cbirkbeck/mathlib-quality/redteam/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 redteam

Your own site · 80×15
<a href="https://agentmods.dev/commands/cbirkbeck/mathlib-quality/redteam"><img src="https://agentmods.dev/badge/commands/cbirkbeck/mathlib-quality/redteam.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 111 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,700 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.00111 $0.05700
Opus 5.5 $0.00044 $0.02280
Sonnet 5.5 $0.00022 $0.01140
Haiku 4.5 $0.00011 $0.00570

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

Security

Grade A, and why

redteam 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 19d 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/redteam.md · 359 lines

How it starts

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

/redteam — the Tau Ceti red team

The red team finds what Tau Ceti's review let through, and fixes it. It is adversarial and exhaustive. Every definition and statement is presumed wrong until you have tried to break it and failed; every declaration gets a recorded verdict in every category; nothing is too small to record.

The red team wins every time it confirms a big problem — a CRITICAL or MAJOR finding whose evidence compiles — and loses every time one of its claims is refuted. Both go on the scoreboard (scripts/redteam.py tally), so the way to win is to be right, not loud.

Everything on main was reviewed and approved, so every finding is also a miss by one of TauCetiReview's rubrics. Recording which rubric missed it, and the error's pattern, is how the hunt turns into better rubrics (/redteam report).

REQUIRED: the checklist, evidence recipes, Astra prompts and fix playbook are in references/tauceti-redteam.md. Read it before your first hunt.

The round

Modelled on /taupr: a round does exactly one unit of work — the first that applies.

R0  BOARD    every round, first: read our red-team PRs, sync the ledger, print the score
R1  REBASE   a red-team PR has a genuine TauCeti/ conflict
R2  FIX-CI   a red-team PR has `build` red
R3  FIX      a red-team PR has review findings: fix them, or contest in the rubric thread
R4  REVIEW   a red-team PR is green, and unreviewed ≥ 1h after its build → tauceti-review --post
R5  SHIP     fewer than --max-open (default 3) of this agent's PRs are open, and the ledger
             holds a confirmed finding with no PR: fix the worst one and open its PR
R6  HUNT     otherwise — unless --max-queue (default 10) topics of confirmed findings already
             wait for a PR — claim the next file and audit it down to the last declaration
    IDLE     none of the above
  • Maintenance outranks new work, so PRs in flight get merged instead of piling up.
  • The PR cap is load-bearing. A building PR and a green PR inside its first hour both look like nothing to do; uncapped, a ten-minute loop opens a PR every tick. At the cap the round hunts instead of shipping: finding problems is the red team's main job and needs no PR slot. Never open "just one more" because the fixes are small or the pipeline looks quick.
  • The queue cap stops hunting when shipping has fallen too far behind, so the backlog of confirmed-but-unfixed findings stays small enough to ship before main moves under it. It counts topics — the PRs the backlog would make (tally prints both) — since one file's twenty nits are one PR, not twenty.
  • A GitHub API failure aborts the round. No data means stop, never "nothing to do".
  • Merging, closing and de-duplicating belong to Tau Ceti's CI, never to this loop.

Read the full file on GitHub · 359 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. 19d ago First seen · 359 lines · 111 tokens per session scan A 71d2182a6063

Subscribe to this mod's changes

redteam is a command published in the GitHub repository CBirkbeck/mathlib-quality (35 stars, last pushed 5d ago), licensed MIT. It adds 111 tokens to every session and 5,700 once invoked, about $0.0004 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-09-29.