An Empty Variable and rm -rf: How Claude Code's Auto Mode Preflight Saved My Late-Night Cleanup
One night I let Claude Code sweep the build caches out of several app repositories at once, and an empty variable nearly turned a targeted cleanup into a wide delete. Here is the field record of being saved by auto mode's rm -rf preflight, and the confirmation rules I built afterward.
Stopping Claude Code Before It Runs a Destructive Command — a PreToolUse Screening Hook
How I wired a PreToolUse hook that screens every Bash command Claude Code is about to run: the settings.json setup, the Python screening script, what exit code 2 really does, and the false positives I tuned out over several weeks.
Installing Safety Valves in Claude Agents: A Three-Layer Kill-Switch Design for Solo Operators
A design record from a real production incident — three hours of runaway retries that cost $32 — that led me to rebuild every Claude agent with a three-layer kill switch: in-process guards, platform-level kill flags on Cloudflare KV, and an observer worker that catches the warning signs within three minutes. Working TypeScript and operational metrics included.
Building Production Conversational AI with Claude API — Context Management, Long-Term Memory, and Safety Filters
Solve context explosion, memory loss, and safety risks in production chat systems with a three-layer memory architecture and integrated guardrails using Claude API