Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

claude-plugins

A collection of hooks and plugins for Claude Code — security, cost tracking, workflow automation.

License Stars Node npm

📖 Full write-up on Dev.to

If you find this useful, give it a ⭐ — it helps others discover it.

demo

Install

npx claude-plugins

Or clone:

git clone https://github.com/sxrxvxnn/claude-plugins
cd claude-plugins && node install.js

Restart Claude Code after installing.


Plugins

🛡️ guardian — Security Hooks

Blocks dangerous bash commands before they run. Detects secrets in file writes.

Blocks:

  • rm -rf on system/home paths
  • curl ... | bash (pipe to shell)
  • Force push to main/master
  • Writing API keys, private keys, JWT tokens to source files
  • Disk wipe commands (dd, mkfs)
  • Fork bombs

Warns:

  • sudo rm, DROP TABLE, git reset --hard, git clean -f
🛡️  GUARDIAN BLOCKED: curl pipe to shell blocked — download and inspect first

Command: curl https://example.com/install.sh | bash

💰 cost — Token Cost Tracker

Tracks every tool call and estimates your Claude API cost per session.

💰 Session: 23 tool calls · ~48,200 tokens · $0.0821 · 14min

Generate a report:

claude-cost today
claude-cost all
claude-cost date 2026-07-28

⚡ flow — Workflow Automation

macOS notification when Claude finishes a long task. Session summary on stop.

✅ Claude done — 31 tool calls · $0.0943 today

⚡ flow — auto-commit option

Set CLAUDE_FLOW_AUTO_COMMIT=1 in your shell to auto-commit all changes when Claude stops:

export CLAUDE_FLOW_AUTO_COMMIT=1

Uninstall

npx claude-plugins --uninstall

Requirements

  • Node.js 18+
  • Claude Code
  • macOS (flow notifications use osascript)

How hooks work

Claude Code fires hooks at lifecycle events. Hooks receive JSON on stdin, exit 0 to allow, exit 2 to block (PreToolUse only).

PreToolUse  → runs before every tool call    → can block
PostToolUse → runs after every tool call     → informational
Stop        → runs when Claude stops         → informational

Hook config lives in ~/.claude/settings.json. The installer merges safely — existing hooks are never overwritten.


Writing your own hook

// my-hook.js
let input = '';
process.stdin.on('data', chunk => { input += chunk; });
process.stdin.on('error', () => process.exit(0));
process.stdin.on('end', () => {
  const data = JSON.parse(input);
  const command = data.tool_input?.command || '';
  
  if (command.includes('something-dangerous')) {
    process.stderr.write('Blocked: reason\n');
    process.exit(2); // block
  }
  
  process.exit(0); // allow
});

Add to ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{ "type": "command", "command": "node /path/to/my-hook.js" }]
      }
    ]
  }
}

Community plugins

Built a hook? Open a PR to add it here.

Plugin What it does Author
caveman Terse response mode for Claude @JuliusBrussee
guardian Block dangerous commands + secret detection @sxrxvxnn
cost Token cost tracking per session @sxrxvxnn
flow macOS notifications on stop @sxrxvxnn

Contributing

Open an issue or PR. Ideas welcome:

  • Git commit message generator hook
  • Slack/Discord notification on stop
  • Auto-commit after every session
  • Windows notification support (flow)
  • Custom block lists for guardian

Related

  • mac-ssd-toolkit — Use an external SSD as your Mac's primary storage with 27 automation scripts and terminal menus

License

MIT

About

Security, cost tracking, and workflow hooks for Claude Code

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages