The $250K Guide · Part 1 of 2 · Free Forever
The definitive end-to-end guide to Anthropic’s agentic coding tool — installation, Ollama local fallback, CLAUDE.md, Skills, Subagents, Agent Teams, Hooks, and MCP. Everything you need before building production apps. Built by the author of the DDS Sovereign AGI Suite.
0 Modules (Pt 1+2)
0 In This Part
0 Commands
$0 Cost
Apr 16 Updated
Quick Answer
Claude Code is Anthropic’s agentic coding tool — a full software-engineering agent that runs in your terminal, IDE, desktop, browser, mobile, and Slack. It reads your codebase, edits files, runs commands, executes tests, and manages git workflows through natural language. This masterclass teaches you every primitive that matters: CLAUDE.md (always-on rules), Skills (on-demand expertise), Subagents (context-isolated workers), Agent Teams (parallel collaboration), Hooks (deterministic safety rails), MCP (external tool access), plus the complete Ollama local setup for sovereign fallback. Part 1 is everything you need before you build. Part 2 is how you actually build with it.
What this masterclass is — and is not
This is a free production playbook, not a sales pitch and not a beginner-tutorial-that-stops-at-hello-world. It is the operating system I use to run Claude Code every day inside the DDS Sovereign AGI Suite — 15 synthetic employees, $11.1M+/year in automated labor, $0/month hosting, built solo. I am sharing the tips, the patterns, the config files, and the daily-driver playbook because Claude Code deserves a public manual at the level my internal team has. Consider this the $250K in private consulting you never had to pay for.
What I do not share: the actual CLAUDE.md files, skills, prompt chains, and orchestration logic that power Sovereign Orchestrator Pro, AGI-CORE-Pro, and NICHE-FORGE-CORE. Those stay internal. You will learn every pattern and every configuration surface. You will build the same class of systems yourself. You will not get a copy-paste shortcut to my specific builds. Fair trade.
ⓘ
The Part 1 → Part 2 split. Part 1 (this page, 13 modules) is foundations: what Claude Code is, how to install it, the mental model, the configuration surface, and all six primitives you configure before building. Part 2 (12 modules on a separate page) is production: the full command reference, git workflows, the DDS methodology, build-along walkthroughs for a React app and a Shopify section, advanced multi-agent patterns, cost control, IDE integration, three DDS case studies, the $250K cheat sheet, and what comes next. Do Part 1 first. You will be glad you did.
The 7 primitives you will master in Part 1
Most Claude Code users ship with three of these and wonder why their agent drifts. The whole point is that they compose. Lock all seven in and you have a system — not a chatbot.
Always-On Knowledge
CLAUDE.md
Project rules loaded into every prompt automatically. Code style, architecture, testing, git conventions, forbidden operations. Module 06.
On-Demand Expertise
Skills
Directory-based workflows with progressive disclosure. ~100 tokens per scan, full load only on match. Module 08.
Reusable Prompts
Slash Commands
Custom /commands stored as Markdown. Team-shared or personal. The older format; Skills take precedence. Module 09.
Context-Isolated Workers
Subagents
Separate Claude instances that research heavy, return clean summaries. Protect your main session context. Module 10.
Parallel Coordination
Agent Teams
Multiple Claude sessions with shared tasks and peer-to-peer messaging. Launched Feb 2026 with Opus 4.6. Module 11.
Deterministic Safety
Hooks
Shell commands that fire at lifecycle events. Auto-lint, block sensitive commits, send notifications. Module 12.
External Tool Access
MCP Servers
Model Context Protocol servers connect Claude Code to databases, APIs, third-party services. Module 13.
Sovereign Fallback
Ollama Local
Local inference for private or cost-free work. Point Claude Code at 127.0.0.1:11434 or Ollama Cloud. Module 05.
Key Takeaways — Part 1
- Claude Code is an agent, not autocomplete. It reads your whole codebase, runs commands, manages git. Anthropic writes most of its own code with it.
- Install via Homebrew or WinGet, never npm (deprecated in 2026). Native Windows needs Git for Windows; WSL does not.
- CLAUDE.md loads into every prompt. Keep it under 200 lines. Put always-true rules here; put sometimes-true rules in Skills.
- Skills use progressive disclosure: ~100 tokens per skill on every scan, full load only when the description matches your task. This is how AgentKit ships 40+ skills without context bloat.
- Subagents protect context. Offload heavy research to a subagent; get a clean summary back. Your main session stays sharp.
- Agent Teams are parallel. Use them when independent tasks need coordination. Use subagents when you just need research done without pollution.
- Hooks are deterministic. Shell commands that fire before or after tool calls. The difference between unattended-safe and unattended-risky.
- MCP extends reach. Start with Filesystem + Git + GitHub. Audit every server before installing. Each one adds capability and attack surface equally.
- Ollama is your sovereign fallback. Zero-cost local inference for private work. Cloud-tier Ollama (qwen3-coder 480B) is free through Anthropic for routine work.
- The pattern: Sonnet 4.6 default, Opus 4.6 on demand, Haiku 4.5 for the Explore subagent. The hybrid stretches your budget significantly.
Module 01 · Act I · Foundations
What Is Claude Code
Claude Code is Anthropic’s agentic coding system. The word that matters there is agentic. This is not autocomplete. It is not a chatbot that happens to know how to code. It is a full software-engineering agent that reads your entire codebase, edits files across directories, runs shell commands, executes tests, monitors CI pipelines, and manages your git workflow — all from natural-language instructions.
Anthropic has publicly stated that the majority of their own code is now written by Claude Code. Their engineers focus on architecture, product decisions, and orchestration while Claude Code handles implementation. That is the workflow transformation you are about to learn.
Where Claude Code runs
Primary
Terminal CLI
The full-featured interface. Run claude in any project directory. Supports third-party providers including Ollama. This is where power users live.
Editor
VS Code + Cursor + Windsurf
Native extension with inline diffs, @-mentions, plan review, drag-and-drop files, and conversation history. Cmd+Esc / Ctrl+Esc to launch.
Editor
JetBrains Plugin
IntelliJ, PyCharm, WebStorm, CLion, Rider. Interactive diff viewer. Shared selection and diagnostics with the editor.
Standalone
Desktop App
Visual diffs, multiple sessions side by side, scheduled recurring tasks, and cloud sessions. Great for running more agents at once.
Remote
Web & Mobile
claude.ai/code for browser, iOS/Android apps for mobile. Remote-control your sessions, kick off tasks on the go, review work later.
Collaboration
Slack
Tag @claude in any Slack channel to kick off coding tasks. Add the Claude GitHub app for PR reviews. Meets your team where they already work.
What it can actually do
Unlike an assistant that suggests code for you to paste, Claude Code performs software engineering end to end. Describe a goal and it plans, executes, verifies, and commits. The short list:
- Read your entire codebase and understand how modules connect
- Edit files across multiple directories in a single task
- Run shell commands, including git, npm, pnpm, yarn, pytest, uv, cargo — anything on your PATH
- Execute tests, read the failures, fix the code, run them again until green
- Monitor GitHub Actions and GitLab CI, commit fixes when builds fail
- Create branches, commit with conventional-commit discipline, open PRs via
gh - Use external tools via MCP — databases, APIs, third-party services
- Spawn specialized sub-agents for research-heavy tasks
- Coordinate multiple agents in parallel via Agent Teams (Feb 2026 feature)
✓
Claude Code requires explicit permission before modifying files or running commands (in the default permission mode). It operates in your local environment and talks directly to the Anthropic API with no opaque backend. You remain in control of what ships. Module 04 covers the four permission modes and when each is appropriate.
Module 02 · Act I · Foundations
Installation — Every Platform
Installation has consolidated. As of 2026, Homebrew and WinGet are the recommended paths. npm installation is deprecated. If a tutorial older than January 2026 tells you to npm install -g @anthropic-ai/claude-code, ignore it — the package manager moved on. Pick the block that matches your OS.
macOS & Linux · Homebrew
Homebrew offers two casks: claude-code tracks the stable channel (about a week behind latest, skips regressed releases), and claude-code@latest tracks the latest channel for bleeding-edge features. Homebrew does not auto-update — you run brew upgrade yourself.
macOS / Linux · install
# Stable channel (recommended for daily work) brew install --cask claude-code # Latest channel (bleeding edge) brew install --cask claude-code@latest # Upgrade when you want to brew upgrade claude-code # or brew upgrade claude-code@latest
Windows · Native
Native Windows installs use WinGet. You must have Git for Windows installed first — Claude Code uses it for git operations and bash-style command support. Native installs auto-update in the background to stay current.
Windows · WinGet (PowerShell)
# Install Git for Windows first if you don't have it winget install Git.Git # Install Claude Code winget install Anthropic.ClaudeCode # Upgrade (WinGet installs do NOT auto-update; native installs DO) winget upgrade Anthropic.ClaudeCode
⚠
Shell confusion? If you see The token '&&' is not a valid statement separator, you are in PowerShell expecting CMD syntax. If you see 'irm' is not recognized, you are in CMD expecting PowerShell. Your prompt shows PS C:\ when you are in PowerShell and C:\ without PS when you are in CMD. Match the syntax to the shell.
Windows · WSL (recommended for Linux dev workflow)
If you work in WSL (Ubuntu, Debian, Arch on Windows), install Claude Code inside the WSL environment the same way you would on Linux. WSL installs do not require Git for Windows separately since they use the Linux git.
WSL · Ubuntu/Debian
# Inside WSL, use Homebrew for Linux /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install --cask claude-code # Verify claude --version
First launch — the essential 3 commands
1
Navigate and launch
cd ~/projects/your-app && claude. First launch prompts you to log in. Use your Claude account or Anthropic Console API key.
2
Run /init
Claude Code scans your codebase and writes a starter CLAUDE.md. Review it, tighten the rules, commit it. Covered in depth in Module 06.
3
Run /doctor
Diagnostic check. Verifies your installation, API connection, git, MCP servers, and environment. Fix anything it flags before continuing.
✓
File a bug with /bug from inside Claude Code whenever something misbehaves. The bug report ships with session context so Anthropic can actually fix it. You can also file on GitHub at github.com/anthropics/claude-code.
Module 03 · Act I · Foundations
The Mental Model — Three Layers, Seven Primitives
Claude Code gets confusing fast because the vocabulary proliferated between late 2024 and early 2026. MCP, skills, subagents, plugins, hooks, agent teams — each with its own docs page. Most guides list features without organizing them. Here is the model that makes it all click.
Three layers
Layer 1
Knowledge — What Claude Knows
CLAUDE.md (always-on, every prompt). Skills (on-demand, loaded when triggered). This is what Claude has in its head before it does anything.
Layer 2
Workers — Tasks Run in Isolation
Subagents (single worker, own context window, reports back). Agent Teams (multiple parallel sessions, peer-to-peer messaging). This is how Claude divides labor.
Layer 3
Infrastructure — Safety and Reach
Hooks (deterministic scripts at lifecycle events). MCP Servers (connect to external tools). Plugins (bundle all of the above for sharing). This is how Claude stays safe and reaches beyond your codebase.
When to use what — the decision rule
This is the question that trips everyone up. Here is the answer, short.
- Rule applies to every task (code style, testing requirement, git convention) → CLAUDE.md.
- Rule applies to specific tasks (PR review checklist, release changelog format, Shopify section authoring) → Skill.
- User-triggered reusable prompt (
/review-pr,/deploy-staging) → Slash Command (the older format; Skills work here too and take precedence). - Heavy research that would pollute main context (scan 50 files for auth patterns) → Subagent.
- Multiple parallel tasks that need to coordinate (five features in parallel, with shared status) → Agent Team.
- Deterministic enforcement (auto-lint, block sensitive file commits, notify on completion) → Hook.
- External system access (Postgres, Stripe, GitHub, Shopify) → MCP server.
- Package everything above to share with a team or community → Plugin.
ⓘ
Skills superseded Commands in 2026. A file at .claude/commands/review.md and a Skill at .claude/skills/review/SKILL.md both create /review. Skills give you more control (auto-invocation, forking into subagents, supporting files), and take precedence on name conflicts. Use Skills going forward. Commands still work for backward compatibility.
The failure mode this model prevents
If you do not internalize the split above, you will put too much in CLAUDE.md. Every session will load 400 lines of rules that only apply to 10% of tasks. Your context window gets eaten before Claude starts work. Quality drops. You blame the model.
The right shape: CLAUDE.md stays under 200 lines and contains only always-true rules. Everything else lives in skills that load on demand. The agent knows about hundreds of specialized capabilities but pays the context cost only for the ones you actually need right now.
Module 04 · Act I · Foundations
Models & Permission Modes
Claude Code ships working with three Anthropic models and four permission modes. The combinations decide everything about your daily experience: cost, quality, safety, speed. Get these right and the rest of the masterclass is downhill.
The three models · when to use each
| Model | Strength | Use For | Avoid For |
|---|---|---|---|
| Opus 4.6 | Deepest reasoning, longest autonomous horizon (METR 50% at ~14.5h) | Complex architecture, large refactors, multi-hour autonomous engineering, hardest debugging | Routine edits, high-frequency calls (cost) |
| Sonnet 4.6 | Near-Opus quality at much lower cost, best instruction following | Daily default. Feature work, multi-file edits, bug fixes, most of what you do | Anthropic-scale reasoning (use Opus) |
| Haiku 4.5 | Fastest, cheapest, lightweight | Built-in Explore subagent (read-only codebase analysis), simple reads, status line | Writing non-trivial code, architecture decisions |
The hybrid pattern: Sonnet as default, Opus on demand, Haiku for research. Switch with /model mid-session. The next response re-reads the full history uncached after a model switch, so /model shows a warning before it lets you switch — pay attention to it, because changing models mid-long-task can burn tokens.
The four permission modes
Permission mode governs what Claude Code is allowed to do without asking you. You pick the mode. Mode affects everything: speed, safety, whether you can run the agent unattended.
1
Default — Ask before write/execute
Claude proposes edits and commands; you approve each one. Slowest, safest. Use in unfamiliar codebases and on first runs. This is where you start.
2
Plan — Dry-run mode (/plan)
Claude produces a full plan of what it would do and waits for approval before executing anything. Use for large refactors, unfamiliar work, any session where you want to inspect the approach before code is written. The contract between you and the agent.
3
Auto-accept edits
Claude makes file edits without prompting, but still asks before running shell commands. Good middle ground for tasks you trust with file operations but not arbitrary command execution.
4
Full auto (aka YOLO mode)
Claude runs everything without prompts. Only safe when three things are true: (1) your Hooks enforce safety rails, (2) your CLAUDE.md defines clear forbidden operations, (3) you are in an isolated git worktree or disposable environment. This is how you run the agent overnight.
⚠
Never run full-auto without Hooks. Module 12 covers the Hooks that make full-auto safe: blocking commits of .env/.key/.pem, preventing rm -rf on untrusted paths, requiring tests to pass before commit. Full-auto without Hooks is how you wake up to a force-pushed main.
Switching modes mid-session
Toggle /plan any time. Use /rewind to undo code changes from your current session. Use /focus to collapse transcript chatter and see only Claude’s final message (added in April 2026). Use /context to see how much of your context window is in use. Use /usage to see plan limits and session cost.
ⓘ
Status line rate-limits. As of 2026 Claude Code exposes rate_limits in statusline scripts — 5-hour and 7-day windows with used_percentage and resets_at. Wire these into your prompt to avoid surprise throttle. Covered with the full command reference in Part 2 (Module 14).
Module 05 · Act I · Sovereign Fallback
Ollama Local Setup — The Sovereign Fallback
Claude Code’s terminal CLI and VS Code extension support third-party providers. That means you can point Claude Code at a local Ollama endpoint running on your machine, a local server, or at Ollama’s free cloud tier. You get the same agent experience with zero per-token billing, full data privacy, and a working setup when your API quota resets or the internet goes out. This module is the complete Ollama layer.
ⓘ
Why Ollama at all? Four reasons: (1) Sovereignty — client data or regulated work never leaves your machine. (2) Zero marginal cost — run thousands of calls without metering. (3) Resilience — your workflow keeps working when your plan hits rate limits. (4) Experimentation — test skills, hooks, and MCP against a local model before burning API budget. The DDS Sovereign AGI Suite uses local Ollama for private inference and Anthropic API for frontier tasks. That is the sovereign pattern.
Installing Ollama · every OS
macOS / Linux / Windows native
# macOS or Linux (one-liner) curl -fsSL https://ollama.com/install.sh | sh # Windows native: download the installer from ollama.com # It registers ollama.exe on PATH and runs as a background service on 127.0.0.1:11434 # Verify ollama --version curl http://127.0.0.1:11434/api/tags
Environment variables — the DDS recommended set
These four flags materially improve Ollama performance for coding workflows. Set them in your shell profile or Windows System Environment Variables.
~/.zshrc or ~/.bashrc (or Windows env vars)
export OLLAMA_FLASH_ATTENTION=1 # faster attention computation export OLLAMA_CONTEXT_LENGTH=8192 # tune per your VRAM; larger = more memory export OLLAMA_KEEP_ALIVE=-1 # keep loaded model in memory across calls export OLLAMA_KV_CACHE_TYPE=q8_0 # 8-bit KV cache: half the memory, negligible quality loss # Reload shell, then verify ollama serve # if not already running as a service
Model selection by VRAM
The single biggest Ollama mistake is pulling a model too large for your GPU. Be honest about your hardware and you will get fast, clean inference. Be greedy and you will get CPU-offloaded crawl. Anchored on a 12GB VRAM baseline (RTX 3060 / RTX 4070 class).
| VRAM | Recommended Coding Model | Context | Notes |
|---|---|---|---|
| 8 GB | qwen2.5-coder:7b | 8K | Tight but usable. Consumer laptops. |
| 12 GB | qwen2.5-coder:14b | 8-16K | Daily driver for RTX 3060/4070. Great quality. |
| 16 GB | qwen2.5-coder:14b | 32K | Longer context comfortably. |
| 24 GB | qwen2.5-coder:32b | 16-32K | RTX 3090/4090. Near-API quality local. |
| Less | ollama cloud | large | Route to Ollama Cloud free tier instead. |
Ollama Cloud — free tier for big models
Ollama offers a free cloud tier that runs large models on their infrastructure behind the same API you use locally. The flagship coding model on that tier is qwen3-coder:480b-cloud — a 480 billion parameter mixture-of-experts coder that no consumer GPU can run locally. Access it with the same ollama CLI by appending -cloud to the model name.
Pull models · local and cloud
# Local models (download to disk, run on your GPU) ollama pull qwen2.5-coder:14b ollama pull qwen2.5-coder:32b # if you have 24GB+ VRAM # Cloud models (run on Ollama's infrastructure, free tier) ollama pull qwen3-coder:480b-cloud ollama pull deepseek-v3.1:671b-cloud # List everything available to you ollama list
Connecting Claude Code to Ollama
Claude Code’s terminal CLI and VS Code extension accept third-party providers. The configuration lives in your Claude settings file. Point at http://127.0.0.1:11434/v1 for local, or the Ollama Cloud endpoint for cloud tier.
~/.claude/settings.json (snippet)
{
"providers": {
"ollama-local": {
"type": "openai-compatible",
"baseUrl": "http://127.0.0.1:11434/v1",
"apiKey": "ollama",
"models": ["qwen2.5-coder:14b", "qwen2.5-coder:32b"]
},
"ollama-cloud": {
"type": "openai-compatible",
"baseUrl": "https://ollama.com/v1",
"apiKey": "$OLLAMA_API_KEY",
"models": ["qwen3-coder:480b-cloud"]
}
}
}
Switch to an Ollama model with /model ollama-local/qwen2.5-coder:14b or /model ollama-cloud/qwen3-coder:480b-cloud. Verify the connection with /doctor.
The sovereign routing pattern
Not every task needs Opus 4.6. Not every task needs the API at all. Here is the decision rule I use inside DDS.
1
Frontier task → Anthropic API
Complex architecture, production-critical refactors, multi-hour autonomous engineering, hardest debugging. Opus 4.6 or Sonnet 4.6. Pay for the best tool for the hardest work.
2
Routine daily work → Ollama Cloud
Standard feature work, multi-file edits, docs, tests. qwen3-coder:480b-cloud on the free tier handles the vast majority of this at $0. Keeps API budget for the hard stuff.
3
Private or regulated work → Ollama Local
Client data under NDA, regulated-industry codebases, anything where data sovereignty matters more than raw quality. qwen2.5-coder:14b on your own GPU. Data never leaves the machine.
4
High-volume batch → Ollama Local
Thousands of repeated calls: classification, tagging, linting passes, summarization pipelines. Paying per-token for this burns money. Run it locally overnight for free.
✓
DDS deep dive reference. The complete Ollama for Windows walkthrough — every plugin, every model comparison, every setup step — lives at the Ollama for Windows Complete Guide. This module gave you the Claude Code integration layer. That guide is the Ollama mastery layer. Read them together.
Module 06 · Act II · Knowledge Layer
CLAUDE.md Mastery
CLAUDE.md is the single highest-leverage file in your project. It loads into every prompt automatically. Claude reads it, follows it, and inherits it. A sharp CLAUDE.md turns an inconsistent assistant into a disciplined engineer. A vague one — or an absent one — is why most teams think Claude Code is “pretty good but inconsistent.” The inconsistency is yours, not the model’s.
The three scopes
Scope 1 · Project
./CLAUDE.md
Lives at your repo root. Committed to version control. Loaded at session start. This is where 95% of your rules belong.
Scope 2 · User
~/.claude/CLAUDE.md
Your personal conventions across every project. Coding style preferences, tools you like, commit-message opinions. Loaded after project CLAUDE.md.
Scope 3 · Managed
Organization policy
Enterprise-scoped policy file. Highest precedence. Deployed by an admin for security/compliance rules across all developers in the org.
Path-scoped rules — the advanced trick
Add rule files under .claude/rules/ with a paths: matcher in frontmatter. A rule file with paths: "src/components/**/*.tsx" only loads when Claude is working on matching files. This is how you keep context lean — component-specific rules only appear when you are editing components.
.claude/rules/react-components.md
--- paths: "src/components/**/*.tsx" --- ## React component rules - Functional components only - Typed props interface above the component - Named export, no default - Co-locate styles as `Component.module.css` - Co-locate tests as `Component.test.tsx`
The DDS S-tier CLAUDE.md template
This is the pattern I actually use across production DDS projects, cleaned of proprietary details. It is seven sections, fits under 200 lines, and covers every category of rule an agent needs. Copy it. Strip what does not fit your stack. Add what does.
CLAUDE.md · DDS template
# Project: [Name] # Stack: [tech stack one line] # Last reviewed: 2026-04-16 ## Identity You are working in a production codebase. Output is shipped, not prototyped. Every change must be reviewed before merge. Bias to safety over speed. ## Code Style — Non-Negotiable - TypeScript strict mode. No `any` without a justifying comment. - Functional components only. No React classes. - Named exports only. No default exports. - `const` over `let`. Never `var`. - Error messages are user-facing: friendly, never expose stack traces. - File length cap: 300 lines. Split larger files into focused modules. ## Architecture - Feature-based folders: /features/[name]/{components,hooks,utils,types,__tests__} - All API calls go through /lib/api client. Never raw fetch in components. - Env vars loaded through /lib/env.ts with Zod validation. - No business logic in components. Logic lives in hooks or services. ## Testing — Mandatory Before Marking Complete - Every function has a test file co-located under __tests__/. - Minimum three cases per function: happy, edge, error. - Run `npm test` and report results before claiming a task done. - Never mark a task complete with failing tests. ## Validation Workflow 1. Read existing similar code first — match patterns. 2. Make change. 3. Run linter: `npm run lint`. 4. Run tests: `npm test`. 5. Show me the diff before committing. ## Git - Conventional commits: feat:, fix:, docs:, refactor:, test:, chore:. - Branch naming: feature/[ticket]-[slug] or fix/[ticket]-[slug]. - Never commit to main directly. Always branch. - Never `git push --force` against shared branches. ## Forbidden - Do not install packages without confirming with me first. - Do not modify CI/CD configs. - Do not touch /infra/ or /.github/workflows/. - Do not read or echo .env contents. ## Communication - If a requirement is ambiguous, ask one targeted question instead of guessing. - If you find an unrelated bug, note it in the summary, do not fix it. - End every task with: one-paragraph summary, test results, files changed.
⚠
Keep CLAUDE.md under 200 lines. It loads into every prompt. At 400 lines you are eating thousands of tokens before Claude sees your actual request. Rules that apply sometimes belong in Skills (Module 08) which load on demand. Rules that apply always belong here.
What belongs here vs in a Skill
- CLAUDE.md: TypeScript strict. Always use Zod. Never
git push --force. Conventional commits. These apply to every task. - Skill: Shopify section authoring checklist. PR review format. Release changelog template. SEO Magnet schema set. These apply to specific tasks only — do not pay the context cost every turn.
Module 07 · Act II · Knowledge Layer
Memory & Context Hygiene
Memory is the feature most users accidentally ignore. Claude Code automatically builds up memory as you work — it remembers build commands that succeeded, test runners you use, architectural decisions you made, naming conventions you correct. This machine-learned memory is separate from your explicit CLAUDE.md and supplements it across sessions.
How memory actually works
Auto-memory lives in ~/.claude/projects/<project>/memory/. The first 200 lines of MEMORY.md load at every session start. Claude writes to it as it discovers things. You can view and edit it with /memory.
You can also instruct memory directly in conversation: tell Claude “remember that we use Vitest, not Jest” and it will persist that fact to memory for future sessions — without you editing any file.
Memory-related commands
# View and edit project memory /memory # See current context window usage /context # Compact the conversation when context fills up /compact # Auto-compact toggle (compacts automatically near the limit) /autocompact # Undo recent code changes from this session /rewind # Summary when resuming a long session (added 2026) /recap # Focus view: hide transcript, see only Claude's final message /focus
The context-drift failure mode
Long sessions rot. You start with a clean plan, 90 minutes later the session has loaded 40 files and is quoting its own earlier analysis at you. Quality drops, then the agent starts hallucinating. The cure is context hygiene, not bigger models.
1
Always-on context stays small
CLAUDE.md < 200 lines. Path-scoped rules load only when relevant. Skills scan at ~100 tokens each, full load only on match. Do not waste always-on budget.
2
Offload research to subagents
When you need to scan 30 files to answer a question, spawn a subagent (Module 10). The research happens in its context window. Your main session receives a clean summary. Your context stays sharp.
3
Compact deliberately
/compact summarizes the conversation to date and keeps the summary in context, dropping the history. Use it at task boundaries, not mid-task. Enable /autocompact for hands-off hygiene.
4
Start fresh when in doubt
A short clean session beats a long polluted one. Use /recap to get a fast re-orientation summary if you are returning to a session after a break.
✓
The cheapest productivity gain in Claude Code is internalizing /context. Check it when you feel the session slowing. If you are above 75% context utilization, compact or start fresh. This alone improves perceived quality more than any model upgrade.
Module 08 · Act II · Knowledge Layer
Skills — Progressive Disclosure & the 5 Patterns
Skills are the feature most Claude Code users underutilize. A Skill is a directory-based package containing a SKILL.md file (with YAML frontmatter) and optional supporting assets. Claude Code uses progressive disclosure: it reads only the lightweight name + description menu (~100 tokens per skill) on every turn, and loads the full instructions into context only when your intent matches.
The result: an agent that knows about hundreds of specialized capabilities but pays the context cost only for the ones it actively needs. This is how the Superpowers skill library ships 40+ specialized workflows without bloating every prompt.
Skill directory anatomy
Skill anatomy
# Project scope: in your repo .claude/skills/my-skill/ ├── SKILL.md # required: YAML frontmatter + instructions ├── scripts/ # optional: Python/Bash/Node helpers │ └── run.py ├── references/ # optional: API docs, schemas, cheatsheets │ └── api.md └── assets/ # optional: images, templates, fixtures # User scope: works across all projects ~/.claude/skills/my-skill/ # Plugin scope: bundled inside an installed plugin ~/.claude/plugins/<plugin>/skills/my-skill/
SKILL.md frontmatter — what triggers progressive disclosure
The description field is the trigger. Claude matches user intent against this string. Vague descriptions load too often (context bloat). Narrow descriptions get missed when relevant. Aim for one sentence that names the trigger conditions explicitly — including what should not trigger it.
.claude/skills/shopify-section/SKILL.md
--- name: shopify-section-author description: Author Shopify Liquid sections following the DDS Atelier 3.4.0 standards. Triggers on requests to create, build, or scaffold a Shopify section (.liquid file in /sections/), or any mention of section schema, blocks, or theme settings. Does NOT trigger for product templates, snippets, or page templates — those are separate skills. version: 2.1 model: sonnet effort: medium user-invocable: true agent: general-purpose --- # Shopify Section Authoring Skill When the user asks for a new Shopify section: 1. Read /sections/ to understand existing naming patterns and schema conventions. 2. Propose the section name, schema settings, blocks, and CSS scope. 3. Once approved, scaffold the file with: - Scoped CSS under a unique wrapper class - Liquid logic with defensive filters - JSON schema with valid ranges ((max-min)/step >= 3) - IIFE JS block with zero globals 4. Run `shopify theme check` if available. Report results. See references/atelier-standards.md for the full style guide.
The 5 skill design patterns
1
Basic Router
SKILL.md only, with instructions. For style guides and constraint sets. Cheapest and most common. Use for 80% of your skills.
2
Reference-Heavy
SKILL.md plus references/ with API docs, schemas, or long reference material. The agent loads the reference only when the skill is active. Best for library-specific knowledge (Stripe API, Shopify Storefront, your internal schema).
3
Few-Shot Calibrator
SKILL.md plus references/examples/ with 3+ gold-standard outputs and 3+ anti-examples. Forces consistent format. Best for report templates, PR descriptions, structured outputs where format discipline matters more than invention.
4
Tool Use (Executable)
SKILL.md plus scripts/ the agent can run to validate output. Skill describes when to invoke the script and how to interpret results. Powerful; use carefully with respect to your terminal permission policy.
5
All-in-One Domain
Everything combined: SKILL.md + references + examples + scripts. For complete domains. Context cost is highest — use sparingly. The DDS seo-magnet skill is this pattern.
Auto-invocation vs slash-command
Skills can fire two ways. Auto-invocation: Claude detects your task matches the description and loads the skill automatically. Slash-command: type /skill-name to force it. Set user-invocable: true in frontmatter to expose a skill as a slash command. Set agent: general-purpose (or name a custom subagent) to fork execution into an isolated context.
ⓘ
The hidden power: context: fork. Add context: fork to SKILL.md frontmatter and the skill executes in a forked subagent context — research happens in isolation, the main session receives the result. The built-in /batch skill uses this pattern with isolated git worktrees. Combine with the agent field to route to a specialist subagent (Module 10).
Command-format compatibility
Skills superseded the older .claude/commands/ Markdown files in 2026. Both still work. A file at .claude/commands/review.md and a skill at .claude/skills/review/SKILL.md both create /review. If both exist, the skill wins. Use skills for new work; legacy commands keep functioning.
Module 09 · Act II · Knowledge Layer
Custom Slash Commands
Slash commands are user-triggered prompt templates. You type / in Claude Code and see your registered commands. Where CLAUDE.md is always-on and Skills are on-demand context, commands are deliberate orchestrations you fire intentionally. Most teams build three to seven and save hours a week.
The two scopes
- Project commands:
.claude/commands/. Committed to the repo. Available to everyone who clones. Use for team workflows like/review-pror/release-notes. - User commands:
~/.claude/commands/. Your personal productivity layer across every project. Use for patterns you use everywhere like/explain-thisor/add-tests.
File anatomy
A command is a Markdown file. The filename (without .md) becomes the command name. The file content is the prompt Claude receives when you run it. Use $ARGUMENTS to capture whatever text you pass after the command.
.claude/commands/review-pr.md
--- description: Review an open PR for quality, security, and test coverage. model: sonnet allowed-tools: ["Read", "Grep", "Glob", "Bash"] --- Review PR $ARGUMENTS. ## Process 1. Run `gh pr view $ARGUMENTS --json title,body,files` to get metadata. 2. Run `gh pr diff $ARGUMENTS` to see the changes. 3. Check each file for: - Code quality (naming, complexity, structure) - Security concerns (injection risks, auth issues, secrets) - Performance (obvious inefficiencies, unnecessary allocations) - Test coverage (new code has tests; existing tests still pass) 4. For each finding, cite the file and line number. 5. End with a recommendation: Approve, Request Changes, or Comment. 6. Post the review as a PR comment with `gh pr comment`.
Frontmatter fields that matter
| Field | Purpose | Default |
|---|---|---|
| description | Appears in /help and command picker | (none) |
| model | Override model for this command (sonnet/opus/haiku) | Current session model |
| allowed-tools | Restrict which tools the command can use | All available |
| effort | Override model effort level (added 2026) | Default |
| argument-hint | Hint string shown after command name in picker | (none) |
Three commands every DDS project has
.claude/commands/ship-it.md
---
description: Run full pre-ship checks: lint, test, build, then summarize.
---
Run the complete pre-ship sequence:
1. `npm run lint` — must be clean
2. `npm test` — all tests pass
3. `npm run build` — build succeeds, no warnings
4. `git status` — confirm what is staged
5. If all pass, draft a conventional-commits message based on staged changes.
Do NOT commit or push. Just report status and propose the message.
.claude/commands/explain.md
--- description: Explain a function, file, or concept at a specific depth. argument-hint: <target> [--depth shallow|deep] --- Explain $ARGUMENTS. If it names a file, read the file first. If it names a function, grep for it and read the surrounding context. If it names a concept, keep the answer to three paragraphs. Depth shallow (default): what it does, in two paragraphs. Depth deep: what it does, why it is written that way, what alternatives were likely considered, and what could break it.
.claude/commands/add-tests.md
--- description: Add tests for a function or module following our test conventions. model: sonnet --- Add tests for $ARGUMENTS. 1. Locate the target. Read it and its current test file if one exists. 2. Identify uncovered branches and edge cases. 3. Write tests following our CLAUDE.md test conventions: - Minimum three cases: happy path, edge case, error case - Co-located under `__tests__/` - Descriptive test names (describe what, not how) 4. Run the test suite. Report pass/fail. 5. Do NOT refactor the target itself. Only add tests.
✓
Commands + Skills compose. A command like /ship-it can invoke a skill mid-prompt by referencing its trigger phrase. Your command orchestrates; your skills provide specialized expertise. The system becomes a layered workflow engine, not just a chat interface.
Module 10 · Act III · Worker Layer
Subagents — Context-Isolated Workers
A subagent is a separate Claude instance that runs in its own context window, does a job, and returns only the results to your main conversation. The simplest way to understand why you want them: research pollution. When you ask Claude to answer “how does authentication work in this codebase,” it may read 30 files to answer. All 30 land in your main context. Ask the next question and Claude is now reasoning against 30 files of irrelevant auth code. Quality drops.
A subagent solves this cleanly. The 30-file read happens in the subagent’s context. Your main session receives a 3-paragraph summary. Context stays sharp. This one pattern is the difference between an agent that feels coherent at hour three and one that feels confused.
Built-in subagents
Claude Code ships with specialized subagents invoked automatically in the right situations. You do not have to configure them to benefit.
| Subagent | Model | When Claude uses it |
|---|---|---|
| Explore | Haiku | Fast read-only codebase analysis. Cheap, quick answers to “where does X happen”. |
| Plan | Sonnet | Research mode during /plan for investigation before proposing changes. |
| General-purpose | Sonnet/Opus | Complex multi-step work with full tool access. Default for custom skills that fork context. |
| Bash | Inherits | Running terminal commands in a separate context so stdout/stderr does not flood main. |
| statusline-setup | Sonnet | Invoked by /statusline to configure your status line. |
| Claude Code Guide | Haiku | Invoked when you ask questions about Claude Code features itself. |
Custom subagents — the file format
Custom subagents are Markdown files with YAML frontmatter. Project scope: .claude/agents/. User scope: ~/.claude/agents/. Use /agents to create them interactively, or write the file yourself.
.claude/agents/security-reviewer.md
--- name: security-reviewer description: Review code for security vulnerabilities. Use proactively after auth changes, new endpoints, or dependency updates. model: opus tools: ["Read", "Grep", "Glob"] memory: project isolation: worktree maxTurns: 20 color: red --- You are a security-focused code reviewer. Analyze code for: - OWASP Top 10 vulnerabilities - Authentication and authorization issues - Input validation and injection risks - Secrets in code, logs, or config - CSRF, XSS, SSRF exposure - Rate limiting and abuse vectors - Dependency vulnerabilities As you review, update your agent memory with patterns you find recurring. Cite file and line numbers. Rank findings as Critical / High / Medium / Low.
The frontmatter fields that matter
tools: Restrict to read-only for reviewers (Read, Grep, Glob). Full for implementers. Whitelist is safer than blacklist.model: Override the session model. Use Opus for hard reviewers, Haiku for fast scanners.memory:none|user|project. Gives the subagent a persistent directory that survives across conversations. First 200 lines of its MEMORY.md load each invocation.isolation:none|worktree.worktreecreates an isolated git worktree for the subagent — prevents file conflicts during parallel execution.maxTurns: Safety rail. Stop the subagent after N turns regardless of task state. Prevents runaway research.hooks: Scoped hooks that only apply when this subagent runs. Great for read-only enforcement.mcpServers: Restrict which MCP servers this subagent can talk to. Reviewer subagents should not have Stripe access.permissionMode: Override permission mode per subagent. A test-runner subagent might run full-auto while your main session runs default.
⚠
No recursive spawning. A subagent cannot spawn its own subagent. If a task needs deep delegation, use Agent Teams (Module 11) instead. The non-recursion rule prevents fork bombs and runaway token costs.
Three subagents every serious setup has
1
The Explorer
Read-only, tools restricted to Read/Grep/Glob, model Haiku. Use it whenever you would otherwise ask main Claude “what does X look like in the codebase.” Keeps main context clean.
2
The Reviewer
Read-only, model Opus, memory: project. Runs on every PR or after every significant change. Learns your codebase’s recurring issues over time and reports them proactively.
3
The Implementer
Full tools including Write/Edit/Bash, isolation: worktree, maxTurns: 40. Use for feature work where you want an isolated branch and guardrails.
Inline agents via --agents (advanced)
You can also define subagents on the command line as JSON with the --agents flag. Useful for one-off runs, scripted workflows, and CI integration.
Inline agent definition
claude --agents '{
"code-reviewer": {
"description": "Expert code reviewer. Use proactively after code changes.",
"prompt": "You are a senior code reviewer focusing on quality, security, and best practices.",
"tools": ["Read", "Grep", "Glob", "Bash"],
"model": "sonnet"
},
"debugger": {
"description": "Debugging specialist for errors and test failures.",
"prompt": "You are an expert debugger. Analyze errors, identify root causes, provide fixes."
}
}'
Module 11 · Act III · Worker Layer
Agent Teams — True Parallel Coordination
Agent Teams launched February 2026 alongside Opus 4.6. Where subagents are isolated workers that report to a boss, Agent Teams are a collaborative squad: multiple independent Claude sessions that coordinate via shared tasks and peer-to-peer messaging. Each teammate has its own full context window. Truly parallel.
The distinction that matters
Subagent
Boss + Worker
Main session spawns a subagent. Subagent does the job. Subagent reports back. Main session continues. One way communication. Subagents cannot talk to each other.
Agent Team
Parallel Squad
Multiple Claude sessions running simultaneously. Shared task list. Peer-to-peer messaging. They coordinate on who does what. The lead orchestrates; teammates can ask each other questions.
How you configure a team
Unlike subagents, which you define in YAML files, Agent Teams are configured through the prompt itself. You describe the roles and the task, and the lead agent handles orchestration. Teammates inherit the lead’s permissions and MCP connections. Fine-tune via hooks or a teams.json if you need granular control.
Prompt-based team definition
Build a team of four to ship the new checkout flow. Roles: - Architect: designs API contracts and data models. Outputs a spec document. No code. - Backend engineer: implements /api/checkout endpoints per the spec. Writes tests. - Frontend engineer: implements the checkout page components. Writes tests. May ask the backend engineer for clarification. - QA reviewer: reads all output before merge. Signs off or requests changes. Does not write code. Work in parallel after the Architect’s spec is approved. Status-update me every 20 minutes. If any teammate blocks, they message the relevant peer directly. I arbitrate only if the team cannot resolve among themselves.
When teams beat subagents
1
Five features in parallel
Independent features with clear interfaces. Spawn five teammates on five features. Each builds in its own worktree. Reviewer signs off on all five. You ship a week of work in a night.
2
Research track + implementation track
One teammate researches an unfamiliar library while another implements against a stable contract. When research surfaces a gotcha, the researcher messages the implementer directly without polluting your context.
3
Cross-stack refactor
Frontend, backend, database migration need to move together. One teammate per layer. Shared task list tracks progress. Peer messaging handles the integration points without a human in the loop for every question.
When subagents are still the right call
- Single research task where you just want a clean summary back
- Read-only review by a specialist (security, performance, accessibility)
- Testing sweep where the test runner would flood your context
- Any task where “coordination” adds overhead, not value
✓
Rule of thumb: if teammates never need to talk to each other, you want subagents. The moment coordination matters, you want a team. Default to subagents — teams are powerful but burn context and tokens per teammate. Reach for them when parallelism genuinely pays off.
Module 12 · Act III · Worker Layer
Hooks — Deterministic Safety Rails
Hooks are shell commands that fire automatically at Claude Code lifecycle events. They are not instructions the model interprets — they are deterministic scripts the runtime executes. That distinction matters. Claude might ignore a CLAUDE.md rule under pressure. A hook cannot be ignored. It runs or it blocks.
Hooks are the reason you can run Claude Code unattended. They are how you enforce the non-negotiables: auto-lint after every edit, block commits of sensitive files, require tests before push, log every tool call for audit. Set them once; they protect every future session without further thought.
The lifecycle events
| Event | Fires | Use for |
|---|---|---|
| PreToolUse | Before any tool call | Block forbidden operations, validate inputs, require confirmation |
| PostToolUse | After a tool call completes | Auto-lint, run tests, log to audit trail, notify |
| SessionStart | At session start | Load environment, sync dependencies, check git status |
| SessionEnd | At session end | Commit memory changes, send summary, archive logs |
| UserPromptSubmit | Before each prompt is sent | Inject dynamic context, rate-limit, scrub secrets |
| Stop | When the agent stops | Send completion notifications (Slack, desktop) |
| SubagentStop | When a subagent stops | Collect subagent output, log, post-process |
Hooks config — settings.json
Hooks live in ~/.claude/settings.json (user scope) or .claude/settings.json (project scope). Each hook has a matcher pattern (which tool or event) and a command to run. Non-zero exit code from a PreToolUse hook blocks the tool call.
.claude/settings.json · hooks
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{
"type": "command",
"command": "./.claude/hooks/block-sensitive-commits.sh"
}]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [{
"type": "command",
"command": "npx eslint --fix $CLAUDE_TOOL_FILE_PATH 2>/dev/null || true"
}]
}
],
"SessionStart": [
{
"hooks": [{
"type": "command",
"command": "git status --short"
}]
}
]
}
}
The block-sensitive-commits pattern
This is the single most valuable hook you can install. It scans any bash command for dangerous patterns and blocks them before execution. Non-zero exit blocks the tool call.
.claude/hooks/block-sensitive-commits.sh
#!/usr/bin/env bash # Reads the proposed tool invocation from stdin as JSON # Exit 0 = allow. Exit non-zero = block with message to stderr. input=$(cat) command=$(echo "$input" | jq -r '.tool_input.command // ""') # Block commits of secrets if echo "$command" | grep -qE 'git (add|commit).*(\.env|\.key|\.pem|id_rsa|\.p12)'; then echo "BLOCKED: will not commit sensitive file patterns" >&2 exit 2 fi # Block destructive git if echo "$command" | grep -qE 'git push.*--force.*(main|master|production)'; then echo "BLOCKED: no force-push to protected branches" >&2 exit 2 fi # Block rm -rf on the repo root if echo "$command" | grep -qE 'rm\s+-[rf]+\s+(/|\.|\*|~)'; then echo "BLOCKED: rm -rf on suspicious paths" >&2 exit 2 fi exit 0
Interactive hook setup — /hooks
Claude Code’s /hooks command walks you through hook creation interactively. Use it for the first one; hand-edit settings.json for the rest once you know the shape.
ⓘ
The unattended-safety pattern. Combine three hooks for truly hands-off runs: (1) PreToolUse on Bash to block sensitive operations, (2) PostToolUse on Write/Edit to auto-lint, (3) Stop to send a Slack notification so you see the work when the agent finishes. Layer these on top of a subagent with isolation: worktree and you have a safe overnight engineer.
Module 13 · Act III · Worker Layer
MCP Servers — External Tool Access
MCP — Model Context Protocol — is the open standard for connecting Claude Code to external systems. A database, an API, a filesystem, a browser, a third-party SaaS — all wrapped as MCP servers Claude can talk to. MCP is what turns a coding agent into an operations agent.
The tradeoff is obvious and often underweighted. Every MCP server adds capability and attack surface in equal measure. A Postgres MCP server can query your production database. It can also drop it. Treat MCP like you treat service accounts: least privilege, audit before install, rotate credentials.
Two scopes, two files
- User-scope:
~/.claude/mcp_config.json. Available in every project. - Project-scope:
.claude/mcp_config.json. Committed to the repo. Available only in this project. Team-shared.
The safe starter set
If you are adding MCP servers for the first time, start here. These are low-risk, high-value, and broadly useful.
| Server | What It Does | Risk |
|---|---|---|
| Filesystem | Structured file operations beyond what built-in Read/Write offer | Low (already has file access) |
| Git | Structured git operations (diff, log, blame) without shelling out | Low |
| GitHub | Issues, PRs, workflows, repo search. Use a scoped PAT, not your personal | Medium — scope the token |
| Postgres (read-only) | Query databases for schema introspection and data exploration | Medium — use a read-only user |
| Playwright | Browser automation for testing and scraping | Medium — network egress |
Example config
.claude/mcp_config.json
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_TOKEN" }
},
"postgres-readonly": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres",
"postgresql://ro_user:pass@host:5432/db"]
}
}
}
Manage installed servers with /mcp. List, enable/disable, inspect tools each server exposes, check auth status. Use /doctor to verify connections at session start.
The 6-item audit checklist
Before installing any MCP server — especially third-party ones — run this checklist. It takes five minutes. It prevents most of the damage MCP can do.
1
Who publishes it?
Official Anthropic/vendor server, or a community one. Community is fine if maintained; sketchy if abandoned or obfuscated.
2
What tools does it expose?
Run the server once with --list-tools and read them. If a “read-only” server includes delete_table, reject it.
3
What credentials does it want?
Scope them minimally. A GitHub server for issue triage needs issues:read, not repo admin.
4
Where is it hosted (for remote servers)?
Network egress to unknown domains is a red flag. Prefer locally-executed servers for anything sensitive.
5
Does it log to a third party?
Check for telemetry/phone-home behavior. You would not run an NPM package with telemetry on production data — same standard applies.
6
Project-scope it, not user-scope
Any server with real credentials belongs in .claude/mcp_config.json, not ~/.claude/. Constrain blast radius to the project that needs it.
ⓘ
Channels preview (2026). Claude Code now supports MCP channels — push-style messages from servers to the agent (--channels flag). Servers can notify when long-running operations complete, a webhook fires, or an external state changes. Treat channels as untrusted input: combine with a UserPromptSubmit hook that scrubs or validates before the agent acts.
⚠
Plugin subagent restriction. Subagents packaged inside a plugin cannot define their own hooks, mcpServers, or permissionMode. This is a security feature — a plugin you install cannot silently escalate its own capabilities. When writing subagents for a plugin, keep them contained.
Bottom Line
Claude Code works the same day you install it. It becomes powerful when you layer the seven primitives on top: a tight CLAUDE.md for always-on rules, Skills for on-demand expertise, Subagents to protect context, Agent Teams for parallel coordination, Hooks for deterministic safety, MCP for external reach, and Ollama for sovereign fallback. Every primitive in Part 1 is a force multiplier on the next. Lock them in now, and Part 2 is where you learn to build real production systems on top.
Continue to Part 2 · Production Playbook
Part 2 is where theory becomes muscle memory. 12 more modules: the complete 50+ command reference, git workflows for solo and team, the DDS Vibe Coding methodology (5 Pillars), build-along walkthroughs for a React app and a Shopify section, advanced multi-agent orchestration, cost control and rate limits, plugins and the ecosystem, deep IDE integration, three DDS case studies (VibeTube AI, Collection Hero Grid v4.2, SEO Magnet V2), the $250K cheat sheet, and what comes next.
Frequently Asked Questions
Claude Code is Anthropic’s agentic coding tool that runs in your terminal, IDE, desktop app, browser, mobile, and Slack. Unlike autocomplete-style assistants, Claude Code is a full agent that reads your entire codebase, edits files, runs commands, executes tests, and manages git workflows through natural language. Anthropic reports that the majority of its own code is now written by Claude Code. It works with Opus 4.6, Sonnet 4.6, and Haiku 4.5.
On macOS and Linux, use Homebrew: brew install --cask claude-code for the stable channel, or claude-code@latest for the latest channel. On Windows, use WinGet: winget install Anthropic.ClaudeCode. Native Windows installs require Git for Windows. WSL setups do not. After install, navigate to your project directory and run claude. Installation via npm is deprecated as of 2026.
CLAUDE.md is your project’s always-on instructions file. Claude Code loads it into every prompt automatically. Put rules that apply to every task: code style, architecture decisions, preferred libraries, testing requirements, forbidden operations, communication conventions. Keep it under 200 lines — rules that only apply sometimes belong in Skills, which load on demand. Upper-path CLAUDE.md files load at session start; subdirectory files load when you work in those paths.
Yes. The Terminal CLI and VS Code extension support third-party providers including Ollama. Configure Claude Code to point at your local Ollama endpoint (typically 127.0.0.1:11434) and select a local coding model like qwen2.5-coder-14b for 12GB VRAM cards, or route to Ollama Cloud for free access to larger models like qwen3-coder:480b-cloud. The sovereign pattern is to use local Ollama for private inference and Anthropic API for frontier tasks.
Skills are Markdown-based workflows in .claude/skills/ directories containing a SKILL.md file with YAML frontmatter and optional scripts, references, and assets. They use progressive disclosure: Claude reads only the description at about 100 tokens per skill, and loads the full instructions (under 5000 tokens) only when relevant. Skills can auto-invoke when Claude detects a matching task, or run as explicit slash commands. As of 2026, the older .claude/commands/ format still works but skills take precedence on name conflicts.
A Subagent is a separate Claude instance that runs in its own context window, does a job, and returns only the results to your main conversation. Subagents report back to the parent and cannot talk to each other. Agent Teams, launched February 2026 alongside Opus 4.6, are multiple independent Claude sessions that coordinate via shared tasks and peer-to-peer messaging. Use subagents to protect your main context from heavy research. Use teams for parallel work that needs coordination.
Hooks are shell commands that fire automatically at Claude Code lifecycle events: PreToolUse before a tool runs, PostToolUse after, SessionStart at the start of a session, and others. Use them for deterministic control: auto-lint after file edits, block commits of sensitive files, send Slack notifications when the agent finishes, run tests before allowing git push. Hooks are what make it safe to run Claude Code unattended.
MCP (Model Context Protocol) lets Claude Code connect to external tools through standardized servers — databases, APIs, file systems, third-party services. You need it when your agent’s work requires data or actions beyond your codebase: querying Postgres, reading Shopify orders, sending email, browsing the web. Start with the safe set: Filesystem, Git, GitHub. Audit any server before installing — each one adds capability and attack surface in equal measure.
Sonnet 4.6 is the default for most daily work — strong enough for complex multi-file edits, fast enough for iteration, cheaper than Opus. Opus 4.6 is for the hard tasks: architecture decisions, large refactors, multi-hour autonomous engineering, complex debugging. Haiku 4.5 powers the built-in Explore subagent for fast read-only codebase analysis. The hybrid pattern — Sonnet as default, Opus on demand, Haiku for research — stretches your usage budget significantly.
Plan Mode (toggled with the /plan command) makes Claude propose each tool action and wait for your approval before executing it. Use it when working in an unfamiliar codebase, before a large refactor you want to review step by step, or any time you want to inspect what the agent is about to do before it does it. Plan Mode is your safety net when you are not ready to run in full auto-accept.
Claude Code maintains auto-memory in ~/.claude/projects/ tracking patterns it discovers across sessions — build commands, architectural decisions, coding preferences. The first 200 lines of MEMORY.md load at every session start. Use /memory to view and edit. You can also tell Claude things like “remember that we use Vitest, not Jest” and it will persist for future sessions. CLAUDE.md is your explicit version-controlled knowledge. Auto-memory is what Claude learned on its own.
Claude Code the tool is free to install. Usage is billed either through a Claude subscription (Pro/Team/Enterprise) or through Anthropic Console API credits. Claude Code is also included with Team plan Standard seats. Enterprise users can route through existing Amazon Bedrock or Google Cloud Vertex AI instances. Terminal CLI and VS Code extension also support third-party providers like Ollama for zero-cost local inference. Use /usage to check your plan limits and current consumption.
Robert McCullock
Founder, CEO & AGI Architect · Design Delight Studio
Architect of the DDS Sovereign AGI Suite: 15 synthetic employees automating $11.1M+ in annual labor at $0/month hosting. Pioneer of the Vibe Coding methodology. Built the entire suite solo using Claude Code as the primary engineering tool. This masterclass is the manual I wish I had on day one.