karanb192/claude-code-hooks

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

What it solves

Claude Code and similar AI agents have the autonomy to run shell commands, edit files, and install packages. This project provides a set of runtime guardrails and automation tools (hooks) to enforce the principle of least privilege, preventing agents from accidentally or maliciously executing dangerous commands, exfiltrating secrets, or tampering with their own configuration.

How it works

The project implements a marketplace of plugins that act as hooks. These hooks run as separate processes outside the model's control, making them resistant to prompt injection. They intercept tool calls via PreToolUse (to allow, deny, or modify an action before it happens) and PostToolUse (to react to the result of an action). It also utilizes other event triggers like SessionStart, SessionEnd, and ConfigChange to manage session context and monitor configuration changes.

Who it’s for

Developers using Claude Code who want to add safety layers, audit logs, and productivity automation to their AI-driven development workflow.

Highlights

  • Safety Guards: Blocks dangerous shell commands (e.g., rm -rf, curl | sh), prevents secret exfiltration from .env files, and protects against "fake green" tests by blocking the deletion or disabling of tests.
  • Sesssion Management: Includes a session logger for durable markdown logs and a "standup autopilot" that generates daily standups from agent activity.
  • Configuration Protection: Prevents the agent from tampering with its own guardrail settings and monitors for out-of-band configuration changes.
  • Instruction Auditing: Scans loaded instruction files (like CLAUDE.md) for hidden hostile directives or Unicode smuggling.
  • Developer Utilities: Provides tools for auto-formatting code, auto-staging git changes, and tracking context costs per file.

Related

  • Project
  • Project
  • Project
  • Project
  • Project