Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By om-tajnev2.0.2MIT
Blocks risky npm, pnpm and yarn installs that AI agents propose, checking packages against your dependency policy first. Its PreToolUse hook intercepts Bash install commands before they run and it claims offline use with cached metadata when PKGDIET_NO_NETWORK=1 is set.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Dependency policy for AI-assisted JavaScript and TypeScript development.
Put your node_modules on a diet.
The Problem: AI coding agents (Claude Code, Codex, Cursor, Windsurf, Cline) propose nonexistent, deprecated, vulnerable, or typosquatted packages. There is no built-in mechanism to stop them from running the install.
The Solution: PkgDiet intercepts every npm install / pnpm add / yarn add command your AI agent generates — using native agent hook APIs — and blocks unapproved installs before they execute.
Run this to see PkgDiet block real risky AI-generated dependencies in your terminal:
npx pkgdiet demo
Example output:
🔒 PkgDiet — Live AI Dependency Enforcement Demo
Simulating what happens when an AI agent tries to install these packages.
🟡 WARNING — moment
Context: AI suggested this for date formatting
Score: 100/100
Reason: Efficiency Flag: Better alternatives exist for moment.
Use this: dayjs, date-fns
🔴 BLOCKED — request
Context: AI suggested this for HTTP requests
Score: 15/100
Reason: Health score 15 is below minimum allowed (60).
Use this: undici, native fetch
CVEs: GHSA-p8p7-x288-28g6
🔒 PkgDiet blocked this risky AI-generated dependency before install.
🔴 BLOCKED — node-uuid
Context: AI suggested this for UUID generation
Score: 15/100
Reason: Health score 15 is below minimum allowed (60).
Use this: crypto.randomUUID(), uuid
🔒 PkgDiet blocked this risky AI-generated dependency before install.
🟡 WARNING — lodash
Context: AI suggested this for array utilities
Score: 80/100
Reason: Efficiency Flag: Better alternatives exist for lodash.
Use this: lodash-es, native JS
📊 Demo Summary: 2 blocked, 2 warned
These checks run automatically before every npm install in your AI agent.
Setup: npx pkgdiet init
For machine-readable CI proof:
npx pkgdiet demo --json
npx pkgdiet init
This single command creates:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (om-tajne/pkgdiet) — no native marketplace selected
npx claudepluginhub p/om-tajne-pkgdietPlugins from other owners that cover similar ground