sweep

sweep is a skill for Claude Code from Borda/AI-Rig. It costs 49 tokens per session (8,954 once invoked), scanned A, original, Apache-2.0.

A single-command pipeline for machine-learning research, from describing a goal to running an experiment campaign. It automatically creates a plan, reviews it, refines it up to three times, and then runs it.

In plain words
What is it for?
It helps turn a research goal into an experiment plan, check and revise that plan, and run the approved campaign. Interactive planning and review-only tasks use separate tools.
Why use it?
It removes the need to coordinate planning, methodology approval, and execution manually. It is useful when standard choices are acceptable and the process should run without interaction.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Codex.

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 research plugin — 8 skills, 2 agents shipped together

Good fit It helps turn a research goal into an experiment plan, check and revise that plan, and run the approved campaign. Interactive planning and review-only tasks use separate tools.

Compare 6 skills 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 Borda/AI-Rig
Claude Code
/plugin install research

Made for: Claude Code.

Or install research, the plugin that ships this one along with the rest of its 8 skills, 2 agents.

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/borda/ai-rig/sweep/github.svg)](https://agentmods.dev/skills/borda/ai-rig/sweep)
Your own site
<a href="https://agentmods.dev/skills/borda/ai-rig/sweep"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/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/borda/ai-rig/sweep"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,954 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.00049 $0.08954
Opus 5.5 $0.00020 $0.03582
Sonnet 5.5 $0.00010 $0.01791
Haiku 4.5 $0.00005 $0.00895

Measured 14d ago against content hash 833cb4d831d7, 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 14d 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.

plugins/cc_research/skills/sweep/SKILL.md · 381 lines

How it starts

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

End-to-end research pipeline: auto-plan → judge gate with J4 per-command execution approval → run. Single command from goal to result. Accepts goal string, passes all run/colab/team flags.

NOT for: interactive planning (use /research:plan); methodology review only (use /research:judge); running already-approved plan (use /research:run).

  • Key boundaries: end of S2 — program.md written and confirmed; end of S3 — judge+refinement verdict settled.
  • Preserve at S2: program-path (output of plan), GOAL string, OUT path (TMPDIR key), active sweep token printed at entry.
  • Mid-loop refresh: after each S3 fix-apply the contract is rewritten with refine-iter/no-fixes-iter/last-verdict (placed after fixes so the "fixes applied" claim is true) — a mid-loop compaction resumes at the current iteration instead of restarting REFINE_ITER=0.
  • Preserve at S3: judge verdict, JUDGE_REPORT path, program-path, GOAL.
  • Clear at sweep entry (stale prior run) and every terminal exit, including stops before S5.

Before Agent Resolution, clear stale sweep state:

PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name research) || exit $?; export PLUGIN_ROOT
export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
rm -f .temp/state/skill-contract.md "${TMPDIR:-/tmp}/sweep-out-path-${CSID}" "${TMPDIR:-/tmp}/sweep-run-args-${CSID}"  # sweep entry cleanup — stale state must not mark a new invocation as inlined  # timeout: 5000
SWEEP_TOKEN=$(python "$PLUGIN_ROOT/bin/make_run_dir.py" sweep .experiments) || exit 1  # timeout: 5000
printf '%s\n' "$SWEEP_TOKEN" > "${TMPDIR:-/tmp}/sweep-active-token-${CSID}"
echo "SWEEP_TOKEN=$SWEEP_TOKEN"

Before every terminal exit (completion, abort, blocked, unresolved stop, load/validation/tool failure, or a stop inside an inlined skill), execute the S5 exit cleanup block below before printing the final reply. This applies to every stop instruction in S1–S5 and the loaded plan, judge and run steps. Pausing for an answer or compaction is not a terminal exit: keep the active sweep state until it resumes or terminates.

Before executing any loaded judge or run block or writing a sweep compaction contract, substitute this invocation's printed SWEEP_TOKEN for <active-sweep-token>. Every sweep contract's preserve field must include sweep-token=<active-sweep-token> with that literal value substituted, so a resumed sweep retains its invocation identity. Never derive that trusted substitution from a pre-existing sentinel; standalone judge/run leave the placeholder unset. The sentinel is only the equality check against the active invocation's token.

Agent Resolution

Agent resolution: load and follow the protocol below. Contains: foundry check + fallback table. Foundry not installed → substitute each foundry:X with general-purpose per table.

# loads: compaction-contract.md
PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name research) || exit $?; export PLUGIN_ROOT
export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
python "$PLUGIN_ROOT/bin/resolve_shared.py" --persist research-shared --emit agent-resolution.md || exit 1  # timeout: 5000 — cold resolve; every later site (including the judge/run steps this skill runs inline) reads the research-shared sentinel

Sweep delegates to plan (S2), judge (S3), run (S5) — see each skill's Agent Resolution for fallback handling.

Read the full file on GitHub · 381 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. 14d ago Changed · +12 lines 833cb4d831d7
  2. 18d ago Changed · +37 lines · +4 tokens per session 791a78c5164f
  3. 1mo ago Changed · +36 lines 46366e0200be
  4. 1mo ago Changed 55ebf00201bc
  5. 1mo ago Changed 702bad95bede
  6. 1mo ago Changed · +5 lines e5d06931d935
  7. 2mo ago Changed · +11 lines 30467b9d849c
  8. 2mo ago Changed · -4 lines af256862c0e1
  9. 2mo ago Changed 2fc460bea152
  10. 2mo ago First seen · 284 lines · 45 tokens per session scan A eb3486892b21

Subscribe to this mod's changes

sweep is a skill published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 49 tokens to every session and 8,954 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-30.

Related

sweep compared with skills from other repositories

sweep next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
sweepBorda/AI-RigSkill31yesterdayApache-2.0A49Claude Code
genomic-intelligenceK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA151Claude Code, Codex
torch-geometricK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA71Claude Code, Codex
bulk-rnaseqK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA111Claude Code, Codex
aeonK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA74Claude Code
bidsK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA84Claude Code, Codex
genimlK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA42Claude Code