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

@yayaluoya-claude-plugins/auto-allow-bash-plugin

v0.1.16

Published

自动放行只读 Bash / PowerShell 命令 — 本地正则 + LLM 双重判定

Readme

auto-allow-bash-plugin

自动放行只读 Bash / PowerShell 命令的 Claude Code 插件。

工作原理

通过 PreToolUse hook 拦截所有 BashPowerShell 工具调用,双重判定:

  1. 本地正则快速放行 — 对显然只读的命令直接放行,零延迟,零成本。Bash 覆盖 lscatgit status|diff|lognpm ls 等;PowerShell 覆盖 Get-ChildItemGet-ContentGet-ProcessTest-PathSelect-Object/Where-Object 等只读 cmdlet。检测到 > / >> 重定向等危险特征会立即跳过本地放行。
  2. LLM 兜底判定 — 正则未命中时调用 LLM 判断是否只读,默认模型 Haiku(claude-haiku-4-5-20251001),可通过配置覆盖,最多重试 3 次。只读放行,否则回退到人工确认。

非只读命令(写文件、安装包、git pushgit commitRemove-ItemSet-Content.NET 静态调用如 [System.IO.File]::Delete 等)始终需要人工确认。

PowerShell 与 Bash 各用独立规则集:PowerShell 正则大小写不敏感,且因其可调用任意 .NET(无限攻击面),本地只白名单放行已知只读 cmdlet,其余一律交给 LLM 判定。

命令

/auto-allow-bash-config

查看或修改 LLM 判定时使用的系统提示词和模型,配置写入 ~/.claude/auto-allow-bash-plugin.md 的 frontmatter:

---
model: claude-haiku-4-5-20251001
system_prompt: |
  你的自定义提示词
---

未配置时分别使用内置默认值(模型 claude-haiku-4-5-20251001)。输出控制指令(只输出 allow/ask)由插件内部强制追加,不需要写进 system_prompt

前置条件

认证信息按 进程环境变量 → ~/.claude/settings.jsonenv 顺序读取,提供以下任一即可:

  • ANTHROPIC_AUTH_TOKEN(优先于 ANTHROPIC_API_KEY
  • ANTHROPIC_API_KEY

可选:ANTHROPIC_BASE_URL(自定义 API 网关地址)。

未配置认证时插件不会崩溃,会以"判定异常"为由回退到人工确认。

日志

每次判定追加一行到 ~/.claude/auto-allow-bash-plugin/log/<YYYY-MM-DD>.txt,格式为 时间 [事件/来源] (shell) 命令 | 详情,记录判定事件(recv/allow/ask/retry/error 等)、判定来源(local / llm)、命令所属 shell(Bash / PowerShell)和命令内容,便于事后审计和规则调优。

安装

/plugin install auto-allow-bash-plugin@yayaluoya-claude-plugins