PreToolUse hooks as a seatbelt: no rm -rf, no push to main
Block risky commands with sandbox + PreToolUse hooks. Security engineer's Claude Code setup.
what to steal
Write one PreToolUse hook that blocks rm -rf and direct pushes to main.
Our takeaway from the source, not a quote.
lancini-security-hooks.toml
# Block risky commands with sandbox + PreToolUse hooks # source: https://blog.marcolancini.it/2026/blog-my-claude-code-setup/ [rig] who = "Security engineer's Claude Code setup" author = "Marco Lancini" date = "2026" harness = ["Claude Code"] models = [] [keep] - Sandbox enabled - PreToolUse hooks blocking rm -rf (use trash), direct push to main, docker/terraform/npm/pip - Plugins: context7, episodic-memory, agent-browser, pyright/typescript LSP, feature-dev, claude-md-management, code-simplifier, security-guidance, commit-commands, playwright [cut] - rm -rf - Direct push to main
| thing | status | why (per source) |
|---|---|---|
| rm -rf | blocked | Replaced with trash |
| Direct push to main | blocked | Guardrail hook |
Source: https://blog.marcolancini.it/2026/blog-my-claude-code-setup/ · checked 2026-10-14
// similar rigs
~/rigs/nadimtuhin-mac-controls-pc-r….toml2026-09-01
Laptop as control room, home PC as the engine
steal → Run agents on an always-on box behind one model gateway; reach it with zero open ports.
Claude CodeCodexPi Any model behind 9Rout
by Nadim Tuhin
~/rigs/domenic-vm-tailscale-yolo.toml2026-07-23
Full YOLO, but on a disposable VM
steal → Run with approvals off only on a machine you can wipe.
CodexClaude Code ChatGPT 5.6 SolClaude Fable 5 tmux over SSH
by Domenic Denicola
~/rigs/merlin-claude-manager-codex-….toml𝕏 · 2026-10-14
Claude manages, Codex grinds
steal → Use one model to plan architecture and another to churn through build steps.
Claude CodeCodex Claude Fable as manageGPT-6 Astra on Codex
by @Merlin412188240