intervention

intervention is a command for Claude Code from MartyBonacci/specswarm. It costs 46 tokens per session (2,262 once invoked), scanned A, original, MIT.

A command for recording a moment when project automation missed something important.

In plain words
What is it for?
Use it to capture what you noticed, what should have caught it, how to prevent it next time, and whether the issue remains open.
Why use it?
It turns individual observations into a lasting record that can reveal repeated problems and guide future checks or automation.

Command for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the ss plugin — 10 skills, 34 commands, 6 agents, 4 hooks shipped together

Good fit Use it to capture what you noticed, what should have caught it, how to prevent it next time, and whether the issue remains open.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/martybonacci/specswarm/intervention
Install

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.

Clone the repo
git clone --depth 1 https://github.com/MartyBonacci/specswarm

Made for: Claude Code.

Or install ss, the plugin that ships this one along with the rest of its 10 skills, 34 commands, 6 agents, 4 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 intervention

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/martybonacci/specswarm/intervention"><img src="https://agentmods.dev/badge/commands/martybonacci/specswarm/intervention.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 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,262 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.00046 $0.02262
Opus 5.5 $0.00018 $0.00905
Sonnet 5.5 $0.00009 $0.00452
Haiku 4.5 $0.00005 $0.00226

Measured 1mo ago against content hash 2560990ca8d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

plugins/ss/commands/intervention.md · 229 lines

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:

  1. What I noticed — the symptom you caught
  2. What should have caught this — the verification angle
  3. How automation could prevent it next time — a suggested fix or check
  4. 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

Read the full file on GitHub · 229 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. 1mo ago First seen · 229 lines · 46 tokens per session scan A 2560990ca8d3

Subscribe to this mod's changes

intervention is a command published in the GitHub repository MartyBonacci/specswarm (66 stars, last pushed 2mo ago), licensed MIT. It adds 46 tokens to every session and 2,262 once invoked, about $0.0002 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.