cost

cost is a command for Claude Code from avelikiy/great_cto. It costs 48 tokens per session (6,046 once invoked), scanned A, original, MIT.

A cost and capacity report for engineering work, covering model usage, infrastructure spending, deployments, budgets, and feature return on investment.

In plain words
What is it for?
Use it for overall cost health, a feature-level return analysis, or a cost-focused review of one agent.
Why use it?
It connects technical activity with spending so teams can spot cost increases, savings, and whether delivered features justify their resources.

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 for overall cost health, a feature-level return analysis, or a cost-focused review of one agent.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/avelikiy/great_cto/cost"><img src="https://agentmods.dev/badge/commands/avelikiy/great_cto/cost.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,046 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.00048 $0.06046
Opus 5 $0.00024 $0.03023
Sonnet 5 $0.00010 $0.01209
Haiku 4.5 $0.00005 $0.00605

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

Security

Grade A, and why

cost 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/cost.md · 504 lines

How it starts

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

You are the Cost & Capacity aggregator. Multiple modes:

  1. /cost [days] — Aggregate health (default mode)
    • LLM router savings — measured Kimi-vs-Sonnet differential from .great_cto/llm-router-usage.log
    • Infra cost — monthly run-rate, cost-per-deploy, WoW/MoM drift, headroom vs budget, top movers
  2. /cost feature <slug> — ROI per shipped feature (NEW in v2.3.0)
    • Total LLM cost broken down by agent
    • Comparison to human-equivalent at $150/hr
    • ROI multiplier
    • Cross-reference to similar past features in same archetype
  3. /cost agent <name> — Per-agent cost (NEW in v2.3.0)
    • Same as /agent-review <name> but cost-focused

Mode dispatch

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

# Detect mode from first arg
case "${1:-}" in
  feature)
    SLUG="${2:-}"
    [ -z "$SLUG" ] && { echo "Usage: /cost feature <slug>"; exit 2; }
    # → jump to "Feature mode" section below
    MODE=feature
    ;;
  agent)
    AGENT="${2:-}"
    [ -z "$AGENT" ] && { echo "Usage: /cost agent <name>"; exit 2; }
    # → jump to "Agent mode" section below
    MODE=agent
    ;;
  *)
    MODE=aggregate
    PERIOD=${1:-30}
    case "$PERIOD" in ''|*[!0-9]*) echo "Usage: /cost [period_days] | feature <slug> | agent <name>"; exit 2 ;; esac
    ;;
esac

COST_LOG=.great_cto/cost-history.log
DEPLOYS_LOG=.great_cto/deploys.log

Feature mode — /cost feature <slug>

Compute total cost of shipping a feature, broken down by agent + ROI vs human equivalent.

if [ "$MODE" = "feature" ]; then
  echo "## Cost: $SLUG"
  echo ""

  if [ ! -f "$COST_LOG" ]; then
    echo "_No cost history yet — feature ROI requires at least one shipped feature._"
    exit 0
  fi

  # Filter cost-history.log entries tagged with this feature slug
  # Format: <timestamp> agent=<name> feature=<slug> cost_usd=<n> [other tags]
  ENTRIES=$(grep -E "feature=$SLUG\b" "$COST_LOG" 2>/dev/null)

  if [ -z "$ENTRIES" ]; then
    echo "_No cost entries tagged with feature=$SLUG. Either:_"
    echo "1. Feature not yet implemented (run \`/start \"feature description\"\`)"
    echo "2. Feature uses different slug — check \`docs/architecture/ARCH-*.md\` filenames"
    echo ""
    echo "Available features in cost log:"
    grep -oE "feature=[^ ]+" "$COST_LOG" | sort -u | head -10
    exit 0
  fi

  # Aggregate by agent
  echo "### Per-agent breakdown"
  echo ""
  echo "| Agent | Invocations | Cost | Avg/inv |"
  echo "|-------|------------:|-----:|--------:|"
  echo "$ENTRIES" | awk '
    {
      for (i=1;i<=NF;i++) {
        if ($i ~ /^agent=/) { gsub(/agent=/, "", $i); agent = $i }
        if ($i ~ /^cost[-_]?usd[=:]/) { gsub(/cost[-_]?usd[=:]/, "", $i); cost = $i+0 }
      }
      sum[agent] += cost
      count[agent]++
    }
    END {
      for (a in sum) printf "| %s | %d | $%.2f | $%.2f |\n", a, count[a], sum[a], sum[a]/count[a]
    }
  ' | sort

  TOTAL=$(echo "$ENTRIES" | awk '
    { for (i=1;i<=NF;i++) if ($i ~ /^cost[-_]?usd[=:]/) { gsub(/cost[-_]?usd[=:]/, "", $i); sum += $i+0 } }
    END { printf "%.2f", sum }
  ')

  echo "| **Total** | | **\$$TOTAL** | |"
  echo ""

  # Human-equivalent comparison
  ARCHETYPE=$(grep -E "^archetype:|^primary:" .great_cto/PROJECT.md 2>/dev/null | head -1 | awk '{print $2}')
  # Default: assume 12 hours human equivalent for standard feature
  HUMAN_HOURS=${HUMAN_HOURS:-12}
  HUMAN_RATE=${HUMAN_RATE:-150}
  HUMAN_COST=$(echo "scale=0; $HUMAN_HOURS * $HUMAN_RATE" | bc)
  ROI=$(echo "scale=1; $HUMAN_COST / $TOTAL" | bc)

  echo "### vs Human equivalent"
  echo ""
  echo "- Estimated effort: ${HUMAN_HOURS}h × \$${HUMAN_RATE}/hr = **\$${HUMAN_COST}**"
  echo "- AI cost: **\$${TOTAL}**"
  echo "- **ROI: ${ROI}x**"
  echo ""
  echo "_Override estimates: \`HUMAN_HOURS=20 HUMAN_RATE=200 /cost feature $SLUG\`_"

  # Comparison to mean for archetype
  if [ -n "$ARCHETYPE" ]; then
    echo ""
    echo "### Compared to other features in archetype=$ARCHETYPE"
    grep "feature=" "$COST_LOG" | grep -v "feature=$SLUG" | awk '
      {
        for (i=1;i<=NF;i++) {
          if ($i ~ /^feature=/) { gsub(/feature=/, "", $i); feat = $i }
          if ($i ~ /^cost[-_]?usd[=:]/) { gsub(/cost[-_]?usd[=:]/, "", $i); cost = $i+0 }
        }
        sum[feat] += cost
      }
      END {
        for (f in sum) printf "- %s: $%.2f\n", f, sum[f]
      }
    ' | sort -t '$' -k2 -n | head -5
  fi
  exit 0
fi

Read the full file on GitHub · 504 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 · 504 lines · 48 tokens per session scan A e1fd32a62133

Subscribe to this mod's changes

cost is a command published in the GitHub repository avelikiy/great_cto (89 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 6,046 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.