By karanb192
Embeds a reviewer-facing provenance receipt into your PR body when Claude runs `gh pr create` (or `glab mr create`). A PostToolUse hook (async, zero added latency) records a per-session ledger — tool calls, agent-authored lines, and every test/typecheck command with its real exit code; a PreToolUse (Bash) hook then rewrites the --body on `gh pr create` with the real prompt count, estimated spend, test tally, and a truthful agent-vs-human authored-line split. Preview it anytime via /pr-provenance-stamp:provenance.
Based on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Executes bash commands
Hook triggers when Bash tool is used
Modifies files
Hook triggers on file write and edit operations
🪝 Ready-to-use hooks for Claude Code — plus a 7-plugin installable marketplace: safety, automation, notifications, and more.
| Protecting Secrets | Blocking Dangerous Commands |
|---|---|
![]() | ![]() |
A growing collection of tested, documented hooks you can copy, paste, and customize.
🔌 New: these hooks also install as one-command Claude Code plugins. Run
/plugin marketplace add karanb192/claude-code-hooks, then/plugin install <name>@claude-code-hooks— see Install as a plugin for the 7-plugin catalog.
Runs at session boundaries — inject context at SessionStart and capture outcomes at Stop / SessionEnd.
| Hook | Matcher | Description |
|---|---|---|
| session-logger | SessionStart + PostToolUse + SessionEnd | Writes a durable markdown log of every session (cwd, git repo, files touched, bash commands). PostToolUse registers with "async": true so logging never blocks Claude; concurrent writes are serialized with a file lock. Bash commands get best-effort secret redaction. Drop-in for Obsidian vaults via CC_SESSION_LOG_DIR. |
🔌
bounty-board(repo TODO/FIXME/HACK debt priced as aging XP bounties) now ships as an installable plugin — see Install as a plugin.
🔌
nerf-receipts(personal model-quality flight recorder) andstandup-autopilot(writes your daily standup from what your agents actually did; re-injects open blockers) now ship as installable plugins — see Install as a plugin.
Runs when the user submits a prompt, before Claude processes it. Can inject context or block the prompt.
🔌
dead-end-registry(remembers approaches you tried and reverted, then warns before you retry them) now ships as an installable plugin — see Install as a plugin.
Runs before Claude executes a tool. Can block or modify the operation.
| Hook | Matcher | Description |
|---|---|---|
| block-dangerous-commands | Bash | Blocks dangerous shell commands (rm -rf ~, fork bombs, curl|sh) |
| protect-secrets | Read|Edit|Write|Bash | Prevents reading/modifying/exfiltrating sensitive files |
| git-safety | Bash | Branch-aware git guardrails + destructive gh CLI protection |
| protect-tests | Bash|Edit|MultiEdit|Write | Stops "fake green": blocks deleting, renaming-away, or skip/xfail-disabling tests |
Runs after Claude executes a tool. Can react to results.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimnpx claudepluginhub karanb192/claude-code-hooks --plugin pr-provenance-stampTurns what your agents ACTUALLY did into a standup — captured from session transcripts (not commits/tickets, which miss uncommitted work, real test exit codes, and unresolved errors) and rolled up cross-repo. Stop/SessionEnd snapshot each session's outcome (task, branch + diffstat, tests + exit codes, PRs, blockers) to a local per-day ledger; SessionStart re-injects yesterday's unresolved blockers via additionalContext and prints a standup-ready card. Render today's card any time via /standup-autopilot:standup.
A personal flight recorder for Claude Code quality. Background hooks (async, zero added latency) record your own per-session signals keyed by model id and Claude Code version — tool-failure rate, same-file edit churn, turn-end counts, and tokens-per-completed-task. At your next SessionStart — or on demand via /nerf-receipts:receipts — it renders a trend card with sparklines and flags meaningful shifts that coincide with a model change, so the next time someone says "they nerfed it" you have data instead of vibes.
A per-file context-cost leaderboard for Claude Code. A PostToolUse hook (async, zero added latency) attributes every tool result's tokens to the file(s) it pulled into context; at SessionEnd — or on demand via /context-hogs:leaderboard — it renders your repo's most token-expensive files with estimated cost, so you know which files to trim.
A CLAUDE.md compliance flight-recorder for Claude Code. At SessionStart it parses CLAUDE.md into numbered atomic rules; on every Edit/MultiEdit/Write a PostToolUse hook (async, zero added latency) passively tallies how often each rule was relevant and whether it was followed or violated; at SessionEnd — or on demand via /dead-rules-audit:scorecard — it renders a worst-first compliance scorecard with a promote-to-hook hint for chronically-ignored rules. Zero deps, zero network, fully deterministic.
Approach-level negative-knowledge memory for Claude Code. Mines your transcripts (Stop/PreCompact, both async and zero added latency) for approaches you TRIED and then REVERTED — with the reason, date, and estimated token cost of the detour — into a per-repo registry. On UserPromptSubmit it injects a 'you already tried this' warning card when a new prompt matches a recorded dead end; on PreToolUse (Edit|Write) it asks before an edit reintroduces a previously-reverted hunk. Review the registry any time with /dead-end-registry:dead-ends.
Production safety hooks for autonomous Claude Code operation. Context monitoring, syntax checking, branch protection, activity logging, and more.
Comprehensive PR review agents specializing in comments, tests, error handling, type design, code quality, and code simplification
Claude Code hooks for enforcing best practices and workflow automation
A personal flight recorder for Claude Code quality. Background hooks (async, zero added latency) record your own per-session signals keyed by model id and Claude Code version — tool-failure rate, same-file edit churn, turn-end counts, and tokens-per-completed-task. At your next SessionStart — or on demand via /nerf-receipts:receipts — it renders a trend card with sparklines and flags meaningful shifts that coincide with a model change, so the next time someone says "they nerfed it" you have data instead of vibes.
Backpressure code review that validates changes against REVIEW.md before commits and session completion.
this is to analyze the PRs and solve the requested changes in them