The Ultimate Claude Code Guide
A comprehensive, self-contained guide to mastering Claude Code - from zero to power user.
Author: Florian BRUNIAUX | Founding Engineer @Méthode Aristote
Written with: Claude (Anthropic)
Reading time: ~30-40 hours (full) | ~15 minutes (Quick Start only)
Last updated: January 2026
Version: 3.43.0
Before You Start
This guide is not official Anthropic documentation. It's a community resource based on my exploration of Claude Code over several months.
What you'll find:
- Patterns that have worked for me
- Observations that may not generalize to your workflow
- Time estimates and percentages that are rough approximations, not measurements
What you won't find:
- Definitive answers (the tool is too new)
- Benchmarked performance claims
- Guarantees that any technique will work for you
Use critically. Experiment. Share what works for you.
⚠️ Note (Jan 2026): If you've heard about ClawdBot recently, that's a different tool. ClawdBot is a self-hosted chatbot assistant accessible via messaging apps (Telegram, WhatsApp, etc.), designed for personal automation and smart home use cases. Claude Code is a CLI tool for developers (terminal/IDE integration) focused on software development workflows. Both use Claude models but serve distinct audiences and use cases. More details in Appendix B: FAQ.
TL;DR - The 5-Minute Summary
If you only have 5 minutes, here's what you need to know:
Essential Commands
claude # Start Claude Code
/help # Show all commands
/powerup # Interactive lessons: CLAUDE.md, /rewind, memory, effort modes
/status # Check context usage
/compact # Compress context when >70%
/clear # Fresh start
/plan # Safe read-only mode
Ctrl+C # Cancel operationThe Workflow
Describe → Claude Analyzes → Review Diff → Accept/Reject → VerifyContext Management (Critical!)
| Context % | Action |
|---|---|
| 0-50% | Work freely |
| 50-70% | Be selective |
| 70-90% | /compact now |
| 90%+ | /clear required |
These thresholds are based on my experience. Your optimal workflow may differ depending on task complexity and working style.
Memory Hierarchy
~/.claude/CLAUDE.md → Global (all projects)
/project/CLAUDE.md → Project (committed)
/project/.claude/ → Personal (not committed)Power Features
| Feature | What It Does |
|---|---|
| Agents | Specialized AI personas for specific tasks |
| Skills | Reusable knowledge modules |
| Hooks | Automation scripts triggered by events |
| MCP Servers | External tools (Serena, Context7, Playwright...) |
| Plugins | Community-created extension packages |
The Golden Rules
- Always review diffs before accepting changes
- Use
/compactbefore context gets critical - Be specific in your requests (WHAT, WHERE, HOW, VERIFY)
- Start with Plan Mode for complex/risky tasks
- Create CLAUDE.md for every project
Quick Decision Tree
Simple task → Just ask Claude
Complex task → Use TodoWrite to plan
Risky change → Enter Plan Mode first
Repeating task → Create an agent or command
Context full → /compact or /clearNow read Section 1 for the full Quick Start, or jump to any section you need.
Choose Your Path
The guide has 11 chapters and 22,000+ lines. You don't need to read everything: here's what matters for your situation.
| I am... | Read this | Skip this | Time |
|---|---|---|---|
| Developer, getting started | Ch.1 → Ch.2 → Ch.3 | Ch.9, Ch.11, Appendix | 3h |
| Developer, intermediate | Ch.2.6 → Ch.4 → Ch.5 → Ch.7 | Ch.1, Ch.10 ref only | 4h |
| Power user / senior | Ch.9 (Advanced) → Ch.4-8 | Ch.1 Quick Start | 2h |
| Tech Lead / EM | Ch.3.5 → Ch.9.17 → Ch.9.20 → Ch.11 | Ch.5-6 detail | 1h30 |
| Just need a reference | Ch.10.5 Cheatsheet | Everything else | 5 min |
Top 5 sections by ROI
If you only have time for 5 sections:
- 2.6 Mental Model: Understand how Claude Code thinks (20 min)
- 3.1 CLAUDE.md: Persistent memory that survives sessions (30 min)
- 9.1 The Trinity: The core pattern for agentic work (20 min)
- 7.4 Security Hooks: Automate guardrails you won't forget (30 min)
- 10.5 Cheatsheet: Daily reference, bookmark it (5 min)
Table of Contents
- 1. Quick Start (Day 1)
🟢 Beginner⏱ 45 min - 2. Core Concepts
🟡 Intermediate⏱ 60 min- 2.1 The Interaction Loop
- 2.2 Context Management
- 2.3 Plan Mode (incl. OpusPlan)
- 2.4 Rewind
- 2.5 Model Selection & Thinking Guide
- 2.6 Mental Model
- 2.8 Structured Prompting with XML Tags
- 2.9 Semantic Anchors
- 2.10 Prompt Engineering Patterns
- 2.11 Structured Outputs & Schema Design
- 2.12 Data Flow & Privacy
- 2.13 Under the Hood
- 3. Memory & Settings
🟢 Beginner⏱ 30 min - 4. Agents
🟡 Intermediate⏱ 45 min - 5. Skills
🟡 Intermediate⏱ 30 min - 6. Commands
🟡 Intermediate⏱ 30 min - 7. Hooks
🟡 Intermediate⏱ 45 min - 8. MCP Servers
🟡 Intermediate⏱ 40 min - 9. Advanced Patterns
🔴 Advanced⏱ 3h- 9.1 The Trinity
- 9.2 Composition Patterns
- 9.3 CI/CD Integration
- 9.4 IDE Integration
- 9.5 Tight Feedback Loops
- 9.6 Todo as Instruction Mirrors
- 9.7 Output Styles
- 9.8 Vibe Coding & Skeleton Projects
- 9.9 Batch Operations Pattern
- 9.10 Continuous Improvement Mindset
- 9.11 Common Pitfalls & Best Practices
- 9.12 Git Best Practices & Workflows
- 9.13 Cost Optimization Strategies
- 9.14 Development Methodologies
- 9.15 Named Prompting Patterns
- 9.16 Session Teleportation
- 9.17 Scaling Patterns: Multi-Instance Workflows
- 9.18 Codebase Design for Agent Productivity
- 9.19 Permutation Frameworks
- 9.20 Agent Teams (Multi-Agent Coordination)
- 9.21 Legacy Codebase Modernization
- 9.22 Remote Control (Mobile Access)
- 9.23 Configuration Lifecycle & The Update Loop
- 9.24 Instinct-Based Continuous Learning
- 9.25 Repository Harness Engineering
- 9.26 Review-Driven Context Optimization
- 9.27 Cross-Session Messaging (Peer Coordination)
- 9.28 Event Ingestion and Safe Delegation
- 10. Reference
🟢 All levels⏱ As needed - 11. AI Ecosystem: Complementary Tools
🟡 Intermediate⏱ 20 min - Appendix: Templates Collection
1. Quick Start (Day 1)
Quick jump: Installation · First Workflow · Essential Commands · Permission Modes · Productivity Checklist · Migrating from Other Tools · Beginner Mistakes
Reading time: 15 minutes
Skill level: Beginner
Goal: Go from zero to productive
Already using Claude Code? Skip to 1.6 Migration guide or go directly to Ch.2 Core Concepts.
1.1 Installation
Choose your preferred installation method based on your operating system:
/*──────────────────────────────────────────────────────────────*/
/* Universal Method */ npm install -g @anthropic-ai/claude-code
/*──────────────────────────────────────────────────────────────*/
/* Windows (CMD) */ npm install -g @anthropic-ai/claude-code
/* Windows (PowerShell) */ irm https://claude.ai/install.ps1 | iex
/*──────────────────────────────────────────────────────────────*/
/* macOS (npm) */ npm install -g @anthropic-ai/claude-code
/* macOS (Homebrew) */ brew install claude-code
/* macOS (Shell Script) */ curl -fsSL https://claude.ai/install.sh | sh
/*──────────────────────────────────────────────────────────────*/
/* Linux (npm) */ npm install -g @anthropic-ai/claude-code
/* Linux (Shell Script) */ curl -fsSL https://claude.ai/install.sh | shVerify Installation
claude --versionUpdating Claude Code
Keep Claude Code up to date for the latest features, bug fixes, and model improvements:
# Check for available updates
claude update
# Alternative: Update via npm
npm update -g @anthropic-ai/claude-code
# Verify the update
claude --version
# Check system health after update
claude doctorAvailable maintenance commands:
| Command | Purpose | When to Use |
|---|---|---|
claude update | Check and install updates | Weekly or when encountering issues |
claude doctor | Verify auto-updater health | After system changes or if updates fail |
claude --version | Display current version | Before reporting bugs |
claude auth login | Authenticate from the command line | CI/CD, devcontainers, scripted setups |
claude auth status | Check current authentication state | Verify which account/method is active |
claude auth logout | Clear stored credentials | Shared machines, security cleanup |
Update frequency recommendations:
- Weekly: Check for updates during normal development
- Before major work: Ensure latest features and fixes
- After system changes: Run
claude doctorto verify health - On unexpected behavior: Update first, then troubleshoot
Desktop App: Claude Code Without the Terminal
Claude Code is available in two forms: the CLI (what this guide focuses on) and the Code tab in the Claude Desktop app. Same underlying engine, graphical interface instead of terminal. Available on macOS and Windows, with no Node.js installation required.
What the desktop adds on top of standard Claude Code:
| Feature | Details |
|---|---|
| Visual diff review | Review file changes inline with comments before accepting |
| Live app preview | Claude starts your dev server, opens an embedded browser, auto-verifies changes |
| GitHub PR monitoring | Auto-fix CI failures, auto-merge once checks pass |
| Parallel sessions | Multiple sessions in the sidebar, each with automatic Git worktree isolation |
| Connectors | GitHub, Slack, Linear, Notion: GUI setup, no manual MCP config |
| File attachments | Attach images and PDFs directly to prompts |
| Remote sessions | Run long tasks on Anthropic's cloud, continue after closing the app |
| SSH sessions | Connect to remote machines, cloud VMs, dev containers |
When to choose Desktop vs CLI:
| Use Desktop when... | Use CLI when... |
|---|---|
| You want visual diff review | You need scripting or automation (--print, output piping) |
| You're onboarding colleagues | You use third-party providers (Bedrock, Vertex, Foundry) |
| You want session management in a sidebar | You need dontAsk permission mode |
| You're doing a live demo or pair review | You need agent teams / multi-agent orchestration |
| You want file attachments (images, PDFs) | You're on Linux (Desktop is macOS + Windows only) |
What's NOT available in Desktop (CLI only): third-party API providers, scripting flags (--print, --output-format), --allowedTools/--disallowedTools, agent teams, --verbose, Linux.
Shared configuration: Desktop and CLI read the same files: CLAUDE.md, MCP servers (via ~/.claude.json or .mcp.json), hooks, skills, and settings. Your CLI setup carries over automatically.
Migration tip: run
/desktopin the terminal to move an active CLI session into the Desktop app. On macOS and Windows only.
Note on MCP servers: MCP servers configured in
claude_desktop_config.json(the Chat tab) are separate from Claude Code. To use MCP servers in the Code tab, configure them in~/.claude.jsonor your project's.mcp.json. See Section 8.1: MCP.
Full reference: code.claude.com/docs/en/desktop
Platform-Specific Paths
| Platform | Global Config Path | Shell Config |
|---|---|---|
| macOS/Linux | ~/.claude/ | ~/.zshrc or ~/.bashrc |
| Windows | %USERPROFILE%\.claude\ | PowerShell profile |
Windows Users: Throughout this guide, when you see
~/.claude/, use%USERPROFILE%\.claude\orC:\Users\YourName\.claude\instead.
First Launch
cd your-project
claudeOn first launch:
- You'll be prompted to authenticate with your Anthropic account
- Accept the terms of service
- Claude Code will index your project (may take a few seconds for large codebases)
Note: Claude Code requires an active Anthropic subscription. See claude.com/pricing for current plans and token limits.
1.2 First Workflow
Let's fix a bug together. This demonstrates the core interaction loop.
Step 1: Describe the Problem
You: There's a bug in the login function - users can't log in with email addresses containing a plus signStep 2: Claude Analyzes
Claude will:
- Search your codebase for relevant files
- Read the login-related code
- Identify the issue
- Propose a fix
Step 3: Review the Diff
- const emailRegex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;💡 Critical: Always read the diff before accepting. This is your safety net.
Step 4: Accept or Reject
- Press
yto accept the change - Press
nto reject and ask for alternatives - Press
eto edit the change manually
Step 5: Verify
You: Run the tests to make sure this worksClaude will run your test suite and report results.
Step 6: Commit (Optional)
You: Commit this fixClaude will create a commit with an appropriate message.
1.3 Essential Commands
These 7 commands are the ones I use most frequently:
| Command | Action | When to Use |
|---|---|---|
/help | Show all commands | When you're lost |
/clear | Clear conversation | Start fresh |
/compact | Summarize context | Running low on context |
/status | Show session info | Check context usage |
/exit or Ctrl+D | Exit Claude Code | Done working |
/plan | Enter Plan Mode | Safe exploration |
/rewind | Undo changes | Made a mistake |
/voice | Toggle voice input | Speak instead of type |
Quick Actions & Shortcuts
| Shortcut | Action | Example |
|---|---|---|
!command | Run shell command directly | !git status, !npm test |
@file.ts | Reference a specific file | @src/app.tsx, @README.md |
Ctrl+C | Cancel current operation | Stop long-running analysis |
Ctrl+R | Search command history | Find previous prompts |
Esc | Stop Claude mid-action | Interrupt current operation |
本篇目录
- Shell Commands with !
- File References with @
- Working with Images and Screenshots
- Session Continuation and Resume
- Approach A: CLAUDE.md behavioral instruction (mid-session)
- Approach B: SessionEnd hook (automatic, AI-generated)
- Using both together
- Pricing comparison (March 2026)
- What Copilot Does Well
- What Claude Code Does Better
- Hybrid Approach (Recommended)
- What Cursor Does Well
- What Claude Code Does Better
- When to Switch
- Running Both
- Week 1: Learning Phase
- Week 2: Establishing Workflow
- Week 3-4: Advanced Usage
- The Problem: Context Rot
- The Pattern
- When to Use
- Practical Implementation
- Task Definition Template
- Key Insight
- Pricing Model (as of July 2026)
- 200K vs 1M Context: Performance, Cost & Use Cases
- What Costs the Most?
- Cost Optimization Strategies
- How Claude Code Handles Caching Automatically
- Tracking Costs
- Cost vs. Value
- Cost-Conscious Workflows
- Red Flags (Cost Waste Indicators)
- Subscription Plans & Limits
- Escalating to Fable 5
- Tasks API (v2.1.16+)
- TodoWrite (Legacy)
- Best Practices
- Task Lists as Diagnostic Tool
- Complete Workflow
- Sources
- Going further: capitalizing solutions across PRs
- The Compound Engineering philosophy (Every.to)
- Brainstorm-before-planning
- The Documentation Hierarchy as Project Memory
- Configuration Hierarchy
- Git Strategy for Project Configuration
- Version Control for Global Config (~/.claude/)
- Backup Strategies
- Multi-Machine Sync
- Security Considerations
- Disaster Recovery
- Community Solutions
- Detailed Comparison
- Decision Tree: Which to Use?
- Common Patterns
- Skills and Subagents