karanb192/claude-code-hooks

🪝 Claude Code hooks + an installable plugin marketplace: safety, cost, observability, productivity.

What it solves

Claude Code and similar AI agents can autonomously run shell commands, edit files, and install packages. This project provides a safety and management layer that enforces "least privilege" on these agents, preventing accidental or malicious actions like secret exfiltration, dangerous command execution, or unauthorized configuration changes.

How it works

These hooks act as a gatekeeper that intercepts every tool call an agent makes. Because they run as separate processes outside the AI model, they cannot be bypassed by prompt injection. Each hook is triggered by specific events (like PreToolUse or SessionStart) to either allow, deny, or modify the agent's actions based on your security settings.

Who it’s for

This is for developers using Claude Code who want to automate tasks while maintaining strict control over what the AI is allowed to do on their local machine or within their codebase.

Highlights

  • Safety Guards: Blocks dangerous commands (e.g., rm -rf), protects sensitive files like .env, and prevents the agent from tampering with its own security configuration.
  • Easy Installation: Shipped as a 22-plugin marketplace; you can add the entire collection with one command and install only the specific hooks you need.
  • Operational Insights: Includes tools for logging sessions, tracking context costs, generating daily standups, and auditing rule compliance.
  • Flexible Enforcement: Supports "ask mode" where the agent prompts you for permission instead of outright blocking an action.
  • Standalone Capability: While designed as plugins, every hook script can also be used as a standalone file if you prefer manual configuration.

Related

  • Project
  • Project
  • Project
  • Project
  • Project