Borrowing it
Nothing to install: this file belongs to girishr/SpecPilot. 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/girishr/SpecPilot/main/.claude/commands/specpilot-archive.mdgit clone --depth 1 https://github.com/girishr/SpecPilotWrote 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/girishr/specpilot/specpilot-archive)<a href="https://agentmods.dev/commands/girishr/specpilot/specpilot-archive"><img src="https://agentmods.dev/badge/commands/girishr/specpilot/specpilot-archive.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.00021 | $0.01291 |
| Opus 5 | $0.00010 | $0.00646 |
| Sonnet 5 | $0.00004 | $0.00258 |
| Haiku 4.5 | $0.00002 | $0.00129 |
Grade A, and why
specpilot-archive 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 8d 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 — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Archive oversized .specs/ files: .specs/planning/tasks.md's ## Completed section beyond 25 lines, and .specs/development/prompts.md beyond 100 total lines.
Run the script below — it computes thresholds and moves lines deterministically. Do not hand-count lines or decide what to move yourself; the script's arithmetic is the source of truth.
cd "$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
PROMPTS_LINE_LIMIT=100
PROMPTS_KEEP_LINES=80
COMPLETED_LINE_LIMIT=25
COMPLETED_KEEP_ENTRIES=20
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
if [ -n "$branch" ] && [ "$branch" != "main" ] && [ "$branch" != "master" ]; then
echo "WARNING: on branch '$branch'. Archive is recommended only on the default branch after merging."
read -p "Continue? [y/N] " confirm
if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then
echo "Archive cancelled."
exit 0
fi
fi
timestamp() { date -u +"%Y-%m-%d %H:%M:%S"; }
archive_prompts() {
local file=".specs/development/prompts.md"
local archive=".specs/development/prompts-archive.md"
[ -f "$file" ] || return 0
local total
total=$(wc -l < "$file")
if [ "$total" -le "$PROMPTS_LINE_LIMIT" ]; then return 0; fi
# Anchor on "## Latest Entries" so boilerplate (Re-Anchor Prompt, etc.) is never
# mistaken for archivable log content; fall back to front-matter close, then line 0.
local anchor_line
anchor_line=$(grep -n '^## Latest Entries' "$file" | head -1 | cut -d: -f1)
if [ -z "$anchor_line" ]; then
if [ "$(sed -n '1p' "$file")" = "---" ]; then
anchor_line=$(awk 'NR>1 && $0=="---" {print NR; exit}' "$file")
else
anchor_line=0
fi
fi
local body_start=$((anchor_line + 1))
local body_lines=$((total - anchor_line))
local keep=$((PROMPTS_KEEP_LINES - anchor_line))
if [ "$keep" -lt 50 ]; then keep=50; fi
if [ "$body_lines" -le "$keep" ]; then return 0; fi
local archive_count=$((body_lines - keep))
local archive_end=$((body_start + archive_count - 1))
{ echo "## Archived on $(timestamp)"; echo; sed -n "${body_start},${archive_end}p" "$file"; echo; echo "---"; echo; } >> "$archive"
{ sed -n "1,${anchor_line}p" "$file"; sed -n "$((archive_end + 1)),\$p" "$file"; } > "$file.tmp"
mv "$file.tmp" "$file"
echo "Moved $archive_count lines from $file -> $archive"
}
archive_tasks() {
local file=".specs/planning/tasks.md"
local archive=".specs/planning/tasks-archive.md"
[ -f "$file" ] || return 0
local total
total=$(wc -l < "$file")
local completed_line
completed_line=$(grep -n '^## Completed$' "$file" | head -1 | cut -d: -f1)
[ -n "$completed_line" ] || return 0
local section_size=$((total - completed_line + 1))
if [ "$section_size" -le "$COMPLETED_LINE_LIMIT" ]; then return 0; fi
local entry_start=$((completed_line + 1))
while [ "$entry_start" -le "$total" ] && ! sed -n "${entry_start}p" "$file" | grep -qE '^[0-9]+\.'; do
entry_start=$((entry_start + 1))
done
if [ "$entry_start" -gt "$total" ]; then return 0; fi
local entry_count=$((total - entry_start + 1))
if [ "$entry_count" -le "$COMPLETED_KEEP_ENTRIES" ]; then return 0; fi
local archive_count=$((entry_count - COMPLETED_KEEP_ENTRIES))
local archive_end=$((entry_start + archive_count - 1))
{ echo "## Archived on $(timestamp)"; echo; sed -n "${entry_start},${archive_end}p" "$file"; echo; echo "---"; echo; } >> "$archive"
{ sed -n "1,$((entry_start - 1))p" "$file"; sed -n "$((archive_end + 1)),\$p" "$file"; } > "$file.tmp"
mv "$file.tmp" "$file"
echo "Moved $archive_count entries from $file -> $archive"
}
archive_prompts
archive_tasks
After running it:
- Report what the script moved (file, line/entry count, archive destination) using its own output — do not recompute or second-guess the numbers.
- If nothing exceeded the threshold, say so plainly: "Nothing to archive."
- IDs are preserved automatically since content is moved verbatim into the archive file, never rewritten or renumbered.
This mirrors CLI specpilot archive --dry-run --force (REQ-002.A.8); the branch guard mirrors ARCH-004.19 (warns and requires y confirmation when not on main/master).
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.
- 8d ago First seen · 104 lines · 21 tokens per session scan A 3f3e121a9da5
specpilot-archive is a command published in the GitHub repository girishr/SpecPilot (37 stars, last pushed 1mo ago), licensed MIT. It adds 21 tokens to every session and 1,291 once invoked, about $0.0001 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
ensemble:generate-router-rules
Generate router rules by introspecting installed agents and skills.
merit-reconcile
Preview or check the status of Stripe → Merit payout reconciliation (read-only).
merit-customers
Find or create a Merit Aktiva customer (or vendor).
CLAUDE
Command "CLAUDE" from Calhooon/bsv-wallet-cli, covering commands, files, decisions, gotchas and related.
modernize-assess
Full discovery & portfolio analysis of a legacy system — inventory, complexity, debt, effort estimation.
checklist
Generate a custom checklist for the current feature based on user requirements.