Claude Code Setup Playbook — Risks & Habits
CP — 10

Risks & Habits

Read time3 min
SectionClaude Code Setup Playbook
01 — risks & habits

Common risks

RiskWhat it looks likeWhat to do
Secrets in contextThe agent reads .env or pastes a token into a task fileGit-ignore .env*, deny Read(./.env*), keep tokens out of docs
Over-broad permissionsBash(git *) allows force-pushAllow specific verbs, put push, merge and reset in ask
Hooks that never runScript exists, but isn't registered where Claude Code looksTest through the real agent, check /hooks
Slow hooksEvery command waits on a package managerTime them, call node directly, keep timeouts short
CLAUDE.md bloatGrows by a few lines every weekCap it near 200 lines, move detail into rules and skills
Stale docsAgent follows guidance that no longer matches the codeDelete what you can't keep current
Silent rule failureBad frontmatter makes a rule load everywhere or nowhereCI check on the first line of every rule file
Powerful subagentsA "reviewer" with write accessList tools explicitly
Overlapping skillsTwo skills match one requestMerge them or sharpen the descriptions
Supply chaincurl | sh in setup scripts, unread third-party skillsPin versions, read before installing
Contradicting rulesTwo files give two answersOne home per policy, link to it
02 — risks & habits

Where to spend your time

In rough order of return:

  1. CLAUDE.md with commands and a "never" list. Smallest effort, used every session.
  2. Git hooks and CI. They protect against every agent and every human.
  3. Rule plus lint pairing. Turns an opinion into a red build.
  4. A product-truth doc and a habit of updating it first. Stops the agent building to stale intent.
  5. A few hard blocks for irreversible actions. Schema changes, merges to protected branches, production builds. Add each one after a real incident, not before.
  6. A read-only scout and a commit skill. Small, and used daily.
  7. Task workflow with an evidence gate. Valuable, but it takes ongoing work to maintain.

Lower return: supporting several agent tools from one hook registry (unless you really use several), custom workflow languages, and committing large third-party skill bundles into your repo.

03 — risks & habits

Anti-patterns

  • Documentation as memory. Generating a big tree of technical docs for the agent to read. It goes stale and the agent trusts it. Keep docs that humans own and let code be the reference for the rest.
  • Config nobody runs. Hooks and rules that exist as files but never load.
  • Click-to-allow drift. A local settings file that is a log of every command anyone ever approved.
  • Prose where a lint rule would do. If you've written "never do X" three times, write the rule.
  • Duplicate skills "just in case".
  • Enforcement on one tool only, with nobody told.
  • Skipping the gates for speed. Fine as a one-off choice. Dangerous as a habit.