Back to all resources
RESOURCE LIVE

Set Claude Code up once so it never nukes your repo.

Default Claude Code works. Production Claude Code needs an operator manual, permission tiers, hooks and a guardrail that stops the destructive command before it runs. This is the exact config I ship in every repo, with the reasoning for each line.

Raj Singh By Raj Singh · August 2026 · 8 min read
THE GUARDRAIL, WORKINGWhat a blocked command looks like from the inside
hooks · pre-tool-use
BLOCKED · 0.1s
Proposed — rm -rf on a path outside the repo root.
Rule matched — destructive-path-guard. Denied before execution.
Returned — Agent told why, offered the scoped command instead.
The guardrail runs before the command, not after.0 destructive runs
THE TELL

The default config trusts the agent more than you do.

  • Out of the box Claude Code has no operator manual, so it guesses your conventions and guesses differently in every repo.
  • Every team rebuilds the same setup from scratch. Months of small corrections that nobody writes down and nobody hands over.
  • One over-broad permission and an agent runs something destructive outside the repo. You need the block to happen before execution, not a rollback after it.
  • Locking it down too hard is its own failure. An agent that asks permission for everything is an agent you stop using by Thursday.
WHAT'S INSIDE

Five files. Every repo. Same setup.

  • 01
    The install that sticks
    npm against brew, the environment variables that actually matter, and which model to pin so behaviour stops drifting between sessions.
  • 02
    CLAUDE.md
    The operator manual every repo should ship with, and the structure that keeps it useful past week one instead of going stale.
  • 03
    Permission tiers
    Three tiers that let agents move quickly on safe work while everything irreversible stops for a human.
  • 04
    Hooks that block
    Pre-execution hooks that catch the destructive command before it runs, with the exact matchers I use in production.
  • 05
    The guardrail set
    The full guardrail file, plus the four incidents that put each rule in it.
BUILT FOR

You, if every repo gets a slightly different Claude.

If you run Claude Code across more than one project and the setup has quietly diverged in each, this is the shared baseline. Drop the files in, adjust the permission tier, done in twenty minutes.

Why now Hooks and granular permissions arrived recently enough that most published setups predate them. Configs written a year ago are missing the layer that makes agents safe to leave alone.

The payoff is that you stop supervising. When the guardrail is doing the watching, you can hand an agent a real task and go do something else, which is the entire point of running one.

Close-up of hands typing on a backlit mechanical keyboard
Photo: Tima Miroshnichenko / Pexels
Get the resource

Drop your email, get the full tool.

One email. Instant access. No sequence, no upsell, no list-trap. I'll only ping you if I ship something that fits.

One email. No follow-up unless I ship something that fits.

The kit: five files that turn a fresh Claude Code install into one that never guesses your conventions and never runs the destructive command before you've seen it.

  • install-that-sticks.md is npm versus brew, the environment variables that actually matter, and which model to pin so behavior stops drifting between sessions.
  • CLAUDE.md is the operator manual every repo should ship with, structured to stay useful past week one instead of going stale.
  • permission-tiers.md is the three tiers that let agents move fast on safe work while everything irreversible stops for a human.
  • hooks-that-block.md is the pre-execution hooks that catch a destructive command before it runs, with the exact matchers I use in production.
  • Claude Code 1.0+ installed — npm or the native installer, the guide covers both
  • A repo you're willing to test hooks against before you trust them in production
  • 5 minutes for CLAUDE.md, 15 for the permission tiers and hooks together
  • Bonus: the guardrail set, plus the four real incidents that put each rule in it

↑ Unlocks the moment you submit the form above.

RS
WRITTEN BY

Raj Singh

I'm Raj Singh, founder of DebtOps.ai and a Claude certified partner. Over the last five years I've managed $25M in ads, built AI solutions for Fortune 100 companies, and installed AI operating systems and AI brains inside small businesses. Everything here is something I've shipped, debugged, or watched a client ship. My goal with AgileSingh is to make you irreplaceable in this AI age.

$25M
Ads managed · 5 yrs
F100
Enterprise AI builds
Claude
Certified partner
18
Guides shipped
More guides

Now teach it things that stick.

A configured Claude is the starting line. Skills are how it compounds, and the agent swarm guide is how you run more than one. Browse the library, or pin a slot and I will set your repo up with you.