Contextdiet — AI skill for Claude Code
Analyze what eats your AI agent's context window — token breakdown, trim suggestions, local-first.
How to install Contextdiet
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open devilking7x/contextdiet and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Contextdiet does
Analyze what eats your AI agent's context window — token breakdown, trim suggestions, local-first.
Alternatives in AI
- Token Monitor — Local-first desktop widget for tracking token usage, costs, and limits across 32+ AI coding tools—including Cl 1.8k ★
- Paritok 4b V1 — Non-destructive compression gateway for AI coding agents 1.4k ★
- TokenTracker — Local-first AI token usage & cost tracker for 31 coding tools incl 1.4k ★
README

ContextDiet 🥗
[](LICENSE) [](https://devilking7x.github.io/contextdiet/) [](#)
**Analyze what eats your AI agent's context window.** Drop in your `CLAUDE.md`, skill files and `.mcp.json` — get real token counts, a per-file breakdown, actionable trim suggestions, and a before/after savings simulator.
🔴 **Live demo:** https://devilking7x.github.io/contextdiet/
✨ Features
- Real token counting — uses `gpt-tokenizer` (browser-compatible BPE) right in your browser. No estimates, no
chars ÷ 4hacks. - Drag & drop — drop
CLAUDE.md,SKILL.md,.mcp.json(or any text/markdown/JSON) and get instant analysis. - Per-file breakdown — ranked table + bar chart, largest offenders first, with kind badges, share-of-total, and inline previews.
- Context window gauge — visualizes your % of the window with the "keep under 20%" rule marked. Configurable window size (50k / 100k / 200k / 1M / custom).
- Trim suggestions — actionable, impact-ordered advice ("this file is 21k tokens — consider splitting into skills"), including cross-file boilerplate deduplication and JSON minification.
- Before/after simulator — exclude files and toggle suggestions to see projected token savings before you change a single line.
- One-click sample bundle — a chunky
CLAUDE.md, two skills and an.mcp.jsonso the demo works instantly. - 100% local-first — no backend, no uploads, no tracking. Your files never leave the browser. State persists in
localStorage.
🚀 How to use
- Open the live demo.
- Either drag & drop your files, or click "Try the sample bundle".
- Check the **gauge
Related Skills
Recall Cost
Estimate Anthropic cost from total-recall's index — per-model token breakdown over a window.
VLS 32M Context Local LLM
Give Claude Code, Codex and opencode a 32M-token memory that never leaves your machine. Local LLM server (MCP
Toknt
Tokens? Tokn't. Local-first token optimization for AI coding agents (Cursor, Claude Code, Codex). Cut redundan
Code Context Engine
Local-first MCP context engine for AI coding agents — cuts token cost ~90% via a per-project code graph + code
Token Counter
Counts tokens in documentation to ensure compliance with AI context window limits. Reports token counts per pa
Rustygrep
Fast grep with token-compressed, AI-native output for LLM coding agents. --llm cuts context-window tokens 60-9
Related Agents
Context Auditor
Use proactively when the user wants to cut Claude Code token cost or asks "why is this session so expensive /
Context Master
Use when context exceeds ~85% of the window, or during WF closeout to extract durable knowledge before compres
Tp Session Restorer
PROACTIVELY use this as the FIRST step after /clear, compaction, or a fresh window when a recent session_snaps