
Token Coach
Coaches a token-efficient Claude Code or Codex setup from the user's own usage data.
Install
npx skills add alexgreensh/token-optimizer --skill token-coach -g -a claude-code -y- Repository
- alexgreensh/token-optimizer2.8k
- Category
- AI and agents
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 2,587 tokens
- Runs scripts
- No, instructions only
What it does
Coaches a token-efficient Claude Code or Codex setup from the user's own usage data. Use when planning a build, fixing a slow or costly setup, or deciding which workflow steps need a model.
Token Coach
A coaching conversation about where the user's tokens go and what to change, grounded in numbers measured on their machine. The deliverable is a short, prioritised action plan the user agrees with. For a full audit that edits their setup, hand over to token-optimizer.
Token Optimizer's own skills (token-optimizer, token-coach, token-dashboard, fleet-auditor, resume-checkpoint) are the measurement layer, so leave them out of every unused-skill, archive or consolidation suggestion, however rarely they run.
1. Collect the data
Run exactly this first. It finds the newest installed copy, so a stale plugin cache never answers:
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"
# Explicit config-dir env of another harness: same tier as Python's
# detect_runtime() (above CLAUDECODE, which every Claude Code child inherits).
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

