no-npm

no-npm is a skill for Claude Code from UAantovakul/no-npm-claude. It costs 33 tokens per session (1,902 once invoked), scanned B, original, MIT.

A rule that blocks npm, npx, and yarn commands and requires using pnpm instead, based on stated package-supply-chain concerns.

In plain words
What is it for?
Checking commands for prohibited package managers, replacing them with pnpm equivalents, and following pnpm dependency-script and release-age safeguards.
Why use it?
It avoids package-manager behavior the instructions consider a higher installation risk, while directing dependency work through pnpm settings and allowlists.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Checking commands for prohibited package managers, replacing them with pnpm equivalents, and following pnpm dependency-script and release-age safeguards.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/uaantovakul/no-npm-claude/no-npm
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add UAantovakul/no-npm-claude --skill no-npm
Clone the repo
git clone --depth 1 https://github.com/UAantovakul/no-npm-claude

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for no-npm

README.md
[![agentmods](https://agentmods.dev/badge/skills/uaantovakul/no-npm-claude/no-npm/github.svg)](https://agentmods.dev/skills/uaantovakul/no-npm-claude/no-npm)
Your own site
<a href="https://agentmods.dev/skills/uaantovakul/no-npm-claude/no-npm"><img src="https://agentmods.dev/badge/skills/uaantovakul/no-npm-claude/no-npm/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for no-npm

Your own site · 80×15
<a href="https://agentmods.dev/skills/uaantovakul/no-npm-claude/no-npm"><img src="https://agentmods.dev/badge/skills/uaantovakul/no-npm-claude/no-npm.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,902 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.01902
Opus 5 $0.00016 $0.00951
Sonnet 5 $0.00007 $0.00380
Haiku 4.5 $0.00003 $0.00190

Measured 12d ago against content hash 65ec372e7cef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade B, and why

no-npm scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

The hook `~/.claude/hooks/block-npm.js` is registered in `~/.claude/settings.json`
payload/skills/no-npm/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

no-npm — Block npm/npx/yarn, pnpm only

Why this skill exists

The npm ecosystem went through a series of large supply-chain attacks (Shai-Hulud Sep 2025, Shai-Hulud 2.0 Nov 2025, Mini Shai-Hulud May 2026). The common vector across all three is a package's lifecycle scripts (preinstall / install / postinstall), which the package manager runs automatically during install. That is where the worm executes.

pnpm 10+ by default does NOT run dependency build scripts outside an explicit allowlist (onlyBuiltDependencies / allowBuilds in pnpm-workspace.yaml) — it only prints a warning. That closes the primary vector. npm runs everything without asking — which is why npm is blocked and pnpm is not.

Furthermore — pnpm 11+ (released ~April 2026) enables minimumReleaseAge=1440 (a 24h cooldown on fresh versions) and blockExoticSubdeps by default. So on pnpm 11 both vectors are closed — execution (allowlist) and ingress (cooldown) — out of the box, no config. Before v11 the cooldown was 0 (opt-in). Source: https://pnpm.io/settings ("Default: 1440 (since v11)").

⚠️ pnpm config get minimumReleaseAge returning undefined does NOT mean "disabled": config get only echoes explicit config, not the v11 built-in default.

The user's global decision: no npm/npx/yarn in this environment.

When npm/npx/yarn appears (from me or from the user)

As soon as a command contains npm, npx, or yarn as a standalone word — whether I (Claude) am about to run it or the user asks for it directly:

  1. Do NOT run it.

  2. Issue a warning:

    ⛔ NPM IS BLOCKED IN THIS ENVIRONMENT. Use pnpm.

  3. Offer the pnpm equivalent (table below) and ask for confirmation before running it.

If the user genuinely needs npm itself, they run the command manually in their own terminal outside Claude Code; the block-npm.js hook blocks the attempt through Bash regardless.

Equivalents table

npm / npx / yarn pnpm
npm install / npm i pnpm install
npm install <pkg> / npm i <pkg> pnpm add <pkg>
npm install -D <pkg> pnpm add -D <pkg>
npm install -g <pkg> pnpm add -g <pkg>
npm uninstall <pkg> / npm rm <pkg> pnpm remove <pkg>
npm update pnpm update
npm run <script> pnpm <script> (or pnpm run <script>)
npm test pnpm test
npm ci pnpm install --frozen-lockfile
npx <pkg> pnpm dlx <pkg>
npx create-vite my-app pnpm create vite my-app
yarn / yarn install pnpm install
yarn add <pkg> pnpm add <pkg>
yarn add -D <pkg> pnpm add -D <pkg>
yarn remove <pkg> pnpm remove <pkg>
yarn <script> pnpm <script>

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 147 lines · 33 tokens per session scan B 65ec372e7cef

Subscribe to this mod's changes

no-npm is a skill published in the GitHub repository UAantovakul/no-npm-claude (2 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 1,902 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

secondsky/claude-skills · 53 tokens

aceternity-ui

100+ animated React components (Aceternity UI) for Next.js with Tailwind. Use for hero sections, parallax, 3D effects, or encountering animation, shadcn CLI integration errors.

secondsky/claude-skills · 48 tokens

cloudflare-cron-triggers

Cloudflare Cron Triggers for scheduled Workers execution. Use for periodic tasks, scheduled jobs, or encountering handler not found, invalid cron expression, timezone errors.

secondsky/claude-skills · 38 tokens

cloudflare-durable-objects

Cloudflare Durable Objects for stateful coordination and real-time apps. Use for chat, multiplayer games, WebSocket hibernation, or encountering class export, migration, alarm errors.

secondsky/claude-skills · 43 tokens

cloudflare-browser-rendering

Cloudflare Browser Rendering with Puppeteer/Playwright. Use for screenshots, PDFs, web scraping, or encountering rendering errors, timeout issues, memory exceeded.

secondsky/claude-skills · 37 tokens

cloudflare-workers-ci-cd

Complete CI/CD guide for Cloudflare Workers using GitHub Actions and GitLab CI. Use for automated testing, deployment pipelines, preview environments, secrets management, or encountering deployment failures, workflow errors, environment configuration issues.

secondsky/claude-skills · 50 tokens