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

@torka/claude-qol

v0.4.6

Published

Claude Code quality-of-life improvements: auto-approve hooks, context monitoring, and status line enhancements

Readme

@torka/claude-qol

Claude Code quality-of-life improvements: auto-approve hooks, context monitoring, and workflow optimization.

Features

| Feature | Description | |---------|-------------| | Auto-Approve Hook | Intelligent command auto-approval for solo dev workflows | | Context Monitor | Real-time context usage status line with visual indicators | | Completion Notifications | Desktop notifications + sound when tasks complete | | Optimize Command | Analyze auto-approve decisions and refine rules | | Fresh Eyes Review | Mid-session fresh-eyes review using an Opus subagent | | Docs Quick Update | Detect code changes and suggest targeted documentation updates | | Nash | Session transcript analysis to extract learnings and optimize workflows |

Installation

Project-level (recommended)

npm install --save-dev @torka/claude-qol

Global

npm install -g @torka/claude-qol

The installer automatically copies files to your .claude/ directory:

  • Project-level: Files go to <project>/.claude/
  • Global: Files go to ~/.claude/

Recommended Placement

Some features work best at user-level (~/.claude/settings.json), while others are project-specific:

| Feature | Recommended Level | Why | |---------|------------------|-----| | Status Line | User-level | Universally useful; gracefully degrades (no git = no branch shown). Projects can override. | | Notifications | User-level | You always want to know when tasks finish. Don't also define at project level — hooks stack, causing double notifications. | | Auto-Approve Hook | Project-level | Rules are project-specific. Uses $CLAUDE_PROJECT_DIR to find rules file. |

Post-Installation Setup

1. Configure Auto-Approve Hook (recommended)

Add to your .claude/settings.local.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash|Read|Grep|Glob|Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "command",
            "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/scripts/auto_approve_safe.py"
          }
        ]
      }
    ]
  }
}

2. Configure Status Line (recommended)

Add to your .claude/settings.local.json:

{
  "statusLine": {
    "type": "command",
    "command": "python3 \"$CLAUDE_PROJECT_DIR\"/.claude/scripts/context-monitor.py"
  }
}

This shows a real-time context usage bar with percentage and warnings.

3. Completion Notifications (recommended)

Get notified when Claude Code finishes a task:

{
  "hooks": {

    "Stop": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ],
    "Notification": [
      {
        "matcher": "*",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ]
  }
}

Platform support:

  • macOS: Native notifications via osascript + sound via afplay
  • Linux: Desktop notifications via notify-send

Components

Auto-Approve Hook

PreToolUse hook that intelligently auto-approves safe commands:

Allowed by default:

  • Read-only commands (ls, cat, head, tail, tree)
  • Git read operations (git status, git diff, git log, git branch)
  • Development commands (npm test, npm run build, pnpm test, pytest)
  • Search tools (grep, rg, find, fd, jq)
  • File system operations (mkdir, touch, cp, mv)
  • Git write operations (git add, git commit, git push)
  • GitHub CLI (gh pr, gh issue, gh repo)

Denied automatically:

  • Dangerous commands (sudo, rm -rf, mkfs, shutdown)
  • System modifications (chmod 777, chown :* /)
  • Pipe to shell (curl | bash, wget | sh)
  • Fork bombs and kill commands

Prompted (normal permission system):

  • Everything else defers to Claude Code's built-in permissions

Customizing Rules

Edit .claude/scripts/auto_approve_safe.rules.json:

{
  "allow_patterns": [
    "^your-custom-safe-command"
  ],
  "deny_patterns": [
    "^your-dangerous-command"
  ],
  "sensitive_paths": [
    "\\.secret$"
  ]
}

Auto-approving non-Bash tools

The auto-approve hook handles Bash, Read, Write, Edit, Grep, and Glob tools. For other tools (WebSearch, WebFetch, MCP tools like Playwright), use Claude Code's built-in permission system by adding them to your settings.local.json:

{
  "permissions": {
    "allow": [
      "WebSearch",
      "WebFetch",
      "mcp__playwright__*",
      "mcp__context7__*",
      "mcp__stitch__*"
    ]
  }
}

This is faster than routing through the hook (zero latency) and works for any tool type. See examples/settings.local.example.json for a complete example.

Rules Lint (optional)

Check for invalid, duplicate, or dead patterns in the hook rules:

python3 npm-claude-qol/scripts/auto_approve_safe_rules_check.py

By default this checks npm-claude-qol/scripts/auto_approve_safe.rules.json. To lint the installed copy, pass it explicitly:

python3 npm-claude-qol/scripts/auto_approve_safe_rules_check.py .claude/scripts/auto_approve_safe.rules.json

Context Monitor

Status line script showing:

  • Current model name (e.g., [Claude Opus 4])
  • Working directory
  • Git branch with visual indicator
  • Context usage bar with percentage
  • Color-coded warnings:
    • 🟢 Green: < 50% usage
    • 🟡 Yellow: 50-75% usage
    • 🟠 Light red: 75-90% usage
    • 🔴 Red: 90-95% usage
    • 🔴 Blinking: > 95% usage (CRITICAL)

Optimize Command

Run /optimize-auto-approve-hook to:

  1. Analyze the decision log (.claude/auto_approve_safe.decisions.jsonl)
  2. Validate existing ALLOW rules aren't too permissive
  3. Identify frequently-asked commands that could be safely auto-allowed
  4. Check for overly broad DENY patterns causing false positives
  5. Generate new regex patterns for safe commands
  6. Clean up and archive the decision log

Decision Logging

When ENABLE_DECISION_LOG = True (default), the hook logs all decisions to:

.claude/auto_approve_safe.decisions.jsonl

Each entry includes:

  • Timestamp
  • Tool name
  • Decision (allow/deny/ask)
  • Reason for decision
  • Input summary

Use /optimize-auto-approve-hook to analyze this log and improve your rules.

File Structure

After installation, files are placed in:

.claude/
├── scripts/
│   ├── auto_approve_safe.py
│   ├── auto_approve_safe.rules.json
│   ├── auto_approve_safe_rules_check.py
│   └── context-monitor.py
├── commands/
│   ├── optimize-auto-approve-hook.md
│   ├── docs-quick-update.md
│   └── fresh-eyes.md
└── skills/
    └── nash/
        ├── SKILL.md
        ├── OPUS-ANALYSIS-PROMPT.md
        ├── prune_transcript.py
        ├── nash-learnings.md
        └── nash-sources.example.yaml

Uninstallation

npm uninstall @torka/claude-qol

Manual cleanup (if files remain after uninstall):

rm -f .claude/scripts/auto_approve_safe.py \
      .claude/scripts/auto_approve_safe.rules.json \
      .claude/scripts/auto_approve_safe_rules_check.py \
      .claude/scripts/context-monitor.py \
      .claude/commands/optimize-auto-approve-hook.md \
      .claude/commands/docs-quick-update.md \
      .claude/commands/fresh-eyes.md
rm -rf .claude/skills/nash

Note: Your settings.local.json is not modified—you may want to manually remove hook/statusLine configurations.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

MIT License - see LICENSE for details.

Author

Varun Torka

Links