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

@bifrostlabs/claude-shield

v1.0.0

Published

Security & protection hooks for Claude Code — blocks destructive commands, protects sensitive files, audit trail

Readme

@bifrostlabs/claude-shield

npm version License: MIT Tests

Security and protection hooks for Claude Code. Blocks destructive commands, protects sensitive files, prevents force pushes to protected branches, and maintains a full audit trail — all through Claude Code's hook system.

Features

  • Destructive command blocking — catches rm -rf, DROP TABLE, git reset --hard, chmod 777, and more
  • Sensitive file protection — blocks writes to .env, *.pem, *.key, credentials files, SSH keys
  • Force push prevention — blocks git push --force to protected branches (main/master by default)
  • Full audit trail — SQLite-backed logging of every blocked action and tool execution
  • Custom rules — add your own blocked commands, protected files, and protected branches via config
  • Zero config start — ships with sensible defaults, customize via JSON config

Quick Start

npm install @bifrostlabs/claude-shield

Add hooks to your Claude Code settings.json:

{
  "hooks": {
    "PreToolUse": [{ "command": "claude-shield-pre-tool" }],
    "PostToolUse": [{ "command": "claude-shield-post-tool" }]
  }
}

Configuration

Config lives at ~/.claude-shield/config.json (auto-created on first run):

{
  "enabled": true,
  "block_destructive_commands": true,
  "block_protected_files": true,
  "block_force_push": true,
  "audit_logging": true,
  "audit_retention_days": 30,
  "blocked_commands": [],
  "protected_files": [],
  "protected_branches": ["main", "master"]
}

Custom Rules

Add your own patterns:

{
  "blocked_commands": ["docker system prune", "kubectl delete namespace"],
  "protected_files": ["*.tfstate", "production.yml"],
  "protected_branches": ["main", "master", "release/*"]
}

What Gets Blocked

Destructive Commands

rm -rf, DROP TABLE, DROP DATABASE, TRUNCATE TABLE, git reset --hard, git clean -f, git checkout ., git restore ., chmod 777, mkfs.*, writes to /dev/sd*, git commit --no-verify

Protected Files

.env, .env.*, credentials.*, *.pem, *.key, *.p12, *.pfx, id_rsa, id_ed25519, *.keystore, secrets.*, service-account*.json, firebase-adminsdk*.json, .npmrc, .pypirc

Force Push

git push --force and git push -f to protected branches (main/master by default)

API

import {
  checkBlockedCommand,
  checkProtectedFile,
  loadConfig,
  recentBlocked,
  recentAudit,
} from "@bifrostlabs/claude-shield";

const config = loadConfig();

// Check if a command would be blocked
const result = checkBlockedCommand("rm -rf /", config);
// { blocked: true, ruleType: "destructive_command", ... }

// Check if a file write would be blocked
const fileResult = checkProtectedFile(".env.production", config);
// { blocked: true, ruleType: "protected_file", ... }

How It Works

  1. PreToolUse hook intercepts Bash commands and file writes before execution — blocks if they match destructive patterns or target protected files
  2. PostToolUse hook logs all tool executions to the audit database for compliance and review

License

MIT