A year into running Claude Code hooks in production, we've built about 20 hooks. Twelve are still active. Five got retired. The remaining three are on notice — we're watching to see if they're earning their keep. This post is the five that got cut and what we learned from each.
The failure modes are not the ones the "install these hooks" posts warn about. Every dead hook we shipped had a reasonable-sounding purpose. What killed them was something in the interaction between the hook, the workflow, and the humans using both.
Hook 1: The "commit message linter"
What it did: fired on PostToolUse for git commit operations, checked whether the commit message matched Conventional Commits format, warned if not.
Why we thought we needed it: consistent commit messages help with changelog generation, blame investigation, and general repo hygiene.
Why it failed: nobody read the warnings. The hook fired after the commit was already made, so "fixing" the message required a rebase — enough friction that most people just left the non-conformant message in place. The hook produced noise without behavior change.
Meta-lesson: hooks that fire AFTER an action can't change the outcome. If the goal is enforcement, the hook needs to be PRE-action or the enforcement needs to happen elsewhere (git hooks, CI). Post-action warnings train people to ignore hooks.
Post-hoc warnings are noise. If you want behavior to change, the intervention has to come before the behavior, not after.
Hook 2: The "always-on session logger"
What it did: fired on every tool use, logged the tool name and arguments to a structured log file for later analysis.
Why we thought we needed it: telemetry on what workflows people actually run, useful for prioritizing which subagents to build, which commands to promote.
Why it failed: the logs got read exactly twice. Both times, we found what we already knew (people use the tools we thought they used). Meanwhile, the log file grew to 40 MB per user per week, and the "analysis" was a script nobody had time to maintain.
Meta-lesson: gathering data you won't use is technical debt. Every log has a maintenance cost (storage, rotation, occasional questions from security). If you can't articulate a specific question the log will answer, don't collect it.
Hook 3: The "block writes outside of the PR scope"
What it did: when working on a PR branch, blocked file writes outside the files listed in the PR's "scope." Meant to enforce PR discipline — don't accidentally touch unrelated files.
Why we thought we needed it: PR scope discipline is a real thing; drift into unrelated files makes reviews harder and can hide risky changes.
Why it failed: the "scope" was never accurate. Files that legitimately needed to change (imports, generated files, config that references the changed code) got blocked. Users learned to disable the hook or override it, at which point the discipline was gone anyway. The hook was fighting a real problem with the wrong tool.
Meta-lesson: hooks that block legitimate work get bypassed. If bypassing becomes routine, the hook is worse than nothing (people also bypass it in the illegitimate cases). Discipline about PR scope is better handled at review time than at write time.
A hook that gets frequently bypassed teaches the team that hooks are things to work around, not to respect. This poisons the trust in ALL hooks. The bypass rate is a warning signal — even for hooks that aren't bypassed, teams lose confidence in the system.
Hook 4: The "explain what you just did" hook
What it did: fired on session end, asked Claude to summarize what got done in the session and post it to a shared Slack channel. Meant to increase team visibility into what people were working on.
Why we thought we needed it: cross-team visibility, "hey I'm working on the same thing" catches, general awareness.
Why it failed: the summaries were 30-60 seconds of Claude time per session (small but real cost). The Slack channel became a firehose that nobody watched. Turns out, most engineering work isn't interesting to your teammates in real time — they care about the outcome, not the process.
Meta-lesson: automating something optional doesn't make it valuable. If people weren't manually posting summaries to Slack (they weren't), automated summaries weren't going to solve anything. Automation makes existing valuable practices scale; it doesn't create value from nothing.
Hook 5: The "warn on unusually large writes"
What it did: if a single write operation exceeded 500 lines, warned the user and asked for confirmation. Meant to catch cases where Claude was generating way more code than intended.
Why we thought we needed it: sometimes Claude produces massive code dumps when asked for something small; catching this early prevents waste.
Why it failed: 500 lines is not unusual for a lot of legitimate work — a full test file, a generated data schema, an auto-formatted output. The threshold was tuned too tight; users mostly clicked "confirm" without reading. Making it looser meant it never fired. There was no threshold that separated "problematic large write" from "legitimate large write" reliably.
Meta-lesson: some interventions can't be automated because the signal is contextual. A 500-line write is fine or not depending on what the user was asking for — a check that doesn't know the intent can't make the right call. When automation can't distinguish signal from noise, human review is the only option.
What the survivors have in common
Looking at the twelve hooks still in production:
- They fire pre-action when the goal is prevention (block-secrets, block-force-push)
- They produce structured artifacts when the goal is observation (audit-log-write, cost-tracker) — meant to be queried, not just accumulated
- They have a clear right answer — "did this contain a credential?" is much clearer than "is this the right amount of code?"
- They're narrow — one thing, done well
- They rarely fire for the ones that block; when they fire, it's worth attention
- They don't require judgment the tool can't make
The dead ones violated one or more of these. Fired post-action. Produced data nobody queried. Required judgment the hook couldn't make. Blocked so often they got bypassed.
The design questions we now ask before adding a hook
When someone proposes a new hook, the discussion covers:
- Pre or post action? If post, is there a way to make it pre? If not, is the warning actually going to change behavior?
- What's the specific question this hook answers? Not "improve observability" — "when engineers spend more than $50 in a session, we want to know." Specific.
- What's the false positive rate we expect? If more than 20%, the hook will get bypassed.
- What happens when the hook is wrong? Blocking correctly is one failure mode; blocking incorrectly is another. Both need designed responses.
- Who owns iterating on this? Hooks rot without maintenance. Every hook needs an owner who'll tune it based on how it fires in production.
These questions kill about half the proposed hooks before we build them. That's a feature. Not building bad hooks is much cheaper than building them and then dealing with the fallout of retiring them.
The specific meta-lesson
Hooks that shipped and got retired were more expensive than hooks we never built. Each one took time to implement, time to socialize with the team, time to debug real-world failures, and eventually time to retire (with the reputational damage of "we tried this and it didn't work"). The cost of a wrong hook is not zero.
The right posture: bar-high for shipping new hooks. Every hook has to earn its place. If in doubt, don't ship it. You can always build it later; retiring a shipped hook is much harder than never building it.
For teams starting out with hooks: install a small number of proven ones (see the 12 hooks post), watch how they fire, and only add new ones when you've got specific evidence they'll solve a real problem. The temptation to build cute hooks is real; resist it.
Get cctk running in one command
85 slash commands, 12 subagents, 12 MCP integrations, 12 hooks. All the patterns from this post are shipped in cctk.