Solo Stack Kits Directory
Claude Code workflows & skills for solo consultants and freelancers

Claude Code Hooks & Automation (29)

How to Replace an n8n Workflow with Claude Code (Step by Step)

A step-by-step walkthrough of replacing a self-hosted n8n webhook with a code route built by Claude Code, and when to keep n8n or Zapier instead.
@tariq_osmani · dev.to · 2026-11-03 · Hooks & Automation · #

Fine-tuning a 322M Model for Coding Agent Safety: What 3 Runs and 2 Failures Taught Me

Walkthrough of fine-tuning the 322M-parameter Laya model behind laya-guard, a hook that screens Claude Code, Cursor and Codex shell commands with rules first and the model for allow, review or block calls, across three training runs.
@scs0209 · dev.to · 2026-11-02 · Hooks & Automation · #

How to write a Claude Code hook that cannot steer your agent

Using the ccdeck dashboard's hook as the example, lists every way a Claude Code hook can affect the agent (JSON stdout, exit code 2, other non-zero exits, plain stdout on some events) and how to close and test each so a watch-only hook stays read-only.
@bargan · dev.to · 2026-10-29 · Hooks & Automation · #

I built a tool to catch agents saying "tests pass" without proof. It was wrong 43 times out of 46.

A week of logging Claude Code and Codex sessions with a plugin that checks each 'tests pass' claim against what the agent actually ran: 948 claims, 315 flagged, and only 3 of 46 hand-checked flags held up.
@vitalii_serbyn_bb456e7e80 · dev.to · 2026-10-25 · Hooks & Automation · #

Our Claude Code hook blocked open with a URL but not open "$u" in a for loop, and 9 pages opened in the wrong profile

A team's PreToolUse hook missed an open "$u" loop that sent nine links to the wrong browser profile, and they rewrote it to block unreadable open targets, checked against 59,145 past commands.
@rulestack · dev.to · 2026-10-19 · Hooks & Automation · #

How I work with Claude Code: memory, gates and the mistakes that built them

A real-project Claude Code setup where CLAUDE.md routes into a wiki, hooks restore rules after compaction, corrections become rules and then tests, and typecheck, tests, e2e, Lighthouse and screenshots gate 'done'.
@muchassak · dev.to · 2026-10-18 · Hooks & Automation · #

Your First Claude Code Mod: Block Edits Outside the Task's Worktree in 30 Lines

Builds and tests a 30-line Claude Code mod (v2.1.287+) that refuses Edit and Write calls outside the task's git worktree.
@gabrielanhaia · dev.to · 2026-10-17 · Hooks & Automation · #

AI Hooks for Claude Code, Cursor, and Codex: Block Secrets Before Agents Can Use Them

GitGuardian explains using ggshield AI hooks to scan prompts, commands, file reads, MCP calls and outputs for secrets in Claude Code, Cursor and Codex.
@dwayne_mcdaniel · dev.to · 2026-10-14 · Hooks & Automation · #

With a warning, our Claude Code agent's to-automate list sat open 8.2 days. With a failing test, 6 minutes. What works for you?

An experiment showing a failing check got a Claude Code agent to clear its to-automate list far faster than a warning did.
@rulestack · dev.to · 2026-10-08 · Hooks & Automation · #

Headless Claude Code asks, exits, then resumes on the answer

A headless Claude Code pattern where the agent asks a question in a ticket, exits, and resumes with claude -p --resume once answered.
@panthpatel · dev.to · 2026-10-05 · Hooks & Automation · #

I wrote a safety mod that crashes on purpose. Claude Code ran the command anyway.

A test showing a deliberately crashing safety hook did not stop Claude Code from running the command, and what that means for guardrails.
@aidiveyt · dev.to · 2026-10-05 · Hooks & Automation · #

Claude Code's Read deny rules let 4 of 11 routes through: grep -r, a Python one-liner and two CLAUDE.md @imports

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.
@rulestack · dev.to · 2026-10-02 · Hooks & Automation · #

How I Built a Deploy Gate So My Autonomous Coding Agent Can Ship to Prod Safely

How the author built a deploy gate so an autonomous Claude Code agent can merge and ship to production safely.
@yureki_lab · dev.to · 2026-10-01 · Hooks & Automation · #

My agent changed `toBe(10)` to `toBe(9)` and called it done. I built hooks to stop that

Hooks the author built to stop Claude Code from "fixing" failing tests by editing the expected values.
@haoli · dev.to · 2026-09-30 · Hooks & Automation · #

Progressive Disclosure: Claude Code Hooks, Events and Telemetry

A guide to Claude Code hooks, hook events and telemetry for controlling what the agent sees and reports.
@cleverhoods · dev.to · 2026-09-30 · Hooks & Automation · #

Claude Can't Say "Done" Until the Code Is Safe: A Security Verification Loop for Claude Code

A verification loop that keeps Claude Code from declaring a task done until security checks (like no hardcoded keys) pass.
@thesnehamk · dev.to · 2026-09-28 · Hooks & Automation · #

The Real Reason AI Ignores Existing Decisions — Designing an ADR Context Auto-Injection Hook

A developer explains a Claude Code hook that injects an index of accepted Architecture Decision Records from docs/adr/ into context, and is candid that it only delivers the list rather than guaranteeing the model follows the decisions.
@uehara · dev.to · 2026-09-28 · Hooks & Automation · #

Claude Code permission rules: Bash(git push:*) stopped 8 of 14 ways to push, and 5 reached the remote

A test of how many ways to git push got past a single Bash(git push:*) deny rule in .claude/settings.json.
@rulestack · dev.to · 2026-09-24 · Hooks & Automation · #

CLAUDE.md rule vs PreToolUse hook: both held 5 of 5, then the user said 'I authorize it'

A comparison of a CLAUDE.md rule versus a PreToolUse hook for protecting files, including what happens when the user "authorizes" a bypass.
@rulestack · dev.to · 2026-09-21 · Hooks & Automation · #

Your Claude Code hooks probably don't fire on Windows — a 60-second test and the nine ways they fail open

A 60-second test for whether your Claude Code hooks actually fire on Windows, plus common reasons they don't.
@suyann · dev.to · 2026-09-17 · Hooks & Automation · #

12 Pitfalls I Hit Auto-Logging Claude Code Subagents with a Stop Hook (and How the Numbers Cut My Weekly Cost 15–20%)

Pitfalls found while auto-logging subagent runs with a Stop hook, and how the data cut weekly cost.
@bokuwalily · dev.to · 2026-09-11 · Hooks & Automation · #

Hardening a manual Claude Code review workflow in GitHub Actions

How a human-triggered "@claude review" GitHub Actions workflow was locked down to read-only, bounded reviews.
@jonesrussell · dev.to · 2026-09-02 · Hooks & Automation · #

Stop asking your AI agent to follow rules. Enforce them.

Moving grep-able coding rules from prompts into Claude Code hooks so they are enforced every time.
@toffy · dev.to · 2026-08-25 · Hooks & Automation · #

Show HN: Graft – Claude Code hooks that cut grep tokens by 42%

Graft, a set of Claude Code hooks that cut grep-related token use by about 42%.
shrishdwi · Hacker News · 2026-08-14 · Hooks & Automation · #

Show HN: A 60-line PreToolUse hook that stops Claude Code from editing your .env

A 60-line PreToolUse hook that blocks Claude Code from editing your .env file.
gaiinmaster · Hacker News · 2026-07-27 · Hooks & Automation · #

How I Auto-Resume a Rate-Limited Claude Code Session with PROGRESS.md and Retries

How the author auto-resumes rate-limited Claude Code sessions with a PROGRESS.md file and retries.
@bokuwalily · dev.to · 2026-07-17 · Hooks & Automation · #

Show HN: Policy enforcement for Claude Code, Cursor, and Codex

Show HN for Kastra, which intercepts tool calls from Claude Code, Cursor, Codex and OpenClaw and checks them against deterministic allow, hold or deny policies before they run, with an audit trail.
carlosjimenez1 · Hacker News · 2026-07-09 · Hooks & Automation · #

Claude Code TDD: Force Red-Green-Refactor with Hooks & CLAUDE.md (2026)

Forcing red-green-refactor TDD in Claude Code with hooks and CLAUDE.md rules.
@stacknotice · dev.to · 2026-06-11 · Hooks & Automation · #

My Claude Code hook silently ate every Korean character, and it took me an hour to figure out why

Debugging a Windows Claude Code hook that silently dropped every Korean character.
@codingjhj · dev.to · 2026-06-06 · Hooks & Automation · #

Want it set up already? Claude Code Power Config Pack

Like these workflows? Here is a tested Claude Code setup you can drop into any repo.

One install command that backs up your settings first. Checked against the official Claude Code docs. MIT licensed.

Launch price: $6 instead of $12 (code LAUNCH50, first 25 buyers, until Nov 10, 2026).

Get the Config Pack: $6 launch priceOr try 2 of the hooks free

Free on Gumroad: block-dangerous-bash and protect-secrets with a settings snippet. Enter $0; Gumroad asks for an email to deliver the zip.

Prefer to build it yourself? Use the free Claude Code tools, no sign-up.