npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-diet

v0.1.2

Published

See which skills, plugins, memory, and MCP servers are eating your Claude Code context — before your bill does.

Readme

🥗 claude-diet

See which skills, plugins, memory, and MCP configs are eating your Claude Code context — before your bill does.

npm version CI License: MIT Node TypeScript

A 1-second audit of your ~/.claude/ folder. Terminal bars. Screenshot-friendly HTML report. Actionable "diet suggestions." Zero network calls. Zero API keys. Runs on your machine.

npx claude-diet

🩻 What it tells you

Every Claude Code session loads your skills, plugins, memory, agent definitions, and MCP schemas into the model's context. Most of that content silently costs you tokens on every turn — and it's very hard to see what's actually earning its cost.

claude-diet scans your ~/.claude/ folder, tokenizes every artifact, and shows you a ranked breakdown so you can see, in one screenshot:

  • Which skills eat the most context — and which ones you haven't touched in 60 days
  • Which plugin packs are quietly bloating every session
  • Which memory files have drifted into essay-length
  • Whether your task-output cache is eating disk you'll never use again
  • A ranked "heaviest files" table so you know exactly what to trim

⚡ Quick start

Zero-config, zero installation:

npx claude-diet

Or install globally:

npm install -g claude-diet
claude-diet

That's it. Reads ~/.claude/ by default. Nothing gets uploaded anywhere.

🖥 Usage

Usage: claude-diet [options]

  See which skills, plugins, memory, and MCP configs are eating your
  Claude Code context.

Options:
  -r, --root <path>       Path to scan (default: ~/.claude)
  --html [file]           Write a shareable HTML report
  --json                  Emit machine-readable JSON to stdout
  --days <n>              Only include artifacts modified in the last N days
  --project <name>        Restrict scan to one project directory
  --top <n>               How many heaviest artifacts to show (default: 15)
  --suggest               Only print diet suggestions
  -v, --version           output the version number
  -h, --help              display help for command

Common recipes:

# See the full report
claude-diet

# Screenshot-friendly HTML report (opens in your browser)
claude-diet --html && open claude-diet-report.html

# Show only what changed in the last 30 days
claude-diet --days 30

# Focus on one project
claude-diet --project my-app

# Machine-readable for CI or scripts
claude-diet --json > diet.json

🩺 What "diet suggestions" look like

The tool doesn't just show numbers — it flags what to trim:

  • CRITICAL — a single artifact carrying more than 5,000 tokens. That's almost always over-budget for one skill or memory file.
  • WARN — three or more skills untouched in 60+ days. You probably forgot they're installed.
  • WARN — memory files that have drifted past 1,000 tokens. Time to break them into linked files.
  • INFO — large task-output caches (50k+ tokens) or transcript stores (500k+ tokens) that are burning disk.

Each suggestion includes an estimated token savings so you can decide what's worth the click.

🔍 What it scans

| Category | Files | Notes | |---|---|---| | Skills | ~/.claude/skills/**/SKILL.md and linked files | Every skill's SKILL.md loads into every session | | Plugin skills | ~/.claude/plugins/*/skills/**/*.md | Same, but bundled from plugin packs | | Agents | ~/.claude/agents/*.md | Custom subagent definitions | | Memory | ~/.claude/projects/*/memory/*.md | Per-project persistent memory | | Settings | settings.json, settings.local.json | Hooks, permissions, model choice | | MCP configs | mcp_settings.json, mcp.json, .mcp.json | Configured Model Context Protocol servers | | Keybindings | keybindings.json | Custom keyboard shortcuts | | Transcripts | ~/.claude/projects/*/transcripts/*.jsonl | Local conversation history | | Task outputs | ~/.claude/projects/*/tasks/*.output | Background command output caches |

🔐 Privacy

Nothing leaves your machine. claude-diet reads files from ~/.claude/ (or whichever path you point it at), tokenizes them in-memory, and prints a report. No telemetry. No network calls. No API keys. See the source — the tool has zero HTTP dependencies.

The tokenizer uses cl100k_base (OpenAI's cl100k) as a fast local approximation of Claude's tokenizer. Absolute counts are within ~5-10% of Anthropic's actual count in practice, and the relative shares between categories are unchanged. That's what matters for pruning decisions.

📦 Programmatic API

claude-diet also exports its core functions if you want to embed it in another tool:

import {
  scanClaudeDir,
  analyze,
  renderHtml,
  countTokens,
  defaultRoot,
} from 'claude-diet';

const artifacts = await scanClaudeDir(
  { root: defaultRoot(), top: 15 },
  countTokens,
);
const report = analyze(artifacts, defaultRoot(), 0, 15);
console.log(report.suggestions);

Types are shipped with the package.

🛠 Development

git clone https://github.com/unusdon/claude-diet.git
cd claude-diet
npm install
npm run dev            # run against your own ~/.claude
npm test               # run vitest
npm run typecheck      # tsc --noEmit
npm run build          # emit dist/

Tests cover the scanner (fixture-based), tokenizer, and the analyzer's suggestion logic. CI runs on Node 20 and 22.

🗺 Roadmap

  • claude-diet --watch — live token cost as you work
  • claude-diet prune — interactive pruner that moves stale files to .claude/archive/
  • Anthropic tokenizer — swap in the official Claude tokenizer when it's available for JS
  • Team cloud — optional hosted dashboard where teams can share their reports (opt-in, self-hostable)

Suggestions welcome — open an issue or start a discussion.

🤝 Contributing

Small, focused PRs are welcome. Please:

  1. Open an issue first if the change is bigger than a bug fix.
  2. Add or update tests. The bar is genuine coverage of scanner rules and analyzer thresholds.
  3. Run npm run typecheck, npm test, and npm run lint before opening the PR.

See CONTRIBUTING if it exists (coming soon).

📜 License

MIT © 2026 unusdon

🥗 Ship a leaner Claude Code setup. ⭐ If this saved you tokens, a star is the tip jar.