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.
curl -O https://raw.githubusercontent.com/swarm-ai-research/swarm/main/.claude/commands/install_hooks.mdgit clone --depth 1 https://github.com/swarm-ai-research/swarmWrote 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.
[](https://agentmods.dev/commands/swarm-ai-research/swarm/install_hooks)<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/install_hooks"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/install_hooks.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00710 |
| Opus 5 | $0.00000 | $0.00355 |
| Sonnet 5 | $0.00000 | $0.00142 |
| Haiku 4.5 | $0.00000 | $0.00071 |
Grade A, and why
install_hooks 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 today.
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.
How it starts
The opening of the file, as written. The whole thing — 61 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/install_hooks
Install repo-provided git hooks that enforce research hygiene. Also use this after editing any hook in .claude/hooks/.
Usage
/install_hooks
Behavior
-
Discover all hook scripts in
.claude/hooks/(e.g.pre-commit,pre-push). -
For each hook found:
- If a hook already exists in
.git/hooks/that differs from the source, create a.bakcopy first. - Copy from
.claude/hooks/<hook>to.git/hooks/<hook>. - Ensure it is executable (
chmod +x).
- Print a summary:
- Which hooks were installed or updated.
- Which hooks were unchanged (already in sync).
- How to bypass (only for emergencies):
SKIP_SWARM_HOOKS=1 git commit ...
- Verify the installed hooks match the source (diff check).
What pre-push enforces
In order, before any push leaves the machine:
make lint typecheck test-parallel— the same checks CI's lint, type-check and test jobs run (parallel,-m "not slow"). This used to bemake ci, whose serial coverage run takes 10+ minutes locally; coverage thresholds stay a CI concern. The hook first clearsGIT_DIR/GIT_INDEX_FILE/GIT_WORK_TREE, which git exports to hooks: without that, tests thatgit inita temp repo run against this repo instead (found 2026-09-06 on the first real run of this hook — it had never been installed).- Main-parity checks (bead
9qrv.1, Joel Test Q3): the two cheap CI jobs that most often turnmainred when a direct push skips the PR gate —python scripts/build_kb_graph.py --check(~1s) andmkdocs build --strict(~20s, skipped with a notice whenmkdocsis not installed). A failure here would failquality-gateonmain, so it blocks the push locally instead. - Review panel (bead
9qrv.3, Joel Test Q10):python -m swarm.agentgit review --base <remote-ref>over the commits being pushed. Advisory: the synthesis is printed; setSWARM_REVIEW_PANEL_BLOCK=1to refuse the push on ablockverdict. - Repo topics guard (existing behaviour).
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.
- today Changed · +25 lines e8b7aeb26d79
- 8d ago First seen · 36 lines · 0 tokens per session scan A 62b429f9d510
install_hooks is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 710 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.
Other commands, from other repositories
speckit.git.commit
Auto-commit changes after a Spec Kit command completes.
speckit.git.initialize
Initialize a Git repository with an initial commit.
git
The pre-finish status: branch, hygiene findings, message checks, workflow lint, template state.
commit
A command that examines staged Git changes and proposes a commit message using the Conventional Commits format, such as feat, fix, or docs. Git is a tool for tracking changes to code.
commit-claude-config
Version the Solana AI Kit config in git (un-ignores .claude/, CLAUDE.md, .mcp.json, .gitmodules and commits them).
session-report
Capture what changed this session and why, scoped to the current branch. Read by ship verbs when synthesizing the commit message; deleted after a successful commit.