swarm: Command for Claude Code

.claude/commands/stage.md

stage is a command for Claude Code from swarm-ai-research/swarm. It costs 0 tokens per session (884 once invoked), scanned A, original, MIT.

A command for safely adding files to Git’s staging area, the place where changes are prepared for a commit. It checks for ignored files, possible secrets, large files, and generated runtime files first.

In plain words
What is it for?
Use it to stage selected files, all eligible changes, or changes chosen interactively before creating a Git commit.
Why use it?
It reduces the chance of committing passwords, unwanted artifacts, or files that Git will ignore, while avoiding repeated staging corrections.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is swarm-ai-research/swarm's own configuration. It tells Claude Code how to work on swarm itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything swarm configures →

Reuse

Borrowing it

Nothing to install: this file belongs to swarm-ai-research/swarm. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/swarm-ai-research/swarm/main/.claude/commands/stage.md
Clone the repo
git clone --depth 1 https://github.com/swarm-ai-research/swarm

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 stage

README.md
[![agentmods](https://agentmods.dev/badge/commands/swarm-ai-research/swarm/stage.svg)](https://agentmods.dev/commands/swarm-ai-research/swarm/stage)
Your own site
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/stage"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/stage.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 884 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.00000 $0.00884
Opus 5 $0.00000 $0.00442
Sonnet 5 $0.00000 $0.00177
Haiku 4.5 $0.00000 $0.00088

Measured 7d ago against content hash 33210aec6c99, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

stage 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 7d 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/stage.md · 110 lines

How it starts

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

/stage

Smart git staging with pre-flight validation. Prevents the add-verify-reset-readd cycle.

Usage

/stage <files...> or /stage --all or /stage --interactive

Examples:

  • /stage .claude/commands/status.md .claude/commands/stage.md
  • /stage swarm/core/proxy.py tests/test_proxy.py
  • /stage --all (stage all modified + untracked, with safety checks)

Behavior

Step 1: Pre-validate files

Before running git add, check each file for problems:

a) Gitignore check: run git check-ignore <file> for each file. If any are ignored, warn and skip them:

SKIPPED (gitignored): swarm/bridges/__init__.py

b) Secrets scan: run the secret patterns from .claude/hooks/pre-commit on each file's diff. If any match, warn and skip:

BLOCKED (potential secret): config/api_keys.yaml

c) Large file check: warn if any file is >1MB (likely binary/artifact):

WARNING (large file, 2.3MB): data/model_weights.bin

d) Runtime artifact check: warn if file matches common artifact patterns (*.db, *.log, .DS_Store, __pycache__/, node_modules/):

WARNING (runtime artifact): sqlite_mcp_server.db

Step 2: Clear stale staging

Check if there are already-staged files from a prior attempt. If so, report them:

Previously staged (from prior attempt):
  .claude/commands/pr.md
  .claude/commands/sync.md

Options:
  - Keep: add new files on top of existing staging
  - Reset: clear staging and start fresh with only the requested files

Default to Keep unless the user says otherwise.

Step 3: Stage validated files

Run git add only on files that passed validation.

Step 4: Report

Print a summary of what happened:

Staging Summary
────────────────────────────────
  Staged:   4 files (+128 / -23)
    .claude/commands/status.md (new)
    .claude/commands/stage.md (new)
    .claude/hooks/post_write_check.sh (new)
    .claude/settings.json (modified)

  Skipped:  1 file
    swarm/bridges/__init__.py (gitignored)

  Warnings: 0
────────────────────────────────
  Ready for: /preflight → commit

Read the full file on GitHub · 110 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. 7d ago First seen · 110 lines · 0 tokens per session scan A 33210aec6c99

Subscribe to this mod's changes

stage is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 884 tokens. 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.