execute-parallel-cleanup

A command that stops running parallel development sessions and archives their session files. Parallel sessions are separate work processes running at the same time.

In plain words
What is it for?
Use it to list sessions, confirm which running ones to stop, and move completed or stopped records into an archive.
Why use it?
It helps remove unfinished or completed sessions that are still taking up workspace resources or cluttering the session records.

Command

Part of the ai-sdlc plugin — 1 skill, 16 commands, 9 agents shipped together

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.

agentmods
npx agentmods add commands/ai-sdlc-framework/ai-sdlc/execute-parallel-cleanup
Clone the repo
git clone --depth 1 https://github.com/ai-sdlc-framework/ai-sdlc

Or install ai-sdlc, the plugin that ships this one along with the rest of its 1 skill, 16 commands, 9 agents.

Per session 53 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,982 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00053 $0.01982
Opus 5 $0.00026 $0.00991
Sonnet 5 $0.00011 $0.00396
Haiku 4.5 $0.00005 $0.00198

Measured 3d ago against content hash 12f9cfbb66ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

execute-parallel-cleanup scanned grade A with 1 finding 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 3d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

const { execFileSync } = require('child_process');
ai-sdlc-plugin/commands/execute-parallel-cleanup.md · 202 lines

How it starts

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

Kill in-flight /ai-sdlc execute-parallel panes and archive their session files (AISDLC-462).

Hard rules

  1. AskUserQuestion before kill. Always list what will be killed and ask for confirmation.
  2. Never merge PRs. Never close PRs or issues.
  3. If a session is already done/failed, archive it without killing (no tmux window to kill).

Arguments

  • No arguments: list and clean up ALL sessions (done, failed, and optionally in-progress).
  • --all: same as no arguments.
  • AISDLC-N,AISDLC-M,...: target specific task IDs only.
ARG="${ARGUMENTS:-}"
BOARD_DIR=".ai-sdlc/dispatch"
SESSIONS_DIR="$BOARD_DIR/sessions"
ARCHIVE_DIR="$SESSIONS_DIR/archived"
TMUX_SESSION="ai-sdlc-parallel"

# Parse target tasks
EXPLICIT_TASKS=""
if [ -n "$ARG" ] && [ "$ARG" != "--all" ]; then
  EXPLICIT_TASKS=$(printf '%s' "$ARG" | tr -d ' ')
fi

if [ ! -d "$SESSIONS_DIR" ]; then
  echo "No sessions directory at $SESSIONS_DIR. Nothing to clean up."
  exit 0
fi

mkdir -p "$ARCHIVE_DIR"

Step 1 — List sessions to clean up

# Collect candidate session files
CANDIDATES_JSON=$(node -e "
  const fs = require('fs');
  const path = require('path');
  const sessionsDir = process.argv[1];
  const explicitTasks = process.argv[2] ? process.argv[2].split(',').map(t => t.trim().toUpperCase()) : [];

  const sessions = [];
  try {
    const files = fs.readdirSync(sessionsDir).filter(f => f.endsWith('.session.json'));
    for (const f of files) {
      try {
        const s = JSON.parse(fs.readFileSync(path.join(sessionsDir, f), 'utf8'));
        if (explicitTasks.length === 0 || explicitTasks.includes((s.taskId || '').toUpperCase())) {
          sessions.push(s);
        }
      } catch {}
    }
  } catch {}

  process.stdout.write(JSON.stringify(sessions));
" "$SESSIONS_DIR" "$EXPLICIT_TASKS" 2>/dev/null || echo '[]')

Step 2 — Present the list and ask for confirmation (AskUserQuestion)

List all candidate sessions with their status and ask the operator to confirm before killing any in-progress sessions.

Read the full file on GitHub · 202 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. 3d ago First seen · 202 lines · 53 tokens per session scan A 12f9cfbb66ac

Subscribe to this mod's changes

execute-parallel-cleanup is a command published in the GitHub repository ai-sdlc-framework/ai-sdlc (92 stars, last pushed 9d ago), licensed Apache-2.0. It adds 53 tokens to every session and 1,982 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.