Claude Code usage
Retok
Token-efficiency analyzer for AI coding agents (Claude Code, OpenAI Codex CLI): cost estimates, cache analysis, and savings advice. Zero dependencies.
Install
git clone https://github.com/d-date/retok.gitFrom the README
retok(return-of-token) English | 日本語 A CLI tool that analyzes your AI coding agent usage logs — Claude Code and OpenAI Codex CLI — to measure token efficiency, estimate cost, and print actionable recommendations. Runs on Python 3 with the standard library only — no dependencies. Installation Requires Python 3.7+. No dependencies. To run it from anywhere, symlink it into your PATH (the symlink is resolved, so translations in locales/ keep working): Alternatively, grab just the script — everything works, but the report falls back to English because locales/ is not present: Usage By default it scans Claude Code transcripts in ~/.claude/projects (plus $CLAUDE_CONFIG_DIR/projects when that environment variable is set) and Codex CLI rollouts in ~/.codex/sessions. If you keep transcripts elsewhere (multiple profiles, custom config dirs), pass every root with --dirs / --codex-dirs. Usage records are deduplicated globally, so overlapping roots are never double-counted. What it measures Recommendation rules - Cache TTL expiry — a large cache write (majority of the context) right after a gap longer than the write's TTL (1h/5m, detected from the usage buckets) means an expired prefix was re-cached from scratch. Suggests /compact / /clear - Oversized contexts — sessions exceeding 120k tokens, with at least 3 prompts in the session. Suggests /clear between tasks - Under-delegation — high Read/Grep/Glob share on the main thread with little subagent use - Retry loops — the same Bash command executed 5+ times within a session - Frequent interruptions — [Request interrupted by user] above 12% of prompts, only evaluated once the period has 30+ prompts. Suggests clearer prompts and Plan Mode - Premium models on tiny sessions — one-shot Q&A on Opus/Fable-class models, 10 or…
Details
- Repository
- d-date/retok
- Language
- Python
- License
- MIT
- Last updated
- 9 July 2026
- Topics
- ai-agentsanthropicclaudeclaude-codeclicodexcost-analysisi18nopenaipythontoken
FAQ
What is Retok?
Token-efficiency analyzer for AI coding agents (Claude Code, OpenAI Codex CLI): cost estimates, cache analysis, and savings advice. Zero dependencies. It is a usage for Claude Code, from d-date/retok on GitHub.
How do I install Retok?
Clone d-date/retok from GitHub and follow the setup steps in its README.
Is Retok popular?
d-date/retok has 33 GitHub stars and 0 forks. It was last updated on 9 July 2026.
More usage & cost trackers
Checkyouragent
26TarekAwwad/checkyouragent
An analytics tool to explore Claude code usage patterns, errors, and token costs
Claumon
17fabioconcina/claumon
Claude Code dashboard: see where your limits are headed before you hit them. Calibrated usage forecasts, live rate-limit gauges, session costs, memory browser. Single binary, zero config, plus a VS Code extension.
Battery
26allthingsclaude/battery
A macOS menu bar app that monitors your Claude Code API usage in real time.
Brow
29efim0v/brow
Claude Code usage limits in the MacBook notch, and workspaces for parallel sessions. Every Claude account's 5-hour and weekly limits and resets at a glance, git-worktree workspaces across several repositories (formerly Grove), and Glim, a small pet that eats your limits. macOS app.
Aireceipts
31anandgupta42/aireceipts
Your AI coding agent just billed you. Here's the receipt. Cost receipts for Claude Code, Codex, Cursor, Gemini & opencode — no account, no upload.
CC Budget
29boyand/cc-budget
Budget intelligence for Claude Code — pacing targets, per-prompt cost, peak/off-peak awareness, and threshold warnings.
Browse the most popular Claude Code mods, all usage & cost trackers, or the skills and MCP server directories.