Library
Claude Code Documentation (June 2026) · 10 of 15
Claude Code Documentation (June 2026)
ai CRITICAL

Claude Code Implementation Playbook

setup workflow adoption daily-use configuration

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

  1. Install and launch. Run claude; first launch opens a browser to log in. If the local callback is unreachable (WSL2, SSH, containers), press c/paste the login URL and paste the code back.
  2. 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-token to print a one-year CLAUDE_CODE_OAUTH_TOKEN (inference-scoped; not for Remote Control). Watch auth precedence: a stray ANTHROPIC_API_KEY beats your subscription — unset it and confirm with /status.
  3. 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.md in .claude/skills/) — domain knowledge / repeatable workflows that load on demand. Use disable-model-invocation: true for side-effecting workflows.
    • Subagents (.claude/agents/) — specialized assistants with their own context and tools:/model: for read-heavy or focused work.
  4. 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.
  • PlanShift+Tab into plan mode (read-only) when the approach is uncertain, the change spans files, or the code is unfamiliar. Ctrl+G opens the plan in your editor. Skip planning when you could describe the diff in one sentence. For larger features, let Claude interview you with AskUserQuestion into a self-contained SPEC.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/clear between unrelated tasks; /compact <instructions> to condense; Esc/Esc Esc//rewind to course-correct and restore checkpoints (Claude's changes only — not a git replacement). If you've corrected Claude twice on the same issue, /clear and restart with a sharper prompt.
  • Scaleclaude -p "prompt" for CI/scripts (--output-format json); fan out across files with looped claude -p + --allowedTools (refine the prompt on the first 2–3 files first); claude --bg/background sessions checked via claude 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, /init CLAUDE.md, /permissions for a few safe tools, the explore→plan→code→verify loop, /clear discipline.
  • Next: a CLI (gh) for GitHub, one or two skills, a Stop hook for notifications, /code-review as a habit.
  • Later: sandboxing and auto mode for less-interrupted runs, MCP servers, custom subagents, parallel sessions/worktrees, claude -p fan-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-onboarding to 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. unset it.
  • 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 --allowedTools for claude -p loops; turn off --verbose in 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-onboarding
  • Shift+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? /clear and 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