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 🙏

© 2025 – Pkg Stats / Ryan Hefner

claude-code-plus

v1.3.0

Published

Enhance Claude Code CLI with auto-approve hooks and modern shell support

Downloads

417

Readme

Claude Code Plus

npm version License: MIT Node.js Version

Enhancements for Claude Code CLI that fix common pain points and add quality-of-life improvements.

Quick Install

npx claude-code-plus -y

Or run interactively to customize what gets installed:

npx claude-code-plus

Features

Smart Piped Command Handling

The problem: Claude Code's permission system uses prefix matching. If you allow Bash(ls:*) and Bash(grep:*), running ls | grep foo still prompts for permission because the full string doesn't match any single prefix.

The solution: A PreToolUse hook that parses piped commands using shfmt, checks each component individually against your allowed permissions, and auto-approves if all parts match.

Related: anthropics/claude-code#13340

Shell Configuration Fix

The problem: Claude Code ignores the $SHELL environment variable and always uses the system default shell (/bin/zsh on macOS). This means you lose access to your PATH, aliases, and shell-specific configuration.

The solution: A shell alias that wraps the claude command to set SHELL correctly, plus env.SHELL configuration in settings.json.

Related: anthropics/claude-code#7490

850+ Safe Permissions

Pre-configured auto-approval for common read-only commands:

  • File & text: ls, cat, head, tail, grep, rg, fd, jq, yq
  • Git: git status, git diff, git log, git branch, git show (read-only)
  • GitHub CLI: gh pr list, gh issue view, gh repo view (read-only)
  • Package managers: npm, yarn, pnpm, pip, cargo, gem, brew (info commands)
  • Cloud CLIs: aws, az, gcloud (list/describe/show)
  • DevOps: docker, kubectl, helm, terraform (read-only)

See src/permissions.ts for the complete list.

Platform Support

| Platform | Status | |----------|--------| | macOS | Fully supported | | Linux | Fully supported | | Windows | Use WSL2 |

Requirements

  • Node.js 18+ (for npx)

The installer will automatically detect and offer to install missing dependencies:

  • bash 4.4+ (macOS ships with 3.2)
  • jq (JSON processor)
  • shfmt (shell parser)

macOS:

brew install bash jq shfmt

Linux (Debian/Ubuntu):

apt install bash jq shfmt

Linux (Fedora/RHEL):

dnf install bash jq shfmt

Linux (Arch):

pacman -S bash jq shfmt

Usage

Interactive Mode (Recommended)

npx claude-code-plus

Choose between:

  1. Recommended - Installs everything with sensible defaults
  2. Custom - Pick which features to install

Non-Interactive Mode

npx claude-code-plus -y

Custom Shell

In Custom mode, you can specify a different shell:

  • A shell name (e.g., zsh) - resolved via which
  • A full path (e.g., /opt/homebrew/bin/zsh)

Note: Claude Code currently works reliably with bash and zsh only. Other shells may have limited compatibility.

What Gets Installed

| File | Purpose | |------|---------| | ~/.claude/settings.json | Shell config, hook config, and permissions | | ~/.claude/hooks/auto-approve-allowed-commands.sh | Hook for piped command auto-approval | | Shell configs (.bashrc, .zshrc, etc.) | Shell alias (workaround for shell bug) |

Chezmoi Integration

The installer automatically detects if chezmoi manages your ~/.claude directory:

  • Writes to chezmoi's source directory
  • Uses executable_ prefix for hook files
  • Prompts to run chezmoi apply at the end

No configuration needed.

How the Hook Works

  1. Claude Code invokes a Bash command
  2. The PreToolUse hook intercepts it
  3. shfmt parses the command into components
  4. Each component is checked against allowed permissions
  5. If ALL match, the command is auto-approved
  6. Otherwise, normal permission prompting applies

Supported Syntax

  • Pipes: cmd1 | cmd2 | cmd3
  • And/Or: cmd1 && cmd2 || cmd3
  • Semicolons: cmd1; cmd2
  • Subshells: (cmd1; cmd2) | cmd3
  • Command substitution: echo $(cmd1 | cmd2)
  • bash -c / sh -c: recursively expanded
  • Loops: extracts inner commands

Security

Intentionally Excluded

The following are not included in default permissions because they can execute arbitrary code:

  • xargs - runs commands from input
  • python -c, node -e, ruby -e - inline code execution
  • eval, source - execute arbitrary strings/files
  • find -exec - runs commands on matched files

Uninstall

# Remove the hook
rm ~/.claude/hooks/auto-approve-allowed-commands.sh

# Remove shell alias (look for "# Added by claude-code-plus" in your shell configs)

# Edit ~/.claude/settings.json to remove:
# - The hook config from .hooks.PreToolUse
# - Any unwanted permissions from .permissions.allow

Contributing

Issues and PRs welcome!

License

MIT