Claude Code Setup Playbook — Risks & Habits
CP — 10
Risks & Habits
Read time3 min
SectionClaude Code Setup Playbook
01 — risks & habits
Common risks
| Risk | What it looks like | What to do |
|---|---|---|
| Secrets in context | The agent reads .env or pastes a token into a task file | Git-ignore .env*, deny Read(./.env*), keep tokens out of docs |
| Over-broad permissions | Bash(git *) allows force-push | Allow specific verbs, put push, merge and reset in ask |
| Hooks that never run | Script exists, but isn't registered where Claude Code looks | Test through the real agent, check /hooks |
| Slow hooks | Every command waits on a package manager | Time them, call node directly, keep timeouts short |
| CLAUDE.md bloat | Grows by a few lines every week | Cap it near 200 lines, move detail into rules and skills |
| Stale docs | Agent follows guidance that no longer matches the code | Delete what you can't keep current |
| Silent rule failure | Bad frontmatter makes a rule load everywhere or nowhere | CI check on the first line of every rule file |
| Powerful subagents | A "reviewer" with write access | List tools explicitly |
| Overlapping skills | Two skills match one request | Merge them or sharpen the descriptions |
| Supply chain | curl | sh in setup scripts, unread third-party skills | Pin versions, read before installing |
| Contradicting rules | Two files give two answers | One home per policy, link to it |
02 — risks & habits
Where to spend your time
In rough order of return:
- CLAUDE.md with commands and a "never" list. Smallest effort, used every session.
- Git hooks and CI. They protect against every agent and every human.
- Rule plus lint pairing. Turns an opinion into a red build.
- A product-truth doc and a habit of updating it first. Stops the agent building to stale intent.
- A few hard blocks for irreversible actions. Schema changes, merges to protected branches, production builds. Add each one after a real incident, not before.
- A read-only scout and a commit skill. Small, and used daily.
- 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.