token-max
A Rust CLI that replays Claude Code and Codex transcripts at API prices and recommends cheaper agent settings.
At a Glance
MIT-licensed CLI (Rust) that replays Claude Code and Codex transcripts at API prices and recommends cheaper settings.
Engagement
Available On
Listed Nov 2026
About token-max
token-max is an open-source Rust command-line tool by kixelated that replays a host's Claude Code and Codex transcripts at public API prices and recommends cheaper settings. Transcripts and settings stay read-only, and no prompt, reply, summary, tool argument or tool output text is kept in the result. Its figures are API-price equivalents, not a subscription bill.
What It Is
A local cost-analysis CLI for people running coding agents. It discovers Claude Code, Codex and T3 Code histories, prices each request using the models.dev catalog, and reports which settings and features to change, keep, or treat as lacking evidence. It never edits settings; it prints a snippet for settings.json or config.toml to merge by hand.
What It Checks
The checks cover:
- Claude cache TTL.
- Compaction window.
- Native Claude idle compaction and T3 idle compaction.
- Fast mode versus standard speed.
- Background generation features such as prompt suggestions and recaps.
- Bash timeout cap.
- Keepalive pings.
It also prices per-request context pieces such as tools, MCP servers and skills, and recommends turning one off when its cost per use exceeds a configurable threshold (default $1). Instruction-file size notes compare CLAUDE.md and AGENTS.md against guidance limits.
Running It and Reading Output
Install with cargo from GitHub, then run token-max with options such as --since, --offline, --details, --json or --json-full. Reports show dollar amounts per 30 days. Exit code 0 means no applicable change, 1 means a recommended change, and 2 means failure. --ssh HOST audits other Linux or macOS machines that have the same version installed, with each host reported separately.
Evidence and Limits
The tool states that comparisons use only requests priced under both options, leave out requests with missing usage, and do not model lost detail or changed work. Independent check savings must not be summed.
Community Discussions
Be the first to start a conversation about token-max
Share your experience with token-max, ask questions, or help others learn from your insights.
Pricing
Open Source
MIT-licensed CLI (Rust) that replays Claude Code and Codex transcripts at API prices and recommends cheaper settings.
- MIT License
- Install via cargo from GitHub
- Reads transcripts and settings read-only
- Fetches prices from models.dev; offline mode available
Capabilities
Key Features
- Replays Claude Code and Codex transcripts at public API prices
- Recommends cache TTL and compaction-window settings
- Idle compaction analysis for Claude and T3
- Per-tool, MCP server and skill context cost reporting
- Fast mode, background generation and Bash timeout cap checks
- Keepalive ping pricing
- Audit remote hosts over SSH
- Text, --json and --json-full output
- Read-only; no prompt or reply text retained
- Offline mode with cached models.dev prices
