Claude Code Complete Guide
A practical guide to multi-session workflows, automation, and extension patterns in Claude Code.
Recently Updated Chapters
Keep Claude Code sessions accurate through memory, compaction, and concise handoffs.
Run Claude Code in non-interactive workflows with clear inputs, outputs, and guardrails.
Prepare Claude Code plans, installation, update policy, and a safe repository baseline.
Package repeatable Claude Code workflows into reusable commands and skills.
Delegate bounded work while keeping the main Claude Code session accountable.
September 12, 2026 release refresh
Updated for Claude Code v2.1.263–v2.1.269 (September 6–11). npm checked on September 12, 2026 KST: latest/next=2.1.269, stable=2.1.236. Keep latest-feature evaluation separate from a team's stable-channel rollout.
- Plugins:
claude plugin evalproduces JSON and HTML evaluation reports; install, uninstall, update, enable, and disable accept--json.--plugin-dircan point to a parent directory containing multiple plugins. - Commands and settings:
/output-style [name]works over Remote Control and in cloud/headless sessions.maxEffortLevelcaps effort globally or per model undermodelSettings.bashEditDiffEnabledadds file-edit diffs to Bash results. - Recovery and compatibility: 2.1.266 fixes forced gateway sign-in; 2.1.268 fixes HTTP 400s on Anthropic-compatible endpoints introduced in 2.1.265.
/goalretries with backoff or pauses with a reason after API, network, or usage-limit failures. - Permissions and operations: fixes cover symlink deny/ask rules, Bash
teewrite boundaries, and secrets in MCP/plugin errors. WebFetch has a default 300-second deadline./ultrareview --postposts the PR comment directly when findings arrive.
Sources: official changelog, npm dist-tags.
Previous verification snapshot (September 5, 2026)
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-09-05 against Claude Code v2.1.261, npm latest=2.1.261,
next=2.1.261, and stable=2.1.236, plus the Claude Fable 5.1 model docs.
-
Claude Fable 5.1 (
claude-fable-5-1) shipped on 2026-09-01 and became the default Fable model in Claude Code v2.1.257 (minimum v2.1.255).fableandbestresolve to Fable 5.1 unlessANTHROPIC_DEFAULT_FABLE_MODELsays otherwise; Fable 5 is now/model claude-fable-5. Pricing (50 per MTok), the 1M context window, 128K output, and always-on adaptive thinking match Fable 5, while prompt-cache reads drop to $0.25/MTok. Neither Fable model is the default on any plan. -
Classifier fallback is now category-based: Fable 5.1/5 biology flags rerun on Opus 5 and cybersecurity flags on Opus 4.8; Opus 5 itself reruns cybersecurity flags on Opus 4.8 and refuses biology flags.
switchModelsOnFlag: falsedisables the switch, and third-party providers needANTHROPIC_DEFAULT_OPUS_MODELfor fallback to work. -
Fable 5.1 has three Messages API breaking changes for custom harnesses: forced
tool_choice(any/tool) returns 400, its thinking blocks are readable only by Fable 5.1, and editing earlier turns invalidates later thinking blocks (enforced for accounts created on or after 2026-08-31). Per-message effort, turn-scoped system messages,thinking.display: "updates", and content provenance are additive. Claude Code keeps history append-only, so interactive sessions are unaffected. -
Treat v2.1.252~v2.1.261 as the Fable 5.1 rollout: Claude apps gateway sessions keep
fable/beston Fable 5 until gateways accept 5.1 (v2.1.257);/effortgains a session-onlyskey andCLAUDE_CODE_SUBAGENT_MODEL_FORCEarrives; v2.1.260 fixes the picker hiding Fable 5.1, Fable 5.1 prompt caching after tool results, and the[1m]tag onANTHROPIC_DEFAULT_FABLE_MODEL, moves Opus/Fable 1M auto-compaction to just before the limit, and keeps the prompt cache when effort changes on Fable 5.1./diff,/skill-doctor,managedMcpServers,--permission-prompts none, andtimeFormatare the notable non-model additions. -
Treat v2.1.239~v2.1.247 as an operations and reliability refresh.
/usageadds per-loop accounting; v2.1.242+ documents user/managedmodelPickerand separate main/subagent cache TTLs. The changelog announces managedmodelPricing, but the current Settings reference does not yet publish its schema./permissionsadds an Auto-mode rules tab;/claude-api cost-optimizeprofiles API spend one measured change at a time, although the current Commands signature still lags the v2.1.247 release note.feedbackDraftsacceptsnotify,quiet, oroffat user/managed scope, withoffremovingSendFeedback. -
/cdnow applies the destination's settings, hooks,.mcp.json, skills, and agents immediately. Subagents that hitmaxTurnsreturn an explicitly partial result, a first-call model 404 uses the session fallback chain, and non-interactive responses automatically continue after interrupted streams, connection loss, or stalls. -
Sonnet 5 sessions using the 1M window now auto-compact near 967K tokens. Marketplace text, terminal links, wildcard Bash allow rules, gateway credentials, and managed-settings startup boundaries received additional hardening.
-
Treat v2.1.221~v2.1.237 as a session, automation, and containment refresh. Interactive sessions now enable inherited-context fork mode and background subagent spawning by default; the 200-per-session subagent cap is gone, while the default 20-concurrent and three-level boundaries remain. Cross-session
SendMessage/ListAgents,@mentions of other Claude sessions, GitLab MR workflows, self-hosted runners, and Remote Control were expanded and hardened. -
v2.1.236 adds
ANTHROPIC_DEFAULT_MODELas a low-precedence default for new sessions, and v2.1.237 adds the built-in Concise output style. Explicit--model,ANTHROPIC_MODEL, settingsmodel, and organization defaults still take precedence. -
From v2.1.233, legacy Task/Todo tools are disabled by default for Opus 4.8, Sonnet 5, Fable 5, Mythos 5, and newer models; set
CLAUDE_CODE_ENABLE_TODO_TOOLS=1only for compatibility. The same release window addsclaude self-hosted-runner,claude remote-control --continue, plugin command sources, archive-plus-SHA plugin pinning, and extensive trust, sandbox, OAuth, and worktree fixes. -
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.237 defaults to three nested layers below the main conversation and 20 concurrent subagents. v2.1.224 removed the old 200-per-session total. Fork mode is on by default in interactive sessions and off by default in
-p/SDK flows. -
Use Fable 5.1 for the hardest and longest-running autonomous tasks when your organization has access. It requires Claude Code v2.1.255 or later, is selected with
/model fable, and is not the default model. Fable 5 (v2.1.170+) remains available as a legacy model via/model claude-fable-5. -
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 the latest Fable (Fable 5.1) 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 Opus 5 (biology) or Opus 4.8 (cybersecurity); 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) and its successor Mythos 5.1 (same model as Fable 5.1 with a different safeguard level) are Project Glasswing-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.