Claude Code Hooks & Automation (40)
Builds and tests a 30-line Claude Code mod (v2.1.287+) that refuses Edit and Write calls outside the task's git worktree.
GitGuardian explains using ggshield AI hooks to scan prompts, commands, file reads, MCP calls and outputs for secrets in Claude Code, Cursor and Codex.
An experiment showing a failing check got a Claude Code agent to clear its to-automate list far faster than a warning did.
A headless Claude Code pattern where the agent asks a question in a ticket, exits, and resumes with claude -p --resume once answered.
A test showing a deliberately crashing safety hook did not stop Claude Code from running the command, and what that means for guardrails.
A Bash(git push:*) deny rule missed several push variants, while a git pre-push hook caught them all.
A test showing Read deny rules for secrets and .env still let 4 of 11 access routes through, such as grep -r and Python one-liners.
How the author built a deploy gate so an autonomous Claude Code agent can merge and ship to production safely.
Hooks the author built to stop Claude Code from "fixing" failing tests by editing the expected values.
A guide to Claude Code hooks, hook events and telemetry for controlling what the agent sees and reports.
A verification loop that keeps Claude Code from declaring a task done until security checks (like no hardcoded keys) pass.
Executable playbooks: a file-based delivery procedure that turns workflow preconditions into checks for Claude Code and Codex.
A test of how many ways to git push got past a single Bash(git push:*) deny rule in .claude/settings.json.
A comparison of a CLAUDE.md rule versus a PreToolUse hook for protecting files, including what happens when the user "authorizes" a bypass.
A 60-second test for whether your Claude Code hooks actually fire on Windows, plus common reasons they don't.
Pitfalls found while auto-logging subagent runs with a Stop hook, and how the data cut weekly cost.
How a human-triggered "@claude review" GitHub Actions workflow was locked down to read-only, bounded reviews.
Moving grep-able coding rules from prompts into Claude Code hooks so they are enforced every time.
Graft, a set of Claude Code hooks that cut grep-related token use by about 42%.
A postmortem on an orchestration skill that burned 1-2M tokens per task, fixed with a budget-enforcing PreToolUse hook.
A 60-line PreToolUse hook that blocks Claude Code from editing your .env file.
How the author auto-resumes rate-limited Claude Code sessions with a PROGRESS.md file and retries.
A five-line hook config that plays a sound when Claude Code finishes or needs your input.
Five patterns for running Claude Code as a 24/7 worker without babysitting every run.
A Claude Code hook that automatically rewrites each prompt into a better-engineered one.
A PreToolUse hook that sandboxes Claude Code by checking what each command will actually do.
Forcing red-green-refactor TDD in Claude Code with hooks and CLAUDE.md rules.
Debugging a Windows Claude Code hook that silently dropped every Korean character.
A Python utility package for building Claude Code hooks.
Why the author moved rules out of CLAUDE.md and into hooks that enforce them.
The difference between hooks and skills in Claude, and why enforcement belongs in hooks.
A non-developer's framework for running Claude Code 24/7 on an old MacBook for six months.
Using Claude Code Routines to tune an open-source CLI's performance every few hours, with the prompt and benchmark setup.
How to build provider-agnostic quality gates that survive switching away from any one AI coding tool.
EvanFlow, a TDD-driven feedback loop for Claude Code.
Putting a solo developer's daily morning routine on autopilot with Claude Code's scheduling.
Why test-driven development was the one Claude Code workflow that stuck for the author.
Calling MCP tools directly from Claude Code hooks instead of spawning a subprocess each time.
Wiring Claude Code directly into a CI/CD deployment pipeline.
A hook-based CLI wrapper that compressed Claude Code command output and saved about two-thirds of tokens.