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

@aiignore/cli

v0.1.18

Published

Protect sensitive files from AI coding assistants with .aiignore

Downloads

2,209

Readme

@aiignore/cli

Protect sensitive files from AI coding assistants using .aiignore files.

Drop a .aiignore in your project root -- just like .gitignore -- and Claude Code will be blocked from reading, writing, or editing matched files. Supports both global and per-project ignore files.

Quick Start

# One-time setup (compiles a native hook binary via bun)
npx @aiignore/cli install

# Create a local .aiignore in any project
echo ".env" >> .aiignore
echo "secrets/" >> .aiignore

# Or set global rules that apply everywhere
aiignore add --global "*.pem"

# Done. Claude Code will now respect your .aiignore.

For permanent CLI access:

npm install -g @aiignore/cli

Features

  • Global ~/.aiignore -- patterns that apply across all projects
  • Local .aiignore -- per-project patterns using gitignore syntax
  • Blocks Read, Write, Edit, and MultiEdit operations
  • Audit logging -- blocked attempts are logged to ~/.claude/aiignore-audit.log
  • Update notifications -- checks for new versions at session start
  • Shell completions -- installed automatically with aiignore install

.aiignore Syntax

Uses the same syntax as .gitignore:

# Block environment files
.env
.env.*

# Block entire directories
secrets/
private/

# Block by extension
*.key
*.pem

# Negation (allow specific files)
!.env.example

Commands

aiignore install

One-time setup. Compiles a fast native hook binary (via bun build --compile) and registers it as a Claude Code PreToolUse hook. Also installs shell completions. Requires Bun.

aiignore uninstall

Removes the hook from Claude Code settings and deletes the hook binary. Does not delete your .aiignore files.

aiignore status

Shows whether the hook is installed and working -- checks the settings entry, the hook binary, shell completions, and whether global/local .aiignore files exist.

aiignore check

Dry-run that scans the current directory and reports which files would be blocked. Shows whether each match comes from the global or local .aiignore.

aiignore suggest

Auto-detects sensitive files in the current directory (.env, keys, credentials, etc.) and suggests adding them to .aiignore.

aiignore add <paths...>

Adds patterns to .aiignore. Defaults to local if a .aiignore exists in the current directory, otherwise adds to the global ~/.aiignore.

  • --local -- force writing to the local .aiignore
  • --global -- force writing to the global ~/.aiignore

aiignore list

Shows all patterns currently configured across both the global ~/.aiignore and local .aiignore.

aiignore audit

Shows recent blocked access attempts from the audit log.

  • --lines <n> -- number of log entries to show
  • --clear -- clear the audit log

How It Works

  1. aiignore install compiles a native binary (via bun build --compile) and installs it as a Claude Code PreToolUse hook
  2. On every file operation (Read, Write, Edit, MultiEdit), the hook checks for .aiignore patterns
  3. Both global (~/.aiignore) and local (.aiignore in cwd) patterns are evaluated
  4. If the accessed file matches a pattern, the hook blocks the operation and logs the attempt
  5. If no .aiignore exists, everything is allowed (fail-open)
  6. A lightweight PreSessionStart hook checks for updates once per session (2s timeout, fail-open)

Limitations

  • Direct file operations only. Blocking file access doesn't prevent AI tools from seeing file names, directory structures, or error messages that may reveal context.
  • Root-level .aiignore only. Subdirectory .aiignore files are not supported yet.
  • Claude Code only. Other AI tools are not supported yet.
  • Not a security boundary. This is a guardrail, not a sandbox. It prevents accidental access, not determined circumvention.

Requirements

  • Bun (for compiling the hook binary)
  • Claude Code

License

MIT