- Home
- Skills
- Testing & Debugging
- tokenfat — AI Coding Token Waste Autopsy & Active Cure
More screenshots
Works with the AI Agents you already use
tokenfat — AI Coding Token Waste Autopsy & Active Cure
by yihong chen
100% local forensic token waste autopsy, Token Nutrition Facts scorecard & live PreToolUse auto-diet for Claude Code, Codex, Gemini CLI & Cursor.
Free
What it does
- Scans local coding logs to find where AI tokens are being wasted
- Identifies huge sessions that re-read too much data every time you speak
- Spots tool outputs like test results that are bloating your chat history
- Flags saved secrets or passwords found in your local settings files
- Generates a shareable card or web report showing your usage facts
- Offers a reversible fix to help your agent use fewer tokens automatically
Who it's for
Founders using AI for coding teams
See exactly where your money goes when your team uses AI coding tools.
Try asking: “Run a token audit for the last 30 days and show me why our costs are high.”
Freelance developers on a budget
Stop burning cash on long AI sessions that repeat the same data over and over.
Try asking: “Check my local logs for token waste and give me a plan to fix it.”
Privacy-conscious developers
Audit your local AI history for hidden costs without ever sending data to the cloud.
Try asking: “Scan my agent logs for wasted tokens and redact all prompt text from the report.”
tokenfat — AI Coding Token Waste Autopsy & Active Cure
Example session with this skill installed
I've been spending too much on AI coding lately. Can you check my logs for the last 30 days, find the waste, and show me a report? Redact my code for privacy.
- Read your context and instructions
- Compiled the tokenfat
- Generated the document
I will run a forensic audit of your local AI logs from the last 30 days. I will make sure all your private code and prompt text are masked so the report is safe to share.
Audit Results
- Elephant Sessions: I found 4 sessions over 180,000 tokens. In these chats, your agent is re-reading massive amounts of code for every small reply, which is your biggest cost.
- Cache Misses: You have several instances where a long break followed by a short message like "ok" triggered a full, expensive re-read of your project.
- Tool Bloat: Large outputs from
npm testandgit diffare being carried forward in your history, adding unnecessary weight to every message.
Security Check
I detected plaintext secrets in your local settings file. I recommend moving these to environment variables.
Token Nutrition Facts
| Category | Usage |
|---|---|
| Total Tokens | 1.2M |
| Wasted Bloat | 450K |
| Efficiency | 62% |
I have generated a masked report at tokenfat-report.html. Would you like me to show you the cure plan to help prevent this waste in the future?
tokenfat-report.html
PDF · document
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Diagnose AND actively cure AI coding token waste in one command — 100% local, zero network, $0 LLM cost.
What this skill does:
- Runs local forensic waste autopsies across Claude Code, Antigravity, Codex, Gemini CLI, OpenCode & Cursor (
npx -y tokenfat). - Exposes Elephant Sessions (>180K Context Rot), Cache Miss penalties ("Most Expensive Single Message"), Tool Output Compounding Bombs, and 0-call Zombie MCPs/Skills.
- Exports shareable high-DPI "Token Nutrition Facts" PNG cards (
--card) and offline interactive HTML reports (--html). - Previews and installs a 100% reversible Active Cure Suite (
--cure): real-time Elephant Session & Cache-Miss Guard Hooks, live PreToolUse shell output auto-diet trimmer (preserves exact exit codes & saves raw logs to /tmp), and painless 35-line/handoffresets.
Open-source MIT project: tokenfat (GitHub: yihongchen772-alt/tokenfat · npm: tokenfat).
This skill only analyzes local logs on your disk and does not check cloud-only history.
This skill runs the tokenfat CLI tool locally to parse logs from Claude Code, Cursor, Gemini CLI, and others. It uses deterministic local analysis (no LLM calls for the audit itself) and supports redacting prompt snippets via regex. It can generate PNG cards and interactive HTML reports. The 'cure' function modifies local agent rules or hooks to manage context windows, which can be reverted using the uncure command.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 2 days ago
- Free with an Agensi account
- Software
- tokenfat
Node.js
Git
Permissions
Runs 100% locally via npx -y tokenfat reading local agent session logs on disk. Active Cure (--cure) optionally writes reversible hook/rule files and is fully undoable via --uncure. Zero network uploads or telemetry.
What's inside
Frequently Asked Questions
New in Testing & Debugging
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.