Track Claude Code · Mastery · 13 min
The CLI that codes with you.
Claude Code turns the terminal into an agentic IDE. CLAUDE.md, slash commands, hooks, sub-agents, MCP, worktrees — six concepts that take you from 'AI helper' to 'AI engineering teammate.' This is the full mental model, with the workflow the people writing the most production code in 2026 actually use.
“The best AI engineers in 2026 aren't those who can write the most code. They're the ones who can direct the most code.”
#The hook
This is the field manual for what makes Claude Code different from a chatbot — and how to actually use it well.
#Why this matters in 2026 — the receipts
Coding agents by the numbers
Where AI is rewriting how engineers ship
78%
SWE-bench Verified, Claude Opus 4.7
Anthropic 2026
30%
Anthropic code written by Claude
Anthropic 2025
46%
New code in Copilot-enabled files
GitHub 2025
100+
MCP servers in the registry
modelcontextprotocol.io
#The six primitives
The mental model
Six concepts to know
1. CLAUDE.md
Project memoryA file at the root of your repo that Claude reads before doing anything. Your project's brain.
- Tech stack, conventions, do/don't rules, common workflows.
- Updated as the project evolves. Treated like part of the codebase.
- Claude follows it. Every. Single. Time.
2. Slash commands & skills
Composable workflowsReusable prompts you invoke with /name. Skills are richer — multi-file capabilities.
- Built-ins: /init, /commit, /pr, /review, /clear.
- Custom slash commands in .claude/commands/ — your team's vocabulary.
- Skills are a 2025 addition: bundle prompt + tools + reference docs.
3. Hooks
Deterministic enforcementShell commands that fire on events: PreToolUse, PostToolUse, SessionStart.
- Auto-format every file Claude edits. Auto-run tests after changes. Block force-push to main.
- Turns 'please remember to format' into 'always formats'.
- Production teams use hooks for audit logs, secret scanning, deployment guardrails.
4. Sub-agents
Specialized delegationReusable specialized Claude sessions. code-reviewer, docs-writer, test-generator.
- Defined in .claude/agents/<name>.yaml: name, description, tools, model, prompt.
- Each starts with fresh context — main session stays focused.
- Compose your team: one Claude planning, others doing specific work.
5. MCP servers
External tool reachModel Context Protocol — open standard for connecting Claude to GitHub, Slack, Postgres, Linear, anything.
- 100+ official servers in the 2026 registry.
- Now adopted by OpenAI, Google, IDE vendors — the field's universal tool interface.
- Connect once, use across every AI client that speaks MCP.
6. Git worktrees
Parallel agentic workRun multiple Claude sessions on different branches in parallel — no merge conflicts.
- Three Claude sessions, three feature branches, zero conflicts.
- git worktree add ../myapp-feat-auth feat/auth-rewrite — instant parallel sandbox.
- The 10x-engineer pattern: one Claude refactoring, another writing tests, you reviewing.
30%
Of Anthropic's code is now written by Claude
Public eat-your-own-dog-food. Anthropic's engineering team estimates that ~30% of the code in their main monorepo is written by Claude — using Claude Code, exactly the tool they ship to customers. Internal velocity is the most credible AI productivity statistic on Earth, because the alternative is a model that nobody on the team uses.
Anthropic engineering blog, 2025
Vocabulary
Six Claude Code terms you'll meet daily
Concept
CLAUDE.md
Markdown file at repo root that the agent reads every session.
Like: A pinned note for your AI engineer.
e.g. Tech stack, conventions, do/don't rules
Concept
Slash command
Reusable prompt invoked via /name. Built-in or in .claude/commands/.
Like: Bash aliases for the agent.
e.g. /init, /review, /commit
Concept
Hook
Shell command fired on agent events — PreToolUse, PostToolUse.
Like: Git hooks but for AI actions.
e.g. Auto-format every edit, block force-push
Concept
Sub-agent
A specialized Claude session with its own tools and prompt.
Like: A specialist consultant called in by the main agent.
e.g. code-reviewer, docs-writer, test-generator
Concept
MCP server
External tool connector via the Model Context Protocol.
Like: USB peripherals for the agent.
e.g. GitHub, Slack, Postgres, Linear
Concept
Worktree
A separate working directory tied to your repo, on its own branch.
Like: Multiple monitors. One brain, several screens.
e.g. git worktree add ../feat-auth feat/auth
#See it work
#The CLAUDE.md template — copy this
# CLAUDE.md is markdown, but treat it like config.
# This is the template that works for 90% of projects.
template = """# Project Name — Claude Code Brain
## What this project is
- A Next.js app for [purpose].
- Tech stack: TypeScript strict, Tailwind v4, Zustand, Drizzle ORM.
- Lives at github.com/your-org/your-repo.
## Code conventions
- TS strict mode. No `any`. Interfaces for component props, types for unions.
- File names kebab-case. Component names PascalCase.
- API routes: /api/[name] returns JSON with camelCase keys.
## What to always do
- Run `npm run lint` before committing.
- After editing a Postgres migration, run `npm run db:check`.
- Use the existing `cn()` util for conditional classes — don't import clsx fresh.
## What to never do
- Don't commit secrets, .env files, or API keys.
- Don't modify package-lock.json by hand — use `npm install`.
- Don't add new dependencies without flagging in your PR description.
## Common workflows
- New feature: branch off main → implement → test → /commit → /pr.
- Bug fix: reproduce → fix → write regression test → /commit → /pr.
- Refactor: open a sub-agent (`code-reviewer`) on the changes before /commit.
"""
print(template)That structure is what differentiates a Claude Code session that helps from one that "just gets it." Five sections, ~50 lines, owns the way the agent works in your repo.
#What's been built with Claude Code
Coding agents in production
What 'AI engineering teammates' have shipped
30% by Claude
Anthropic codebase
30%
Code written by Claude
The model writes ~30% of the code its own creators ship. Public eat-your-own-dog-food benchmark.
Self-hosted
Agent-IDE
Cursor
1M+
Paid users
VS Code fork with deep agent integration. Claude under the hood for many users.
IDE agent
GitHub-native agent
GitHub Copilot Workspace
100M+
Devs reachable
GitHub's integrated agentic flow. Reads issues, writes plan, opens PR. Claude or GPT under the hood.
Platform agent
Autonomous engineer
Devin (Cognition)
13%
SWE-bench (2024)
First public 'fully autonomous SWE'. Cognition's bet that agent-first is the future of engineering.
Multi-agent
Build & deploy agent
Replit Agent
1M+
Apps generated
Build a full-stack app from a prompt. Targeting non-engineers. Claude-native.
Full-stack agent
Open tool standard
MCP ecosystem
100+
Official servers
Anthropic's open protocol. Now adopted by OpenAI, Google, IDE vendors. The field's universal tool API.
Open standard
#The 2026 frontier
#Where to go next
- Claude Code Mastery track — 17 lessons: install, CLAUDE.md, ecosystem, permissions, slash commands, hooks, sub-agents, MCP, git workflows.
- AI Agents — the broader theory behind coding agents.
- Python Foundations — most Claude Code usage assumes you can read code.
- ML Engineering — production agent workflows live in the same infrastructure.
#Key takeaways
Key Takeaways
- Claude Code is an agentic CLI: reads your repo, runs commands, writes files, ships PRs.
- Six primitives to master: CLAUDE.md, slash commands/skills, hooks, sub-agents, MCP, worktrees.
- CLAUDE.md is the highest-leverage file in your repo — your project's brain that the agent reads every time.
- Hooks turn 'please remember to format' into deterministic enforcement.
- MCP standardized tool exposure across all major AI providers in 2024-2025. The field's universal tool interface.
- Worktrees enable parallel agent work — three Claudes on three branches with zero conflicts.
#References & further reading
- Anthropic — Claude Code documentation (docs.claude.com/en/docs/claude-code).
- Anthropic — Building Effective Agents (2024). The most important field-guide.
- Model Context Protocol spec (modelcontextprotocol.io).
- SWE-bench Verified leaderboard (swebench.com).
- Software Engineering at Anthropic — internal practices made public.
- The Pragmatic Engineer's coverage of AI-native engineering tooling.