{"slug": "i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet", "title": "I Turned My 1,587-Skill Context Audit Into a Zero-Dependency CLI (mcp-diet)", "summary": "A developer released mcp-diet, a zero-dependency Node.js CLI (v0.1.0, MIT) that audits session-start context across Claude Code, Gemini/Antigravity, and Codex CLI setups. The tool parses SKILL.md frontmatter, MCP server configs (including an inline TOML parser for Codex), and always-loaded rules files to estimate token cost against configurable caps, and flags executable scripts inside skills. On the author's machine it measured roughly 28,838 tokens of session-start context and caught two global rule files exceeding the 15 KB threshold after 1,521 unused skills were archived and four idle MCP servers disabled.", "body_md": "Two days ago I shared what happened when I inspected the startup context across my Claude Code, Antigravity/Gemini, and Codex CLI setups: 1,587 installed skills (~53,585 frontmatter tokens if loaded), 55 KB of global instruction files, and 3 browser MCP servers (`chrome-devtools-mcp`, `playwright-mcp`, and `turbo-browser-mcp`, totaling 69 tools) enabled at the same time.\n\nSeveral people on dev.to and `r/mcp` asked for the script I used to measure the token tax across all three harnesses. The original 40-line Python script had hardcoded Windows paths, so I rewrote it into a standalone, zero-dependency Node.js CLI called `mcp-diet` (v0.1.0, MIT).\n\nGitHub: [https://github.com/Tthanh2k6/mcp-diet](https://github.com/Tthanh2k6/mcp-diet)\n\n`mcp-diet`\nYou can run it locally on Node 20+ without installing global packages:\n\n```\nnpx github:Tthanh2k6/mcp-diet audit\n```\n\nOr from a local clone:\n\n```\ngit clone https://github.com/Tthanh2k6/mcp-diet.git\ncd mcp-diet\nnode bin/mcp-diet.mjs audit\n```\n\nHere is the real output on my machine after moving 1,521 unused skills to an archive and 60 specialized skills into an on-demand vault:\n\n``` bash\n$ node bin/mcp-diet.mjs audit\n=== 1. ACTIVE SKILLS (Target <= 16 per agent) ===\n  agents     :  14 skills  (~1265 frontmatter tokens  ) [OK]\n    [SEC NOTE] 1 executable script(s) inside agents skills: [systematic-debugging/find-polluter.sh]\n  gemini     :  14 skills  (~1265 frontmatter tokens  ) [OK]\n    [SEC NOTE] 1 executable script(s) inside gemini skills: [systematic-debugging/find-polluter.sh]\n  claude     :  16 skills  (~1289 frontmatter tokens  ) [OK]\n    [SEC NOTE] 9 executable script(s) inside claude skills: [systematic-debugging/find-polluter.sh, synced/contact_sheet.sh, synced/ref_frames.sh, synced/samples.sh, synced/style_board.sh]\n\n=== 2. MCP SERVERS & CATEGORY OVERLAPS ===\n  antigravity: active=[turbo-browser, basic-memory] | disabled=[blender, chrome-devtools, n8n-mcp, playwright]\n  claude     : active=[workspace-mcp, turbo-browser, basic-memory]\n  codex      : active=[basic-memory]\n  MCP Footprint: ~14382 est. active schema tokens (6 enabled, 4 disabled saving ~40700 tokens)\n\n=== 3. ALWAYS-LOADED RULES FILES (Target <= 15 KB per file) ===\n   16.5 KB  [WARN: >15KB ]  C:\\Users\\dev\\.gemini\\config\\rules\\huong-dan-toan-cuc-tu-claude.md (~4226 tokens)\n    7.8 KB  [OK          ]  C:\\Users\\dev\\.gemini\\config\\rules\\model-effort-selection.md (~2004 tokens)\n   17.2 KB  [WARN: >15KB ]  C:\\Users\\dev\\.claude\\CLAUDE.md (~4407 tokens)\n  TOTAL RULES: 41.5 KB (~10637 est. tokens if all loaded)\n\n=== SUMMARY ===\n  Estimated session-start context footprint: ~28838 tokens\n  Trust-boundary script notes: 3 provider(s) with executable scripts in skills\n  [!] huong-dan-toan-cuc-tu-claude.md is 16.5 KB (exceeds 15 KB limit, ~4226 tokens)\n  [!] CLAUDE.md is 17.2 KB (exceeds 15 KB limit, ~4407 tokens)\n```\n\nEven after trimming active skills down to 14-16 per agent and disabling 4 idle MCP servers (saving ~40,700 schema tokens), `mcp-diet` caught two global rule files (`CLAUDE.md` at 17.2 KB and my global Gemini rule file at 16.5 KB) that had crept past the 15 KB threshold.\n\n`~/.claude/skills`, `~/.gemini/config/skills`, `~/.agents/skills`, and `~/.codex`, parses each `SKILL.md` YAML frontmatter block (`name`, `description`), and estimates the session-start token cost against a configurable cap (`--skills-max 16`).`~/.claude.json`, `~/.gemini/config/mcp_config.json`, and `~/.codex/config.toml` (using an inline zero-dependency TOML parser for `[mcp_servers.<name>]`), classifies servers into functional buckets (` browser`, `database`, `search`, `memory`, `git`, `desktop`), and flags when multiple servers in the same category are active simultaneously.`CLAUDE.md`, `GEMINI.md`, and `~/.gemini/config/rules/*.md`) in KB and estimated tokens, warning when any single file exceeds `--rules-max-kb` (default `15`).`.ps1`, `.sh`, `.bat`, `.cmd`, `.exe`, and `.vbs` files so you can review what an agent can invoke inside your workspace. Passing `--fail-on-scripts` turns script detections into strict failures.`env` values during parsing (recording only `envKeyCount`), and masks credential flags (`--token`, `--api-key`, `postgres://user:pass@...`, `ghp_`, `sk-`, `eyJ...`) as `[REDACTED]` in both terminal and `--json` output.\nCleanup only lasts until you install another plugin pack or append a few more paragraphs to `CLAUDE.md`. You can enforce a hard ceiling in scripts or CI with `--strict` (which exits with code `1` on any warning):\n\n```\nnpx github:Tthanh2k6/mcp-diet audit --strict --skills-max 16 --rules-max-kb 15\n```\n\nOr export a structured JSON report for your own dashboard or dotfiles repo:\n\n```\nnpx github:Tthanh2k6/mcp-diet audit --json --workspace-dir .\n```\n\nThe CLI uses only built-in Node.js modules (`node:fs`, `node:path`, `node:os`, `node:url`) and ships with 30 unit tests on Node 20+. If you use another agent harness with its own config layout (Cursor, Windsurf, Cline, or OpenCode) and want its paths added to the scanner, open an issue or PR on GitHub.", "url": "https://wpnews.pro/news/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet", "canonical_source": "https://dev.to/tthanh2k6/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet-41bk", "published_at": "2026-11-29 06:03:41+00:00", "updated_at": "2026-11-29 06:13:05.453548+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "agent-protocols"], "entities": ["mcp-diet", "Claude Code", "Codex CLI", "Gemini", "Antigravity", "GitHub", "Node.js"], "also_reported_by": [], "takeaway": "mcp-diet audits skills, MCP server schemas and rules files across Claude Code, Gemini and Codex, showing that disabling four idle MCP servers saved about 40,700 schema tokens and that two global rule files had crept past 15 KB.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet", "markdown": "https://wpnews.pro/news/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet.md", "text": "https://wpnews.pro/news/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet.txt", "jsonld": "https://wpnews.pro/news/i-turned-my-1587-skill-context-audit-into-a-zero-dependency-cli-mcp-diet.jsonld"}}