Retok — AI skill for Claude Code
Token-efficiency analyzer for AI coding agents (Claude Code, OpenAI Codex CLI): cost estimates, cache analysis, and savings advice.
How to install Retok
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open d-date/retok and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Retok does
Token-efficiency analyzer for AI coding agents (Claude Code, OpenAI Codex CLI): cost estimates, cache analysis, and savings advice. Zero dependencies.
Alternatives in AI
- Single File Wbs — 単一HTMLで動く WBS/ガント+イナズマ線ビューア 123 ★
- Next Slide — 你的下个 slide,何必是 PPT — AI-powered HTML presentations 50 ★
- Harness Lint — Run the quality lint (advice rules + system-level analysis) on the agent setup; add --all for every one of the 32 ★
README
retok(return-of-token)

**English** | [日本語](README.ja.md)
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.
══════════════════════════════════════════════════════════════════════════
retok — Token Efficiency Report (last 30 days / 472 files)
══════════════════════════════════════════════════════════════════════════
■ Overview
Estimated cost $2,119.66
Claude Code / Codex $2,091.00 / $28.66
Cache hit rate 89.4%
Cost per prompt $1.593
...
■ Recommendations
! Re-caching after cache TTL expiry: ~135.0M tokens ($873.49)
Returning to a session left idle beyond the cache TTL (usually 1
hour) re-caches the entire context at twice the input rate. ...
Installation
Requires Python 3.7+. No dependencies.
git clone https://github.com/d-date/retok.git
cd retok
./retok
To run it from anywhere, symlink it into your `PATH` (the symlink is resolved, so translations in `locales/` keep working):
ln -s "$(pwd)/retok" ~/.local/bin/retok # or /usr/local/bin/retok
retok
Alternatively, grab just the script — everything works, but the report falls back to English because `locales/` is not present:
curl -fsSLo ~/.local/bin/retok https://raw.githubusercontent.com/d-date/retok/main/retok
chmod +x ~/.local/bin/retok
Usage
./retok # report for the last 30 days
./retok --days 7 # change the window
./retok --project myapp # filter by project name (substring)
./retok --provider codex # only one provider (claude | codex)
./retok --lang en # report language (default: $LANG)
./retok --json # JSON output for other tools
./retok --top 20 # rows in ranking tables
Related Skills
Token Saver
Zero-cost token optimization engine for AI coding assistants (Claude Code, Cursor, Antigravity, Windsurf). Sav
TokenJar
Zero-cost token optimization engine for AI coding assistants (Claude Code, Cursor, Antigravity, Windsurf). Sav
Token Autopsy
Token autopsy for agent fleets: ingest Claude Code / Codex / Cursor transcripts, emit per-behavior cost report
Tokenmonitor
See what your AI coding tools actually use and cost — token usage & estimated spend for Claude Code, Codex CLI
Burn O Meter
See what your AI coding agents really cost — tokens, spend, cache efficiency and rate limits. Works with Claud
Kickllm.Com
LLM API Cost Calculator -- compare pricing for Claude, GPT-4, Gemini, Llama, and Mistral. Monthly cost estimat
Related Agents
Grok Agent 01
ONLY job: find free or freemium AI token/API plans (OpenAI-compatible, Anthropic, Google, open routers, studen
Context Cost Analyzer
Launched by /aidex:aidex context; not for direct use. Returns a priority-ordered list of token savings.
AI Cost Optimizer
Audits an LLM application or AI agent for token cost and rate-limit risk, using its usage logs and code, and r