Claude Code Complete Guide
A practical guide to multi-session workflows, automation, and extension patterns in Claude Code.
Recently Updated Chapters
Run Claude Code in non-interactive workflows with clear inputs, outputs, and guardrails.
Connect Claude Code to tools and resources through Model Context Protocol servers.
Run parallel Claude Code sessions with git worktrees and agent view without losing branch, context, or verification control.
Prepare Claude Code plans, installation, update policy, and a safe repository baseline.
Package repeatable Claude Code workflows into reusable commands and skills.
Claude Code is a terminal-based AI coding agent. This handbook is for advanced users who want to run it as an operating system for software work: multiple sessions, explicit plans, automated checks, project memory, subagents, hooks, MCP tools, and repeatable team workflows.
Who this is for
Engineers and AI engineering leads who already use Claude Code and want a clean operating model for real repositories. Basic prompting is intentionally skipped.
Latest Update Baseline
Baseline
Re-checked on 2026-08-03 against Claude Code v2.1.220, npm latest=2.1.220 and
stable=2.1.212. npm next also points to 2.1.220.
-
August 3 command re-check: there is no newer stable release and no command addition, removal, or rename after v2.1.220. The August 1 guidance for
/forkand/subtask, manual review/verify, Opus 5, subagent limits, sandboxing, and headless operation remains current. -
Treat v2.1.206~v2.1.220 as a model, session, and containment refresh: Opus 5 becomes the default Opus path;
/forkcreates a separate background session while/subtaskowns the inherited-context subagent path; session and concurrency caps bound subagents; and new controls cover strict network allowlisting, optional filesystem isolation,DirectoryAdded, MCP init errors, and nested subagent forwarding in headless output. -
Treat v2.1.202~v2.1.205 as a workflow, background-session, and diagnostics refresh: dynamic workflow sizing and OTel attributes, a fast single-pass
/review, MCP root updates, extensive Agent View/background reliability fixes, headlessSessionStarthook streaming, a full/doctorsetup checkup, transcript-tampering protection in Auto mode, and corrected--json-schemavalidation. -
Treat v2.1.197 as the Sonnet 5 baseline: Sonnet 5 is now the default Sonnet path in Claude Code, maps from the Anthropic API
sonnetalias, has native 1M context, and supportsxhigheffort. -
Treat v2.1.181~v2.1.201 as an operations and safety refresh:
sandbox.credentials, destructive-command sandbox auto-approval, Windows PowerShell sandbox fixes, MCP login/logout, MCP idle timeout, Korean paste handling, non-interactive fallback stability, background/Remote recovery, plugin validation fixes, and app/schema bug fixes. v2.1.198 makes subagents run in the background by default (plus Claude in Chrome GA and the new/datavizskill), v2.1.200 changes the default permission mode to "Manual", and v2.1.201 removes the mid-conversation system role on Sonnet 5 sessions. -
Track model restrictions and warnings: main model restrictions now center on Opus, Sonnet, Haiku, and Fable families; Haiku is not available as the main model but can be used for subagents, and deprecated model warnings are stronger.
-
Keep subagent work bounded: v2.1.219 defaults to three nested layers below the main conversation, while v2.1.212+ caps a session at 200 spawned subagents and v2.1.217+ caps concurrent subagents at 20 unless configured otherwise.
-
Use Fable 5 for the hardest and longest-running autonomous tasks when your organization has access. It requires Claude Code v2.1.170 or later, is selected with
/model fable, and is not the default model. -
Treat Opus 5 as the default high-capability Opus path for complex architecture, multi-step refactors, and long-running agentic work when Fable is unavailable or not appropriate.
-
Check model aliases by provider.
bestuses Fable 5 where available and otherwise falls back to the latest Opus model;opusmaps to Opus 5 on the Anthropic API, Claude Platform on AWS, Bedrock, and Google Cloud Agent Platform. Microsoft Foundry remains on Opus 4.6, so pin a full model name orANTHROPIC_DEFAULT_*_MODELwhen reproducibility matters. -
Plan for Fable-specific fallback. Claude Code automatically reroutes Fable requests flagged by safety classifiers to the default Opus path; use
--safe-modewhen repository context itself may be triggering a classifier. -
Note the Fable 5 redeployment. Fable 5 and Mythos 5 were suspended 2026-06-12 under US export controls (~19 days) and Fable 5 was restored globally on 2026-07-01 with an improved safety classifier targeting the reported vulnerability-finding behavior — the automatic fallback follows it. Pro/Max/Team/select Enterprise include Fable 5 up to 50% of weekly usage limits through 2026-07-07, then via usage credits. Mythos 5 (no classifiers) is Project Glasswing invitation-only and cannot be selected through
/model. -
Use Agent View and background sessions for parallel work:
claude agents,/bg,/background,claude --bg, andclaude --bg --exec. -
Configure
fallbackModelchains for availability failures before long autonomous sessions so overloads fail over deliberately instead of stopping the turn. -
Use
/goalfor completion-condition driven work and/workflowsfor dynamic workflows that orchestrate many background agents. -
Prefer
/usage-creditsover legacy/extra-usage, and use/reload-skillswhen commands or skills change during a session. -
Use native installation paths first; treat npm installation as legacy where official tooling does.
-
Keep every agent session scoped to a concrete working directory, branch, and verification target.
-
Prefer worktrees for parallel implementation, review, and experiment tracks.
-
Put durable project rules in
CLAUDE.md, but keep them short enough that the agent can obey them. -
Use subagents for bounded parallel work, not for urgent blocking decisions.
-
Use hooks and MCP only after the manual workflow is clear enough to automate.
-
Make verification part of the prompt contract: tests, lint, typecheck, browser checks, or review notes.
Handbook Map
1. Plan and Environment Setup
Plans, installation, update policy, and baseline repository setup.
2. Mastering CLAUDE.md
Project memory, rule hierarchy, imports, and maintainable instruction files.
3. Multi-session Workflow
Worktree-based parallel sessions and clean handoff patterns.
4. Subagents
How to delegate bounded work without losing control of the main thread.
5. Hooks
Event-driven automation for checks, guardrails, and repository hygiene.
6. MCP Integration
Tool servers, resources, trust boundaries, and team configuration.
7. Skills and Slash Commands
Reusable workflows, custom commands, and project-specific operating recipes.
8. Plan Mode
Analysis-first work that turns ambiguity into a concrete implementation contract.
9. Context Management
Compaction, recap, project memory, and token discipline.