sweep

sweep is a command for Claude Code from terrene-foundation/metis. It costs 40 tokens per session (1,551 once invoked), scanned A, original, Apache-2.0.

A project-wide command for auditing unfinished work before closing a development cycle. It checks workspace tasks, GitHub issues, differences between specifications and code, stale state, and process problems.

In plain words
What is it for?
Use it before wrapping up a project to collect findings, assign severity, and decide whether each issue should be fixed, reported, deferred, or dismissed.
Why use it?
It helps reveal overlooked work so a project is not mistakenly treated as complete.

Command for Claude Code

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.

agentmods
npx agentmods add commands/terrene-foundation/metis/sweep
Clone the repo
git clone --depth 1 https://github.com/terrene-foundation/metis

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/metis/sweep.svg)](https://agentmods.dev/commands/terrene-foundation/metis/sweep)
Your own site
<a href="https://agentmods.dev/commands/terrene-foundation/metis/sweep"><img src="https://agentmods.dev/badge/commands/terrene-foundation/metis/sweep.svg" alt="Measured on agentmods" 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 1,551 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.01551
Opus 5 $0.00020 $0.00776
Sonnet 5 $0.00008 $0.00310
Haiku 4.5 $0.00004 $0.00155

Measured 5d ago against content hash 9370ca860c3b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 5d 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 · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 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 — targets the CURRENT repo only. Does 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.

Execution Model

Autonomous — runs every sweep sequentially, accumulates findings into a single report. The agent MAY fix trivial gaps inline (per rules/zero-tolerance.md Rule 1: "if you found it, you own it") but MUST surface every finding with its disposition (FIX-NOW / FILE-ISSUE / DEFER-WITH-REASON / FALSE-POSITIVE).

Workflow

Run all 7 sweeps. Aggregate findings into a single report at the end with severity (CRIT / HIGH / MED / LOW), disposition, and pointer (file:line, PR#, issue#).

Sweep 1: Active todos across all workspaces

find workspaces/*/todos/active/ -name "*.md" -not -name "*-milestone-tracker.md" 2>/dev/null

Read frontmatter (status, priority, wave). Group by workspace. Surface stale (>7d) workspaces' todos with explicit "is this still relevant?" flag.

Sweep 2: Pending journal entries (auto-generated, awaiting promotion)

find workspaces/*/journal/.pending/ -name "*.md" 2>/dev/null

Per rules/journal.md: high-value commit body → promote, bare merge → discard, already-codified → discard with note.

Sweep 3: GitHub open issues — current repo (auto-detected)

REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null)
gh issue list --repo "$REPO" --state open --limit 50 \
  --json number,title,labels,createdAt,updatedAt,comments

Read the full file on GitHub · 118 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. 5d ago First seen · 118 lines · 40 tokens per session scan A 9370ca860c3b

Subscribe to this mod's changes

sweep is a command published in the GitHub repository terrene-foundation/metis (2 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 40 tokens to every session and 1,551 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-08-31.