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.
Use Claude Code hooks for predictable automation and repository guardrails.
Combine Claude Code terminal sessions with editor context and review workflows.
Connect Claude Code to tools and resources through Model Context Protocol servers.
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
Updated on 2026-06-25 against Claude Code v2.1.190, npm latest=2.1.190,
stable=2.1.179, the current model configuration docs, commands docs, and Agent View docs.
- Treat v2.1.181~v2.1.190 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, and app/schema bug fixes. - 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 depth and background work bounded: v2.1.184 caps agent nesting at three levels, and later fixes improve nested agent, background session, Agent deny-rule, and permission-prompt reliability.
- 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 4.8 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 4.8 on the Anthropic API, andsonnetmaps to Sonnet 4.6. Other providers may lag behind unless you pin a full model name orANTHROPIC_DEFAULT_*_MODEL. - 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. - 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.