metaswarm: Command for Claude Code

.claude/commands/prime.md

prime is a command for Claude Code from dsifry/metaswarm. It costs 10 tokens per session (2,443 once invoked), scanned A, original, MIT.

A command that loads relevant facts from a project knowledge base into the agent's working context before it investigates, plans, implements, or reviews code.

In plain words
What is it for?
Use it when starting an issue, changing code areas, or switching tasks. It can gather context automatically or by selected files, keywords, or work type.
Why use it?
It helps the agent follow existing project rules and patterns, avoid known pitfalls, and not repeat previously learned mistakes.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is dsifry/metaswarm's own configuration. It tells Claude Code how to work on metaswarm 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 metaswarm configures →

Part of the metaswarm plugin — 15 skills, 16 commands, 31 agents, 3 hooks shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to dsifry/metaswarm. 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/dsifry/metaswarm/main/.claude/commands/prime.md
Clone the repo
git clone --depth 1 https://github.com/dsifry/metaswarm

Made for: Claude Code.

Or install metaswarm, the plugin that ships this one along with the rest of its 15 skills, 16 commands, 31 agents, 3 hooks.

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 prime

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/dsifry/metaswarm/prime"><img src="https://agentmods.dev/badge/commands/dsifry/metaswarm/prime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,443 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.00010 $0.02443
Opus 5.5 $0.00004 $0.00977
Sonnet 5.5 $0.00002 $0.00489
Haiku 4.5 $0.00001 $0.00244

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

Security

Grade A, and why

prime 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 21d 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/prime.md · 257 lines

How it starts

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

Prime (metaswarm knowledge priming)

CRITICAL: Run this command at the START of any investigation, planning, or implementation work to load relevant knowledge into your context.

When to Use

  • Starting work on a GitHub Issue
  • Beginning investigation/research
  • Before writing a plan
  • Before implementing changes
  • When switching to a new area of the codebase

How It Works

/prime reads metaswarm's knowledge base, the JSONL fact files in .beads/knowledge/ (the project's own learnings) and, in the metaswarm repo, the shipped examples in knowledge/, and filters it with jq down to the facts relevant to your current work, so you:

  1. Follow established patterns and rules
  2. Avoid known gotchas and pitfalls
  3. Make decisions aligned with architectural choices
  4. Don't repeat mistakes that have been learned from

/prime filters on three things, any combination of which can be given as arguments (e.g. /prime auth src/api/auth/ implementation):

Filter Matches against
Keyword (topic, e.g. auth) .fact and .tags (case-insensitive)
File (path or path fragment you will touch) .affectedFiles
Work type (planning, implementation, review, debugging, research, release) .type (e.g. gotcha, pattern, decision, api_behavior)

The bd workflow reference is separate: if bd is installed, plain bd prime prints bd's own workflow reference and any bd remember memories. It has no filters and never reads .beads/knowledge/, so use /prime for the knowledge base.

Usage

The knowledge files may start with # comment lines (the shipped knowledge/*.jsonl do), so strip them with grep -hv '^#' before handing the lines to jq. Set KB to the store you want to search:

KB=.beads/knowledge      # project knowledge (or: KB=knowledge for the shipped examples)

Prime for Keywords

When working on a specific topic (K is a case-insensitive regex):

K="auth"
grep -hv '^#' "$KB"/*.jsonl | jq -r --arg k "$K" 'select((.fact | test($k; "i")) or ((.tags // []) | any(test($k; "i")))) | .fact + (if .recommendation then "\n  -> " + .recommendation else "" end)'

Read the full file on GitHub · 257 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. 21d ago Changed · +1 lines b9b0219abc28
  2. 24d ago Changed · -4 lines fe1448a3ee76
  3. 25d ago Changed 8cc196b24ec4
  4. 3mo ago First seen · 260 lines · 10 tokens per session scan A 8fc65af9e932

Subscribe to this mod's changes

prime is a command published in the GitHub repository dsifry/metaswarm (442 stars, last pushed yesterday), licensed MIT. It adds 10 tokens to every session and 2,443 once invoked, about $0.0000 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

prime compared with commands from other repositories

prime next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
primedsifry/metaswarmCommand442yesterdayMITA10Claude Code
minutes-ideassilverstein/minutesCommand1.6ktodayMITA48Claude Code, OpenCode
learnReflexioAI/claude-smartCommand798todayApache-2.0A14Claude Code
memory-storeverygoodplugins/mcp-automemCommand67todayMITA10Claude Code
analyze-contextRohiRIK/OpenLtmCommand313d agoMITA39Claude Code
recallnaimkatiman/continuous-improvementCommand11yesterdayMITA44Claude Code
cc-memoryTheLobbi/claudeCommand221mo agoMITA0Claude Code