sweep

sweep is a skill for Claude Code from nirecom/agents. It costs 48 tokens per session (1,051 once invoked), scanned A, original, MIT.

A maintenance skill that dispatches several smaller cleanup tasks for worktrees, branches, plans, tests, and issues. A worktree is a separate checkout of a Git repository, and a branch is a line of development.

In plain words
What is it for?
Use it for periodic maintenance, either to preview cleanup with a dry run or to apply the cleanup.
Why use it?
It helps find and remove leftover development state that is no longer needed.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter. Also seen: model in frontmatter.

Good fit Use it for periodic maintenance, either to preview cleanup with a dry run or to apply the cleanup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nirecom/agents/sweep
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.

Any agent
npx skills add nirecom/agents --skill sweep
Clone the repo
git clone --depth 1 https://github.com/nirecom/agents

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/skills/nirecom/agents/sweep/github.svg)](https://agentmods.dev/skills/nirecom/agents/sweep)
Your own site
<a href="https://agentmods.dev/skills/nirecom/agents/sweep"><img src="https://agentmods.dev/badge/skills/nirecom/agents/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/skills/nirecom/agents/sweep"><img src="https://agentmods.dev/badge/skills/nirecom/agents/sweep.svg" alt="Reviewed on agentmods" width="80" 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,051 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.00048 $0.01051
Opus 5.5 $0.00019 $0.00420
Sonnet 5.5 $0.00010 $0.00210
Haiku 4.5 $0.00005 $0.00105

Measured 8d ago against content hash 42963a80aa60, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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.

skills/sweep/SKILL.md · 55 lines

How it starts

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

Hub skill for periodic maintenance sweeps. Dispatches to one or more sub-skills that each reclaim a specific class of residual state. A flagless run applies (deletes); /sweep-plans deletes only non-plan files and prints a count hint for plan and user-requested files. Pass --dry-run to preview without writing.

Procedure

SW-1. Invoke /sweep-worktrees (deletes by default; pass --dry-run to preview). SW-2. Invoke /sweep-branches (deletes by default; pass --dry-run to preview). Capture stdout for post-processing (SW-2b/SW-2c). SW-2a. When SW-2's stdout contains any WORKTREE-LOCKED line, emit echo <<WORKFLOW_ENFORCE_WORKTREE_OFF: sweep hub — SW-2b/SW-2c worktree-remove/branch-delete fallback>> before SW-2b. Skip SW-2a–SW-2d entirely when no WORKTREE-LOCKED line was produced. SW-2b. Resolve TARGET_MAIN_ROOT first: run bash "$AGENTS_MAIN_ROOT/bin/main-worktree-root" as its own call and copy its stdout literally. On a non-zero exit, skip the removals, report "SW-2b stopped: main worktree not resolved", and go to SW-2d. Parse sweep-branches stdout for WORKTREE-LOCKED lines. Each WORKTREE-LOCKED: branch=X wt=<path> line triggers: git -C "<TARGET_MAIN_ROOT>" worktree remove --force "<path>" Report each path whose removal fails, with git's stderr; continue with the next line. SW-2b lives in the hub (not sweep-branches.sh) because the hub has worktree-remove authority; sweep-branches.sh does not. SW-2c. After worktree removal, retry git branch -D for each WORKTREE-LOCKED branch using the branch=X field. SW-2b removes the worktree block, so the cascade rule no longer prevents deletion. Failures are ignored (reclaimed next cycle). SW-2d. Emit echo <<WORKFLOW_ENFORCE_WORKTREE_ON: sweep hub — SW-2b/SW-2c fallback complete>> after SW-2c, regardless of outcome. SW-3. Invoke /sweep-plans (deletes non-plan files by default and prints only a count hint for plan and user-requested files; pass --dry-run to preview). SW-4. Invoke /sweep-tests (deletes by default; --dry-run and --fix-headers are forwarded when passed). SW-5. Invoke /sweep-issues (tier-1 meta-parent closes apply by default; --dry-run previews). Tier-2 candidates are human-gated and only surface under --deep. SW-6. Invoke /sweep-shell-snapshots (deletes by default; pass --dry-run to preview). SW-7. Future sub-skills to be added in subsequent PRs:

  • /sweep-wip — stale WIP fingerprints
  • /sweep-logs — old terminal logs / temp files

Forward --dry-run (and any other flags) to each invoked sub-skill verbatim, except --include-plan-and-user-requested, which the hub never forwards.

Read the full file on GitHub · 55 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 Changed · +1 lines 42963a80aa60
  2. 9d ago Changed · +3 lines 8936eee00a7a
  3. 11d ago Changed 07cfd6d672d5
  4. 21d ago Changed bc41c6329a87
  5. 1mo ago Changed · +2 lines 9e95ef5838f2
  6. 1mo ago Changed · +1 lines · +8 tokens per session c1f3fb76ea4d
  7. 1mo ago First seen · 48 lines · 40 tokens per session scan A c04f9295ed7a

Subscribe to this mod's changes

sweep is a skill published in the GitHub repository nirecom/agents (3 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 1,051 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories