sweep

sweep is a command for Claude Code from terrene-foundation/kailash-coc-claude-py. It costs 40 tokens per session (6,095 once invoked), scanned A, original, Apache-2.0.

A repository-wide audit command for finding unfinished work and process gaps across projects. It checks tasks, GitHub issues, validation findings, workspace state, and workflow hygiene before wrap-up.

In plain words
What is it for?
Use it as an end-of-cycle check to review open tasks, issues, specification gaps, stale state, and process problems.
Why use it?
It reduces the risk of declaring a project finished while work, issues, or validation gaps remain.

Command for Claude Code

Written for Claude Code: SessionEnd hook event. Also seen: reads .claude/ paths.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .claude/bin/worktree-reap.mjs --json # forest reap audit + size (report-only).

Good fit Use it as an end-of-cycle check to review open tasks, issues, specification gaps, stale state, and process problems.

Compare 6 commands from other repositories ↓
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/terrene-foundation/kailash-coc-claude-py
agentmods
npx agentmods add commands/terrene-foundation/kailash-coc-claude-py/sweep

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 sweep

README.md
[![agentmods](https://agentmods.dev/badge/commands/terrene-foundation/kailash-coc-claude-py/sweep/github.svg)](https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/sweep)
Your own site
<a href="https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/sweep"><img src="https://agentmods.dev/badge/commands/terrene-foundation/kailash-coc-claude-py/sweep/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 sweep

Your own site · 80×15
<a href="https://agentmods.dev/commands/terrene-foundation/kailash-coc-claude-py/sweep"><img src="https://agentmods.dev/badge/commands/terrene-foundation/kailash-coc-claude-py/sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,095 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.00040 $0.06095
Opus 5 $0.00020 $0.03047
Sonnet 5 $0.00008 $0.01219
Haiku 4.5 $0.00004 $0.00609

Measured 8d ago against content hash 69da8f635942, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

sweep 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 8d 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/sweep.md · 176 lines

How it starts

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

Purpose

A /sweep is the structural defense against "I think we're done." Before declaring a session converged or starting fresh work, surface every class of outstanding item: in-flight todos, open GH issues (this repo), spec-vs-code redteam gaps, stale workspace state, and process-hygiene gaps.

Distinct from /redteam (scopes to ONE workspace's spec compliance) — /sweep is repo-wide and rolls every workspace's redteam status into one view.

Project-scoped by default — Sweeps 1-8 target the CURRENT repo only. They do NOT compare against sibling SDK repos, PyPI, or BUILD-only state. BUILD repos (kailash-py, kailash-rs) maintain a richer LOCAL commands/sweep.md with cross-SDK + sibling-package + source-protection sweeps; do not edit those from here. Orchestration-root exception: Sweep 9 (below) adds a cross-ecosystem roll-up that fires only where an operator has DECLARED an ecosystem resolver config and the clone is not a declared consumer role — canonically loom (rules/repo-scope-discipline.md § Exceptions). It self-detects and emits an N/A sentinel otherwise, so the distributed command stays byte-identical on the 30+ downstream consumers (which carry no resolver config).

Execution Model

Autonomous — runs every sweep sequentially, accumulates findings into a single management decision report (.claude/skills/sweep/ § 1). Every finding is CATEGORY-classified per rules/product-completion-first.md (BUG / INVEST-NOW ISSUE / INCREMENTAL IMPROVEMENT — severity ranks, never gates fix-vs-defer): BUG + INVEST-NOW → FIX-NOW (invest-now judgment calls surfaced at the report's Decision Points for co-owner direction); INCREMENTAL → the deferred-quality tracking list under the four generalized zero-tolerance.md Rule-1b conditions. The agent MAY fix trivial BUGs inline (per rules/zero-tolerance.md Rule 1: "if you found it, you own it") but MUST surface every finding with its category + disposition; a completion-blocking finding deferred as "incremental" is BLOCKED (product-completion-first.md MUST-2).

Read the full file on GitHub · 176 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. 8d ago First seen · 176 lines · 40 tokens per session scan A 69da8f635942

Subscribe to this mod's changes

sweep is a command published in the GitHub repository terrene-foundation/kailash-coc-claude-py (12 stars, last pushed 24d ago), licensed Apache-2.0. It adds 40 tokens to every session and 6,095 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-03.