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

@subclaude/cli

v1.0.0

Published

AI Code Quality Guardian CLI - Intelligent auditing layer that enforces opinionated best practices and prevents vibe coding anti-patterns across all languages and frameworks in real-time

Downloads

18

Readme

SubClaude CLI

npm version License: MIT

AI Code Quality Guardian CLI - An intelligent auditing layer that enforces opinionated best practices and prevents vibe coding anti-patterns across all languages and frameworks in real-time.

🚀 Features

  • Real-time Hook Processing: Integrates seamlessly with Claude Code through pre/post tool execution hooks
  • 20+ Specialized Behaviours: Security, governance, quality, and content validation modules
  • Three-Level Evaluation Architecture: Fast pattern matching → Complex AST analysis → LLM reasoning
  • SQLite Database: Complete audit trails with Drizzle ORM for data persistence
  • Type-Safe Operations: Full TypeScript support with Zod validation throughout
  • Modern CLI Interface: Built with React Ink for rich terminal interactions

📦 Installation

Global Installation

npm install -g @subclaude/cli

Local Installation

npm install @subclaude/cli

Development Installation

git clone https://github.com/subclaude/subclaude.git
cd subclaude/cli
npm install
npm run deploy:global

🎯 Quick Start

# Initialize SubClaude in your project
subclaude init

# Validate current working directory
subclaude validate

# Start Claude Code integration server
subclaude studio

# List all available behaviours
subclaude behaviour list

# Query audit database
subclaude query hooks --limit 10

🔧 Configuration

Create a .subclaude.json file in your project root:

{
  "enabled": true,
  "level": "warn",
  "behaviours": {
    "security": true,
    "governance": true,
    "quality": true,
    "content": false
  },
  "database": {
    "path": "~/.claude/subclaude.md.db"
  }
}

📊 Available Commands

| Command | Description | | --------------------------- | -------------------------------------------- | | subclaude init | Initialize SubClaude configuration | | subclaude validate [path] | Validate code against behaviours | | subclaude studio | Start API server for Claude Code integration | | subclaude ingest | Process hook data from Claude Code | | subclaude behaviour list | List all available validation behaviours | | subclaude query hooks | Query database with filtering options | | subclaude enable/disable | Control SubClaude functionality |

🛡️ Security Behaviours

  • Secret Detection: Prevents hardcoded secrets and API keys
  • Sensitive File Guard: Blocks access to sensitive system files
  • Browser API Restriction: Validates browser extension security patterns
  • Dependency Injection: Prevents malicious dependency injection attempts

📋 Governance Behaviours

  • Batch Edit Prevention: Stops dangerous bulk file operations
  • Import Alias Management: Enforces consistent import conventions
  • Task Completion: Validates that development tasks are properly completed
  • Repository Integrity: Ensures repository security and compliance

✨ Quality Behaviours

  • Library Recommendation: Suggests modern, well-maintained libraries
  • Code Style Enforcement: Applies consistent formatting and style rules
  • File Heading Injection: Automatically adds file headers with metadata
  • Performance Validation: Identifies performance anti-patterns

🔗 Claude Code Integration

SubClaude integrates with Claude Code through hooks for real-time validation:

  1. Pre-Tool Hook: Validates tool operations before execution
  2. Post-Tool Hook: Audits results and provides feedback
  3. Behavior Engine: Applies validation rules and returns decisions
  4. Audit Trail: Logs all operations for compliance and debugging

📊 Database & Analytics

SubClaude maintains a comprehensive audit database:

# View recent hook data
subclaude query hooks --recent

# Filter by tool type
subclaude query hooks --tool "Read" --limit 5

# Analyze behaviour results
subclaude query hooks --behaviour "security" --status "blocked"

🛠️ Development

# Development setup
git clone https://github.com/subclaude/subclaude.git
cd subclaude/cli
pnpm install

# Development mode (with tsx runtime)
pnpm dev

# Development with API server
pnpm dev:serve

# Type checking
pnpm check

# Database operations
pnpm db:studio  # Open Drizzle Studio
pnpm db:push    # Apply schema changes
pnpm db:reset   # Reset database

📝 Environment Variables

| Variable | Default | Description | | ---------------- | --------------------------- | ---------------------------------------- | | NODE_ENV | development | Environment mode | | DATABASE_URL | ~/.claude/subclaude.md.db | SQLite database path | | LOG_LEVEL | info | Logging verbosity | | CLAUDE_API_KEY | - | Claude API key (if using LLM behaviours) |

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🔗 Links

🆘 Support


Built with ❤️ by the SubClaude Team