Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/martybonacci/specswarm/interventiongit clone --depth 1 https://github.com/MartyBonacci/specswarmWhat 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 | $0.00046 | $0.02262 |
| Opus 5 | $0.00023 | $0.01131 |
| Sonnet 5 | $0.00009 | $0.00452 |
| Haiku 4.5 | $0.00005 | $0.00226 |
Grade A, and why
intervention 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SpecSwarm Intervention Capture
Records a moment when you noticed something the automation missed. Each intervention is a structured 4-field observation:
- What I noticed — the symptom you caught
- What should have caught this — the verification angle
- How automation could prevent it next time — a suggested fix or check
- Status — open / graduated / wontfix
Over time, accumulated interventions become the "pattern library" that future automation (spec-mentor agent, new preflight checks, new constitution hooks) trains against. After 10–15 interventions in a project, the patterns repeat — and that's where new automation comes from.
Write the intervention
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# shellcheck disable=SC1090
source "${PLUGIN_DIR}/lib/intervention.sh"
# shellcheck disable=SC1090
source "${PLUGIN_DIR}/lib/notify.sh" 2>/dev/null || true
# Parse arguments
NOTICED=""
SHOULD=""
PREVENT=""
STATUS="open"
FEATURE_OVERRIDE=""
TASK_OVERRIDE=""
LIST_MODE=false
LIST_LIMIT=10
while [ $# -gt 0 ]; do
case "$1" in
--should) SHOULD="$2"; shift 2 ;;
--prevent) PREVENT="$2"; shift 2 ;;
--status) STATUS="$2"; shift 2 ;;
--feature) FEATURE_OVERRIDE="$2"; shift 2 ;;
--task) TASK_OVERRIDE="$2"; shift 2 ;;
--list)
LIST_MODE=true
shift
# Optional numeric limit
if [ "${1:-}" =~ ^[0-9]+$ ]; then LIST_LIMIT="$1"; shift; fi
;;
-h|--help)
cat <<EOF
Usage: /ss:intervention [NOTICED] [options]
/ss:intervention --list [N]
Capture a "something feels off" moment as a durable memory file.
Options:
--should TEXT What check should have caught it (verification angle)
--prevent TEXT How automation could prevent it next time
--status STATUS open (default) | graduated | wontfix
--feature ID Override auto-detected feature
--task ID Override auto-detected task
--list [N] List recent interventions instead of capturing
Examples:
/ss:intervention "plan.md says 43 columns but spec says 47"
/ss:intervention "version pin doesn't exist" --should "verify against npm registry" --prevent "ship in /ss:preflight"
/ss:intervention --status graduated --noticed "postgres.js drift" --prevent "/ss:preflight v7.1.0 catches it"
/ss:intervention --list 5
EOF
exit 0
;;
*)
if [ -z "$NOTICED" ]; then NOTICED="$1"; else NOTICED="$NOTICED $1"; fi
shift
;;
esac
done
# ─── List mode ────────────────────────────────────────────────────────────────
if [ "$LIST_MODE" = true ]; then
echo "📋 Recent SpecSwarm interventions (last ${LIST_LIMIT}):"
echo ""
ss_intervention_list "$LIST_LIMIT"
exit 0
fi
# ─── Capture mode ─────────────────────────────────────────────────────────────
DIR=$(ss_intervention_dir)
# Sniff current context
IFS=$'\t' read -r AUTO_FEATURE AUTO_TASK AUTO_BRANCH AUTO_COMMIT < <(ss_intervention_context)
FEATURE="${FEATURE_OVERRIDE:-$AUTO_FEATURE}"
TASK="${TASK_OVERRIDE:-$AUTO_TASK}"
# Interactive path: if NOTICED was not provided, signal to Claude to gather inputs
if [ -z "$NOTICED" ]; then
echo "🎙️ Interactive intervention capture"
echo ""
echo "Context detected:"
echo " feature: ${FEATURE:-(none)}"
echo " task: ${TASK:-(none)}"
echo " branch: ${AUTO_BRANCH:-(none)}"
echo " commit: ${AUTO_COMMIT:-(none)}"
echo ""
echo "Will write to: ${DIR}"
echo ""
echo "<<<INTERACTIVE>>>"
echo "Please now use AskUserQuestion to collect 4 fields from the user:"
echo " 1. 'What did you notice?' (the symptom)"
echo " 2. 'What check should have caught this?' (verification angle)"
echo " 3. 'How could automation prevent this next time?' (suggested fix)"
echo " 4. 'Status?' — options: open | graduated | wontfix"
echo "Then re-invoke /ss:intervention with all flags populated."
echo "<<<END>>>"
exit 10
fi
# Validate STATUS
case "$STATUS" in
open|graduated|wontfix) ;;
*) echo "❌ Invalid --status '${STATUS}' (use: open | graduated | wontfix)" >&2; exit 2 ;;
esac
# Fill missing fields with placeholders so the file is still useful
[ -z "$SHOULD" ] && SHOULD="(not specified — fill in when you know)"
[ -z "$PREVENT" ] && PREVENT="(not specified — fill in when you know)"
# Generate filename + write
FILENAME=$(ss_intervention_filename "$NOTICED")
TARGET=$(ss_intervention_write "$DIR" "$FILENAME" "$NOTICED" "$SHOULD" "$PREVENT" "$STATUS" "$FEATURE" "$TASK")
# Update MEMORY.md index if present
ss_intervention_index_update "$DIR" "$FILENAME" "$NOTICED" 2>/dev/null || true
# Confirmation
echo ""
echo "✅ Intervention captured"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "File: ${TARGET}"
echo "Feature: ${FEATURE:-(none)}"
echo "Task: ${TASK:-(none)}"
echo "Status: ${STATUS}"
echo ""
echo "Noticed: ${NOTICED}"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Fire a quiet info-level notification (cheap signal that capture succeeded)
if declare -f ss_notify >/dev/null 2>&1; then
ss_notify info "SpecSwarm intervention captured" "${NOTICED:0:80}" || true
fi
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.
- 2d ago First seen · 229 lines · 46 tokens per session scan A 2560990ca8d3
intervention is a command published in the GitHub repository MartyBonacci/specswarm (65 stars, last pushed 1mo ago), licensed MIT. It adds 46 tokens to every session and 2,262 once invoked, about $0.0002 per session on Opus 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.
Other commands, from other repositories
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
constitution
Create or update the project constitution from interactive or provided principle inputs.