swarm: Command for Claude Code

.claude/commands/check_ignore.md

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

A command that checks whether Git will hide files in a target directory because of a `.gitignore` rule.

In plain words
What is it for?
Use it before creating files in a new directory, especially when nested folders may match broad `.gitignore` patterns.
Why use it?
It prevents new files from being created successfully but remaining invisible to Git. It also identifies the rule causing the problem and can verify a fix.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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/check_ignore.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 check_ignore

README.md
[![agentmods](https://agentmods.dev/badge/commands/swarm-ai-research/swarm/check_ignore/github.svg)](https://agentmods.dev/commands/swarm-ai-research/swarm/check_ignore)
Your own site
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/check_ignore"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/check_ignore/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 check_ignore

Your own site · 80×15
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/check_ignore"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/check_ignore.svg" alt="Reviewed on agentmods" width="80" 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 408 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.00408
Opus 5 $0.00000 $0.00204
Sonnet 5 $0.00000 $0.00082
Haiku 4.5 $0.00000 $0.00041

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

Security

Grade A, and why

check_ignore 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 10d 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/check_ignore.md · 39 lines

What it actually says

/check-ignore

Verify that .gitignore won't hide files in a target directory before you create them. Prevents the "wrote 7 files but git can't see them" footgun.

Usage

/check-ignore <path>

Examples:

  • /check-ignore swarm/bridges/new_bridge/
  • /check-ignore swarm/research/new_module/

Behavior

  1. Run git check-ignore -v <path>/__init__.py (use a synthetic filename if the dir doesn't exist yet).

  2. If ignored, report:

    • Which .gitignore rule is responsible (file, line number, pattern)
    • Whether the pattern is missing a leading / anchor (most common cause)
    • Suggest the fix (e.g. bridges//bridges/)
    • Ask the user whether to apply the fix
  3. If not ignored, report "Path is visible to git" and proceed.

  4. If the fix is applied, verify by re-running git check-ignore to confirm the path is now visible.

Why this exists

.gitignore patterns without a leading / match anywhere in the tree. A rule like bridges/ intended for a root-level directory will also match swarm/bridges/live_swe/. Files already tracked before the rule was added remain tracked, but new files in the same parent are silently invisible. This wastes time debugging "why doesn't git status show my files."

Known patterns in this repo

The following .gitignore entries are anchored to root and should stay that way:

  • /bridges/ — root-level relocated directory (not swarm/bridges/)
  • submissions/ — root-level submissions dir
  • swarm-api/ — root-level API dir

If you add a new gitignore rule for a directory name that also exists under swarm/, anchor it with a leading /.

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. 10d ago First seen · 39 lines · 0 tokens per session scan A a9dc59decbd1

Subscribe to this mod's changes

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