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-composition-hook

v1.1.2

Published

Claude Code PreToolUse hook that auto-approves composed Bash commands when every segment is individually covered by the permissions.allow list

Readme

claude-composition-hook

A Claude Code PreToolUse hook that auto-approves composed Bash commands when every segment is individually covered by your permissions.allow list.

The Problem

Claude Code's permissions.allow list works for single commands:

"Bash(git log:*)"

But composed commands like git log | grep fix don't match — Claude Code falls through to manual approval even though both git log and grep are individually allowed.

The Solution

This hook intercepts every Bash tool call, splits composed commands into segments, checks each against your allow list, and auto-approves if all segments are allowed.

Installation

npx claude-composition-hook

That's it. The command detects it's running interactively and writes the hook config to ~/.claude/settings.json automatically.

If you prefer a global install:

npm install -g claude-composition-hook
claude-composition-hook

Configuration

After running setup, add the commands you want to allow in ~/.claude/settings.json:

{
  "permissions": {
    "allow": [
      "Bash(git log:*)",
      "Bash(grep:*)",
      "Bash(find:*)"
    ]
  }
}

The hook auto-approves composed commands (e.g. git log | grep fix) when every segment matches an entry in this list.

How It Works

  1. Reads the JSON payload from stdin on every Bash tool call
  2. Splits the command on |, &&, ||, ; — ignoring operators inside quotes
  3. Strips leading VAR=value env-var assignments from each segment
  4. Loads allowed prefixes from Bash(prefix:*) entries in:
    • ~/.claude/settings.json
    • {project}/.claude/settings.json
    • {project}/.claude/settings.local.json
  5. Approves if all segments match an allowed prefix; otherwise exits silently (falls through to manual approval)

Supported Operators

| Operator | Example | |----------|---------| | \| (pipe) | git log \| grep fix | | && | git fetch && git log | | \|\| | git log \|\| echo fail | | ; | echo a; echo b |

Requirements

  • Node.js >=18
  • Claude Code with hooks support

License

MIT