cw-gates

cw-gates is a skill for Claude Code, Codex from Hmbown/Codewhale. It costs 48 tokens per session (1,465 once invoked), scanned A, original, MIT.

Use before claiming any Codewhale change is done, green, or ready to land: the focused-to-broad verification ladder, the budget checks CI enforces, and the rules for what counts as a passing test.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for codewhale. Also seen: built for codewhale.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/check-dead-code-budget.py # #[allow(dead_code)] ceiling.

About the project

Codewhale is an open-source coding agent that runs in the terminal and can read repositories, edit files, execute commands, and inspect results while pursuing a task. Developers use it with hosted providers or local models, with controls for how much access it receives.

Hmbown/Codewhale · 40,916 stars · on GitHub · codewhale.net

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Hmbown/Codewhale
agentmods
npx agentmods add skills/hmbown/codewhale/cw-gates

Made for: Claude Code, Codex.

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 cw-gates

README.md
[![agentmods](https://agentmods.dev/badge/skills/hmbown/codewhale/cw-gates.svg)](https://agentmods.dev/skills/hmbown/codewhale/cw-gates)
Your own site
<a href="https://agentmods.dev/skills/hmbown/codewhale/cw-gates"><img src="https://agentmods.dev/badge/skills/hmbown/codewhale/cw-gates.svg" alt="Measured on agentmods" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,465 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00048 $0.01465
Opus 5 $0.00024 $0.00732
Sonnet 5 $0.00010 $0.00293
Haiku 4.5 $0.00005 $0.00146

Measured today against content hash 436597048bbe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

cw-gates 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 today.

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.

docs/skills/cw-gates/SKILL.md · 140 lines

How it starts

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

cw-gates

Pick the smallest evidence that answers the actual risk, then quote the real output. This repo has been burned twice by the alternative: an exit code mistaken for a pass, and a harness whose scoring line silently reported unevaluated rows as green. Assertions without command output are not evidence.

Stage 3 of the loop: cw-orientcw-slicegatescw-dogfoodcw-landcw-handoff.

When to use

  • Before saying "done", "green", "passing", "fixed", or "ready to land".
  • Before a dogfood build — never install an ungated binary.
  • When asked to "run the gates" or to prove a change is safe.

For release work specifically, use codew-release-qa-sweep instead — it adds the version-drift gate and the manual TUI QA targets on top of this ladder.

Workflow

Climb only as far as the risk requires. Say where you stopped and what you skipped.

Rung 1 — always, and cheap

cargo fmt --all -- --check
git diff --check

Rung 2 — the area that owns the change

scripts/dev-test.sh maps an area or a source path to the fastest correct invocation, and applies the isolated build-dir topology (docs/BUILD_PERFORMANCE.md):

scripts/dev-test.sh --list
scripts/dev-test.sh crates/tui/src/elapsed.rs      # path → area + filter
scripts/dev-test.sh tui tools::                    # area + filter
scripts/dev-test.sh config

It uses cargo nextest run when nextest is on PATH (.config/nextest.toml); CODEWHALE_DEV_NEXTEST=0 forces libtest. For the TUI crate, --lib and --tests are disjoint — choose the target that owns the behavior rather than running both by reflex.

cargo test --no-run answers a compile question without executing unrelated cases. cargo test --doc covers doc examples, and is only worth running when those examples changed.

Rung 3 — the budgets and drift checks CI enforces

Read the full file on GitHub · 140 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. today First seen · 140 lines · 48 tokens per session scan A 436597048bbe

Subscribe to this mod's changes

cw-gates is a skill published in the GitHub repository Hmbown/Codewhale (40,916 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 1,465 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-09-06.