agent-retire

agent-retire is a command for Claude Code from avelikiy/great_cto. It costs 33 tokens per session (2,327 once invoked), scanned A, original, MIT.

A retirement workflow for an AI agent that removes it from active use while preserving its prompt, decisions, verdicts, and history. The process can be reversed later.

In plain words
What is it for?
Use it to archive an agent, remove it from synchronization lists, record the decision, and restore it if needed.
Why use it?
It prevents an unused, replaced, or misbehaving agent from being selected while keeping the evidence needed for audits and future review.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; positional $N argument.

Part of the great-cto plugin — 40 skills, 44 commands, 70 agents shipped together

Good fit Use it to archive an agent, remove it from synchronization lists, record the decision, and restore it if needed.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/avelikiy/great_cto/agent-retire
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/avelikiy/great_cto

Made for: Claude Code.

Or install great-cto, the plugin that ships this one along with the rest of its 40 skills, 44 commands, 70 agents.

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 agent-retire

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/avelikiy/great_cto/agent-retire"><img src="https://agentmods.dev/badge/commands/avelikiy/great_cto/agent-retire.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 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,327 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.00033 $0.02327
Opus 5 $0.00016 $0.01163
Sonnet 5 $0.00007 $0.00465
Haiku 4.5 $0.00003 $0.00233

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

Security

Grade A, and why

agent-retire 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 6d 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.

commands/agent-retire.md · 234 lines

How it starts

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

You are the Agent Retire command — graceful deprecation flow for AI workforce. Removes an agent from active rotation while preserving audit trail and reversibility.

When to use

  • Agent has had 0 invocations in last 90 days (use /agent-review --idle to find candidates)
  • Agent's archetype is no longer in your active project mix
  • Agent's prompt is being superseded by a better one (consolidation)
  • Agent has been flagged as misbehaving in multiple verdicts

What gets retired

  1. Agent prompt fileagents/<name>.mdagents/_retired/<name>.md
  2. SessionStart sync list<name> removed from plugin.json
  3. Decisions log — entry added to ~/.great_cto/decisions.md
  4. Verdicts~/.great_cto/verdicts/<name>.log preserved (audit trail; never deleted)
  5. Lessons referencing the agent — left untouched (historical record)

What's reversible

To un-retire: mv agents/_retired/<name>.md agents/<name>.md + add back to sync list. All prior verdicts/lessons resume.

Step 1 — Parse args + validate

source .great_cto/env.sh 2>/dev/null || export PATH="/opt/homebrew/bin:$HOME/.local/bin:/usr/local/bin:$PATH"

ARCHIVE_ONLY=0
REASON=""
AGENT_NAME=""
LIST_CANDIDATES=0

# Parse args
while [ $# -gt 0 ]; do
  case "$1" in
    --archive-only)   ARCHIVE_ONLY=1; shift ;;
    --list-candidates) LIST_CANDIDATES=1; shift ;;
    --reason)         REASON="$2"; shift 2 ;;
    --reason=*)       REASON="${1#*=}"; shift ;;
    *)                AGENT_NAME="$1"; shift ;;
  esac
done

# --list-candidates mode
if [ "$LIST_CANDIDATES" = "1" ]; then
  echo "## Retire candidates — agents with 0 invocations in last 90 days"
  echo ""
  SINCE_TS=$(date -u -v -90d +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || \
             date -u -d "90 days ago" +%Y-%m-%dT%H:%M:%SZ 2>/dev/null)
  VERDICTS_DIR=~/.great_cto/verdicts
  [ -d "$VERDICTS_DIR" ] || VERDICTS_DIR=.great_cto/verdicts

  for log in "$VERDICTS_DIR"/*.log; do
    [ -f "$log" ] || continue
    AGENT=$(basename "$log" .log)
    RECENT_COUNT=$(awk -v ts="$SINCE_TS" '$1 > ts' "$log" | wc -l | tr -d ' ')
    if [ "$RECENT_COUNT" = "0" ]; then
      LAST=$(tail -1 "$log" 2>/dev/null | awk '{print $1}')
      echo "- \`$AGENT\` — last seen $LAST"
    fi
  done

  echo ""
  echo "_To retire: \`/agent-retire <name>\`. Files preserved in \`agents/_retired/\` for un-retire later._"
  exit 0
fi

# Validate agent name
if [ -z "$AGENT_NAME" ]; then
  echo "Usage: /agent-retire <agent-name> [--archive-only] [--reason 'text']"
  echo "       /agent-retire --list-candidates"
  exit 2
fi

AGENT_FILE="agents/$AGENT_NAME.md"
if [ ! -f "$AGENT_FILE" ]; then
  echo "No such agent file: $AGENT_FILE"
  echo ""
  echo "Available agents (active):"
  ls agents/*.md 2>/dev/null | sed 's|agents/||; s|\.md||' | head -40
  exit 1
fi

Read the full file on GitHub · 234 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. 6d ago First seen · 234 lines · 33 tokens per session scan A fd620d868322

Subscribe to this mod's changes

agent-retire is a command published in the GitHub repository avelikiy/great_cto (92 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 2,327 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-09-03.