Claude Code, Dialed In: Practical Playbooks for Agentic Coding at Scale
by Arun Munaganti
Why Claude Code (and why now)
Claude Code turns your terminal into a disciplined pair-engineer: it reads your repo, proposes patches, runs commands with your permission, and learns your house rules. Used well, it’s not “autocomplete”—it’s an agentic teammate that plans, edits, verifies, and documents.
Goal of this post: a field guide to using Claude effectively on real projects, especially complex/monorepo setups—covering
.mdmemory files, safe permissions, multi-agent parallel work, and routines that keep agents fast and reliable.
A minimal, reliable setup
1) Install + login (once)
npm i -g @anthropic-ai/claude-code(or native installer from docs)- Run
claude→/login(Claude.ai or Console). - Keep projects under git. Claude’s guardrails work best with version control.
2) Give Claude a brain: CLAUDE.md
Create a file that Claude automatically pulls into context:
Where it lives (priority top→down):
~/.claude/CLAUDE.md(global defaults)- Repo root
CLAUDE.md(team rules) - Per-package or subfolder
CLAUDE.md(component rules)
What to put inside (short, atomic rules):
- Commands:
npm run build,pnpm test -r --filter my-pkg - Style: “Use ES modules only”, “Prefer zod for validation”
- Workflow: “Always run typecheck before commit”
- Test tips: “Unit tests use Vitest; avoid global mocks”
- Gotchas: “Don’t touch
/generated— codegen overwrites”
Tip: Use the
#hotkey inside Claude to append new rules directly into the relevantCLAUDE.mdwhile you’re working. Keep it terse.
3) Keep decisions visible
Add two tiny docs in the repo root:
| File | Contents (short!) |
|---|---|
PLAN.md |
Today’s objectives, constraints, DOD |
DECISIONS.md |
Reversible vs. irreversible decisions |
Claude will respect these if you reference them (“follow PLAN.md”).
4) Tighten permissions
Claude asks before edits/commands. Make it safer & smoother:
- Start in Suggest mode. Escalate to Auto-edit for bulk refactors.
- Use
/permissionsto allowlist safe tools once (e.g., “Edit”,git commit). - Check in
.claude/settings.jsonwith allowed tools for the repo.
Example (put in .claude/settings.json):
{
"allowedTools": ["Edit", "Bash(git add:*)", "Bash(git commit:*)", "Bash(pnpm:*)"],
"statusLine": { "showModel": true, "showLatency": true }
}
Agent routines that scale
The P-B-R loop: Planner → Builder → Reviewer
Run three Claude sessions (tabs) on medium+ tasks:
- Planner (root): reads
PLAN.md, proposes a milestone plan, assigns sub-tasks. - Builder (package/subdir): implements scoped changes behind a feature branch.
- Reviewer (root): runs tests/linters, proposes smaller patches, drafts PR text.
Branch hygiene
feat/payments-v2/ *per sub-task- Commits early/often; Reviewer enforces
pnpm -r test, typecheck, ESLint.
The “Bounded Context” pattern for monorepos
Split work by stable boundaries (e.g., apps/web, packages/api, packages/ui).
Run one Claude per boundary with its own CLAUDE.md. Scope instructions and allowlists to that folder only. Result: faster context builds, fewer accidental cross-edits.
The “Checklist First” habit
Before implementation, ask Planner to generate:
-
checklists/feature_X.mdwith steps:- “Update DTOs”
- “Migrate schema”
- “Add negative tests”
- “Update docs, examples” Claude then ticks items and keeps progress visible.
Working in parallel with multiple Claude agents
Model for parallelism
- One terminal pane/tab per agent (tmux/iTerm panes help)
- One agent = one scope (folder +
CLAUDE.md+ branch) - One owner per agent to approve edits/commands
What to parallelize
- Independent packages (ui, api, worker)
- Docs + tests while implementation runs
- Migrations in a sandboxed container while UI work proceeds
Coordination checklist
- Shared
PLAN.mdties outcomes together - Each agent writes a tiny
SUMMARY.mdin its folder (what changed, how to test) - Reviewer agent composes a cohesive PR (changelog + test plan)
Patterns for complex projects
1) Guard the blast radius
- Put risky steps behind scripts:
scripts/migrate.sh,scripts/seed.sh - In
CLAUDE.md: “Use scripts, never inline destructive SQL” - Add a
sandbox/devcontainer (Dockerfile +docker-compose.yml) and tell Claude to run heavy tasks there
2) Progressive disclosure of context
-
Keep
CLAUDE.mdshort; link to deeper docs:@docs/style/react.md@docs/api/contracts.md
-
Ask Claude to fetch docs on demand rather than pulling the entire tree.
3) Contract-first development
- Store OpenAPI/GraphQL schema under
contracts/ - Instruct Claude: “Never change contracts without updating
CHANGELOG.mdand regenerating clients”
4) Test pyramids Claude can follow
- Co-locate tests (
*.spec.ts) next to code - Add “golden” fixtures in
/testdata -
Put test commands in
CLAUDE.mdwith performance guidance:- “Prefer
pnpm test -r --filter uiover full test runs”
- “Prefer
Claude command playbook (daily use)
| Task | Ask Claude to… |
|---|---|
| Understand repo | “Explain the architecture and entrypoints.” |
| Create plan | “Draft PLAN.md for feature X with milestones + DOD.” |
| Enforce rules | “Read CLAUDE.md and follow the style + commit etiquette.” |
| Scoped refactor | “In packages/ui, migrate Button props; update stories.” |
| Safe bulk edit | “Propose patches, then apply in Auto-edit once reviewed.” |
| Tests first | “Write failing tests in api for the new validation.” |
| PR drafting | “Summarize changes + risks; propose PR title & body.” |
| Post-merge chores | “Update DECISIONS.md & CHANGELOG.md for this feature.” |
Use Suggest mode by default. Switch to Auto-edit for repetitive local edits after you’ve skimmed the diffs. Keep Full-auto for sandboxes/devcontainers.
File conventions that make Claude sharp
| File | Purpose | Notes |
|---|---|---|
CLAUDE.md |
Rules, commands, style, gotchas | One per boundary (root/packages) |
PLAN.md |
Today’s goals + DOD | Reset daily; keep it short |
DECISIONS.md |
Decision log (link PRs) | “R-2025-08-26: Switched to Zod” |
checklists/ *.md |
Implementation steps Claude can tick | 5–10 items max |
SUMMARY.md |
Per-agent outcome in each folder | What changed + how to verify |
.claude/settings.json |
Allowed tools, status line, model | Commit to share on team |
docs/ ** |
Deep details (@ import from CLAUDE.md) |
Don’t flood CLAUDE.md |
Speed, cost, and quality tips
- Short prompts beat long essays. Use bullets, not paragraphs.
- Name targets explicitly. “Edit only
packages/cart/ **,” “Don’t touch/generated.” - Teach once, reuse. Add recurring instructions via the
#hotkey toCLAUDE.md. - Precompute. Expose scripts for typecheck, test selection, codegen—Claude will call them.
- Fail fast. If an approach stalls, ask Planner to propose 2–3 alternates; pick one.
- Always under git. Review diffs often; never approve large patches blind.
- Sandbox heavy ops. Docker/devcontainer for migrations, scraping, headless browsers.
Example: parallel feature push (90-minute window)
- Planner (root): reads
PLAN.md→ splits work intoui,api,worker. - Builder-UI (packages/ui): implements component API change + stories.
- Builder-API (packages/api): adds DTO + validation + route tests.
- Reviewer (root): runs typecheck/tests, collects summaries, drafts PR.
- Merge: Reviewer composes one PR with
SUMMARY.mdacross packages.
Each Builder has its own pane, branch, CLAUDE.md, and narrow permissions.
Common pitfalls (and fixes)
-
Claude keeps proposing off-style code Add 3–5 concrete rules to
CLAUDE.mdwith “IMPORTANT:” and an example snippet. -
Agent reads too much / gets slow Move long docs to
docs/and import them (@docs/x.md). KeepCLAUDE.mdsnack-sized. -
Risky shell commands Force through scripts; allowlist only
git add/commit+ project scripts. -
Conflicting edits across agents Boundaries per folder + branches; Reviewer merges; Planner updates
PLAN.md.