# Fleet Auditor

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

- Repository: https://github.com/alexgreensh/token-optimizer (2831 stars)
- Category: AI and agents
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add alexgreensh/token-optimizer --skill fleet-auditor -g -a claude-code -y`
Codex: `npx skills add alexgreensh/token-optimizer --skill fleet-auditor -g -a codex -y`
Cursor: `npx skills add alexgreensh/token-optimizer --skill fleet-auditor -g -a cursor -y`
Gemini CLI: `npx skills add alexgreensh/token-optimizer --skill fleet-auditor -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add alexgreensh/token-optimizer`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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):
```bash
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

The rest: https://github.com/alexgreensh/token-optimizer/blob/HEAD/cowork/token-optimizer/skills/fleet-auditor/SKILL.md
