devilking7x

Contextdiet — AI skill for Claude Code

AI community

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 — put your agent's context on a diet](og-image.webp)

ContextDiet 🥗

[![MIT License](https://img.shields.io/badge/license-MIT-violet.svg)](LICENSE) [![Live Demo](https://img.shields.io/badge/demo-live-8b5cf6.svg)](https://devilking7x.github.io/contextdiet/) [![Local-first](https://img.shields.io/badge/local--first-100%25-emerald.svg)](#)

**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 ÷ 4 hacks.
  • 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.json so 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

  1. Open the live demo.
  2. Either drag & drop your files, or click "Try the sample bundle".
  3. Check the **gauge