Skills

Fleet Auditor

Audits token waste and cost across Claude Code, Codex, OpenClaw, Hermes and OpenCode...

Install

npx skills add alexgreensh/token-optimizer --skill fleet-auditor -g -a claude-code -y
Category
AI and agents
Updated
3d ago
License
See repository
Context cost
Mediumabout 1,582 tokens
Runs scripts
Yes, review before use

What it does

Audits token waste and cost across Claude Code, Codex, OpenClaw, Hermes and OpenCode, with dollar savings. Use when running several agent systems or suspecting idle heartbeats burn tokens.

Fleet Auditor: Cross-Platform Agent Token Waste Auditor

Token Optimizer's own skills (token-optimizer, token-coach, token-dashboard, fleet-auditor) are the measurement layer, so leave them out of every removal, archive, trimming, disabling or consolidation suggestion; deleting them to save a few hundred tokens defeats the audit.

Detects installed agent systems, collects token usage data, identifies waste patterns, and recommends fixes with dollar savings estimates.

Use when running multiple agent systems, spending $2-5/day on agents, suspecting idle heartbeats are burning tokens, or wanting a cross-system cost audit.


Phase 0: Initialize

  1. Resolve runtime and fleet.py path (works for both skill and plugin installs):
RUNTIME="${TOKEN_OPTIMIZER_RUNTIME:-}"
if [ -z "$RUNTIME" ]; then
  if [ -n "$CLAUDE_PLUGIN_ROOT" ] || [ -n "$CLAUDE_PLUGIN_DATA" ]; then RUNTIME="claude"
  elif [ -n "$OPENCODE" ] || [ -n "$OPENCODE_BIN" ] || [ -n "$OPENCODE_CONFIG_DIR" ] || [ -n "$OPENCODE_CONFIG" ]; then RUNTIME="opencode"
  elif [ -n "$CODEX_HOME" ]; then RUNTIME="codex"
  # Another harness's config-dir env: same tier as Python's detect_runtime().
  elif [ -n "$HERMES_HOME" ]; then RUNTIME="hermes"
  elif [ -n "$COPILOT_HOME" ] || [ -n "$TOKEN_OPTIMIZER_COPILOT_HOME" ]; then RUNTIME="copilot"
  elif [ -n "$TOKEN_OPTIMIZER_CURSOR_HOME" ]; then RUNTIME="cursor"
  elif [ -n "$TOKEN_OPTIMIZER_ANTIGRAVITY_HOME" ]; then RUNTIME="antigravity"
  elif [ -n "$GROK_HOME" ] || [ -n "$TOKEN_OPTIMIZER_GROK_HOME" ]; then RUNTIME="grok"
  elif [ -n "$CLAUDECODE" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ] || [ -n "$CLAUDE_CODE_SESSION_ID" ]; then RUNTIME="claude"
  elif [ -d "$HOME/.config/opencode" ] && [ ! -d "$HOME/.codex" ]; then RUNTIME="opencode"
  elif [ -d "$HOME/.codex" ]; then RUNTIME="codex"
  else RUNTIME="claude"
  fi
fi
Read the whole SKILL.md on GitHub

More in AI and agents