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-enforce

v1.0.0

Published

Transform CLAUDE.md natural language rules into deterministic Claude Code hooks automatically

Readme

claude-enforce

Transform CLAUDE.md rules into deterministic Claude Code hooks. Automatically.

  ClaudeEnforce — Init

  Parsing CLAUDE.md...
  Found 8 rules in 3 sections

  Classification Results:

    Enforceable (hook-ready):  5
    Advisory (CLAUDE.md only):  3

    ✓ [CRITICAL] NEVER edit .env files
    ✓ [CRITICAL] NEVER commit secrets or API keys
    ✓ [HIGH]     ALWAYS run tests before committing
    ✓ [HIGH]     NEVER use git push --force
    ✓ [HIGH]     Do not skip git hooks with --no-verify
    · [NORMAL]   Keep functions under 50 lines
    · [NORMAL]   Use TypeScript strict mode
    · [NORMAL]   Prefer composition over inheritance

  Generated 5 hooks → .claude/settings.json

CLAUDE.md is advisory. Hooks are deterministic. Claude can ignore your CLAUDE.md under pressure. It cannot bypass a hook that exits with code 1. This tool bridges the gap.

Try it

npx claude-enforce init              # parse CLAUDE.md → generate hooks
npx claude-enforce install --list    # browse pre-built presets
npx claude-enforce audit             # compliance report from transcripts

Commands

init — Parse rules, generate hooks

claude-enforce init                  # reads ./CLAUDE.md
claude-enforce init --file path.md   # custom CLAUDE.md path
claude-enforce init --dry-run        # preview without writing

Reads your CLAUDE.md, classifies each rule as enforceable (can be a hook) or advisory (stays in CLAUDE.md), and generates .claude/settings.json hooks for enforceable rules.

Set ANTHROPIC_API_KEY for AI-powered classification. Without it, pattern-based classification works fine.

install — Pre-built presets

claude-enforce install --list
claude-enforce install block-destructive-bash no-env-edit

| Preset | Hooks | What it blocks | |--------|-------|---------------| | block-destructive-bash | 3 | rm -rf, git reset --hard, force push, DROP TABLE | | no-env-edit | 2 | Any Edit/Write to .env files | | no-commit-without-tests | 1 | git commit unless tests were run | | no-migration-without-confirm | 1 | Database migrations without approval | | typecheck-on-save | 2 | Runs tsc --noEmit after editing .ts files |

audit — Compliance report

claude-enforce audit                 # scan .claude/logs/
claude-enforce audit --json          # machine-readable
claude-enforce audit --since 2025-01-01
  Compliance Report
  ──────────────────────────────────────────

  Tool calls analyzed:   247
  Total violations:      12
  Compliance rate:       95.1%

  Most Broken Rules:
    4x no-destructive-bash
    3x no-force-push
    2x no-env-edit

watch — Real-time monitoring

claude-enforce watch                 # live monitor
claude-enforce watch --interval 5000

Polls .claude/logs/ for new transcript entries and alerts instantly on violations.

How hooks work

CLAUDE.md = instructions Claude reads. Hooks = shell commands that intercept tool calls.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "type": "command",
        "command": "if echo \"$CLAUDE_TOOL_INPUT\" | grep -qE \"rm -rf\"; then echo \"BLOCKED\" >&2; exit 1; fi"
      }
    ]
  }
}
  • PreToolUse: runs before a tool. Exit 1 = tool blocked.
  • PostToolUse: runs after. Used for checks (lint, typecheck).
  • $CLAUDE_TOOL_INPUT: JSON of what Claude is trying to do.

Part of the Claude Code Toolkit

| Tool | What it does | |------|-------------| | claude-score | Score your setup A-F, see what's missing | | claude-gen | Generate CLAUDE.md from your codebase | | claude-enforce | Convert rules into deterministic hooks |

npx claude-score         # diagnose
npx claude-gen           # fix
npx claude-enforce init  # protect

License

MIT