Key Principle
Set up Claude Code so the right tokens go in and noise stays out, then work in tight explore→plan→code→verify loops. Every practice — specific prompts, @-references, CLI tools over MCP, skills over CLAUDE.md, subagents, fresh sessions — exists to keep the context window clean while scaling work out (chunk 014/015 through-line).
Why This Matters
Context is the scarce resource. A bloated CLAUDE.md makes Claude ignore real instructions; a long session carrying corrections performs worse than a fresh one with a sharper prompt. Getting setup and the daily loop right is the difference between Claude being a reliable collaborator and a tool that hallucinates.
Setup Sequence
- Install and launch. Run
claude; first launch opens a browser to log in. If the local callback is unreachable (WSL2, SSH, containers), pressc/paste the login URL and paste the code back. - Choose provider / auth. Pick where Claude authenticates (Claude for Teams/Enterprise is the default recommendation; Console, Bedrock, Vertex, Foundry for inherited cloud compliance/billing). For CI/scripts, run
claude setup-tokento print a one-yearCLAUDE_CODE_OAUTH_TOKEN(inference-scoped; not for Remote Control). Watch auth precedence: a strayANTHROPIC_API_KEYbeats your subscription —unsetit and confirm with/status. - Configure the environment (in roughly this order):
/init— generate a starter CLAUDE.md, then refine. Keep it short: include only what Claude can't infer from code (Bash commands, non-default style, test runner, repo etiquette, env quirks). For each line ask "would removing this cause mistakes?"/permissions— allowlist specific safe tools (npm run lint,git commit) to cut interruptions./sandbox— enable OS-level filesystem/network isolation so Claude works freely inside boundaries. Permissions gate which tool; sandboxing gates what the process can touch — use both.claude mcp add— connect stateful/structured integrations (issue trackers, databases, Figma). Prefer a CLI (gh,aws,gcloud,sentry-cli) when one exists; CLIs are the most context-efficient path.- Hooks (
/hooks,.claude/settings.json) — for actions that must happen every time with zero exceptions (lint on every edit, block writes to a protected folder). Deterministic, unlike advisory CLAUDE.md. - Skills (
SKILL.mdin.claude/skills/) — domain knowledge / repeatable workflows that load on demand. Usedisable-model-invocation: truefor side-effecting workflows. - Subagents (
.claude/agents/) — specialized assistants with their own context andtools:/model:for read-heavy or focused work.
- Pick a parallelism approach. Match the surface to who holds the plan and whether workers must talk / touch the same files (subagents, agent view, agent teams, dynamic workflows; worktrees to isolate).
Daily-Use Loop
- Explore — feed context, don't over-prompt:
@file/@directory/references, pasted images, URLs,cat error.log | claude, or tell Claude to fetch what it needs. Ask codebase questions like you'd ask a senior engineer. - Plan —
Shift+Tabinto plan mode (read-only) when the approach is uncertain, the change spans files, or the code is unfamiliar.Ctrl+Gopens the plan in your editor. Skip planning when you could describe the diff in one sentence. For larger features, let Claude interview you withAskUserQuestioninto a self-containedSPEC.md, then execute it in a fresh session. - Code — give specific prompts (name the file, the edge case, the pattern to follow). Keep edits surgical: ask for a diff or say "only change X."
- Verify — have Claude write/run tests; paste failing tests or stack traces back rather than rephrasing.
- Manage context —
/clearbetween unrelated tasks;/compact <instructions>to condense;Esc/Esc Esc//rewindto course-correct and restore checkpoints (Claude's changes only — not a git replacement). If you've corrected Claude twice on the same issue,/clearand restart with a sharper prompt. - Scale —
claude -p "prompt"for CI/scripts (--output-format json); fan out across files with loopedclaude -p+--allowedTools(refine the prompt on the first 2–3 files first);claude --bg/background sessions checked viaclaude agents//tasks. Use the Writer/Reviewer pattern across two sessions for quality. - Review — run
/code-review(correctness check on the current diff in a fresh subagent) before calling work done; scope reviewers to gaps affecting correctness/requirements to avoid over-engineering.
Adoption Order
- First: install + login,
/initCLAUDE.md,/permissionsfor a few safe tools, the explore→plan→code→verify loop,/cleardiscipline. - Next: a CLI (
gh) for GitHub, one or two skills, a Stop hook for notifications,/code-reviewas a habit. - Later: sandboxing and auto mode for less-interrupted runs, MCP servers, custom subagents, parallel sessions/worktrees,
claude -pfan-out, agent teams / dynamic workflows for large fan-out work. - Team rollout: share a
.claude/skills/<name>/SKILL.md(plain Markdown — instant adoption); check CLAUDE.md into git; use/team-onboardingto emit a replayable setup guide; lead with the warm introduction, not an onboarding program.
Common Pitfalls
- Bloated CLAUDE.md — "Bloated CLAUDE.md files cause Claude to ignore your actual instructions!" Prune regularly; move sometimes-relevant knowledge to skills.
- Stale
ANTHROPIC_API_KEY— it wins over your subscription (precedence rule 3 beats rule 6) and fails if the key's org is disabled.unsetit. - Over-prompting instead of giving context —
@-mention files and paste real errors; context beats elaborate phrasing. Most "it hallucinated" cases are context problems. - Planning trivial tasks / skipping plans on big ones — judge by the one-sentence-diff rule.
- Unscoped unattended runs — always set
--allowedToolsforclaude -ploops; turn off--verbosein production. - Trusting checkpoints as backup — they track only Claude's changes; use git.
- Auto-running side-effecting skills — set
disable-model-invocation: true. - Skipping the review step on long runs — the longer Claude works unattended, the more an independent fresh-context check matters.
Key Commands & Config
claude,claude setup-token,claude -p,claude --continue/--resume,claude --bg,claude agents,claude mcp add/init,/permissions,/sandbox,/hooks,/clear,/compact,/rewind,/code-review,/status,/team-onboardingShift+Tab(plan mode),Ctrl+G(open plan in editor),Esc/Esc Esc- Files:
~/.claude/CLAUDE.md,./CLAUDE.md,./CLAUDE.local.md,.claude/settings.json,.claude/skills/,.claude/agents/
Rules of Thumb
- If you could describe the diff in one sentence, skip the plan.
- Corrected Claude more than twice on the same issue?
/clearand restart with a sharper prompt. - Time spent making the spec precise pays off more than time spent watching the implementation.
- A fresh context reviews better — it isn't biased toward code it just wrote.
- Refine the fan-out prompt on the first 2–3 files; it's cheap to fix the prompt, expensive to redo thousands.
Related References
- Claude Code Core Framework - the underlying model of Claude Code
- Context & Session Management - clear/compact/rewind detail
- Permissions & Layered Safety - permissions, sandbox, auto mode
- Parallel Orchestration — Decision Guide - choosing a parallelism surface
- Claude Code Rules of Thumb - condensed heuristics
- What's New as of June 2026 (Consolidated Changelog) - what's new to fold into setup