Claude Code in 2026: the complete mental model

08 Feb 2026 | Vibe Coding AI Tools

As of February 2026, Claude Code v2.1.3+ unifies skills and slash commands, supports lifecycle hooks, subagents, MCP integrations, and a plugin ecosystem. Power users like Boris Cherny (Claude Code's creator) ship 259 pull requests in 30 days with every line written by AI. This guide covers the full system.


1. What Claude Code is and how to get started

Claude Code is a terminal-native AI coding agent built by Anthropic. It reads your codebase, plans changes, edits files, runs commands, creates commits, and iterates on problems autonomously.

How it differs from Cursor and Copilot:

It follows Unix philosophy: composable, scriptable, pipe-friendly.

tail -f app.log | claude -p "Slack me if you see any anomalies"

Installation:

Native installations auto-update in the background. After installing, navigate to your project directory and run claude.

Pricing:

Usage limits are shared across Claude web/desktop and Claude Code. Monitor with /status.

Available surfaces: terminal CLI, browser (claude.ai/code), desktop app, VS Code extension, JetBrains extension, GitHub Actions, GitLab CI/CD, Slack, Chrome extension.

๐Ÿ“– Official docs: code.claude.com/docs/en/overview ยท github.com/anthropics/claude-code


2. CLAUDE.md: the constitution of your agent

CLAUDE.md files are persistent memory that shapes Claude Code's behavior. They define coding conventions, project architecture, common commands, and guardrails. Getting CLAUDE.md right is the single highest-leverage thing you can do.

The four-level hierarchy

Loaded automatically at startup. Higher levels take precedence.

Level Location Purpose
Enterprise System paths (e.g., /etc/claude-code/CLAUDE.md) Org-wide standards, managed by IT
Project ./CLAUDE.md or ./.claude/CLAUDE.md Team-shared, committed to source control
User ~/.claude/CLAUDE.md Personal preferences across all projects
Local ./CLAUDE.local.md Personal project-specific prefs, auto-gitignored

Claude also performs recursive lookup from your working directory upward. Subdirectory CLAUDE.md files load only when Claude accesses files in that subtree (progressive disclosure, saving context tokens).

What to put in it

Keep it under 300 lines (context tokens are precious):

Run /init to bootstrap a starter CLAUDE.md from your project structure.

Imports

CLAUDE.md supports @path/to/import syntax:

Imports resolve recursively up to 5 hops. Not evaluated inside code blocks.

Iterative updates

Tell Claude: "remember that we use pnpm, not npm" and it updates CLAUDE.md automatically. Use /memory to open memory files in your editor. Periodically ask Claude to review the file and suggest improvements.

Auto Memory

Claude can also record its own learnings as it works, stored in ~/.claude/projects/<project>/memory/. Opt in:

export CLAUDE_CODE_DISABLE_AUTO_MEMORY=0

๐Ÿ“– Official docs: code.claude.com/docs/en/memory


3. The core workflow: explore, plan, code, commit

Anthropic's recommended workflow has four phases. The first two are where most people under-invest.

The four phases

  1. Explore โ€” Ask Claude to read relevant files. Explicitly say "don't write any code yet." Use subagents for complex exploration to keep your main context clean.
  2. Plan โ€” Ask Claude to make a plan. Use thinking triggers for harder problems. Iterate until the plan is solid. Have Claude write it to a document as a checkpoint.
  3. Code โ€” Ask Claude to implement the plan. Include tests or expected outputs so Claude can self-verify.
  4. Commit โ€” Ask Claude to commit and create a PR. Optionally update docs and changelogs.

Plan Mode

Activated by pressing Shift+Tab twice (or claude --permission-mode plan). Claude can only analyze the codebase and create plans โ€” it cannot modify files.

Boris Cherny's workflow: start in Plan Mode โ†’ iterate โ†’ switch to Auto-Accept Mode (Shift+Tab once) โ†’ Claude executes. "A good plan is really important!"

You can set Plan Mode as default in .claude/settings.json:

{"permissions": {"defaultMode": "plan"}}

Context management

Context is the real skill in Claude Code. The 200K token window is your most precious resource.

Providing context

Thinking modes

Thinking triggers allocate more reasoning tokens for complex problems:

Trigger Budget When to use
"think" ~4K tokens Normal complexity
"think hard" ~10K tokens Multi-file changes
"think harder" / "ultrathink" ~32K tokens Architecture decisions

Toggle thinking with the Tab key during a session. Opus 4.6 uses adaptive thinking that calibrates depth dynamically, but the trigger words still work.

Permission bypass

The --dangerously-skip-permissions flag bypasses all permission checks for fully autonomous execution. Anthropic recommends this only in containers without internet access. Useful for CI/CD pipelines and batch operations.

Keyboard shortcuts worth knowing

Shortcut Action
Escape Stop Claude mid-response
Escape ร— 2 Jump back in message history
Shift+Tab Cycle permission modes
Tab Toggle thinking mode
Up arrow Browse past prompts (including prior sessions)

๐Ÿ“– Official docs: code.claude.com/docs/en/common-workflows ยท anthropic.com/engineering/claude-code-best-practices


4. Skills: the unified instruction system (v2.1.3+)

In January 2026, Anthropic merged slash commands and skills into one system. Existing .claude/commands/ files still work. .claude/skills/ is the recommended path forward because skills support richer features: supporting file directories, YAML frontmatter for invocation control, and auto-loading when contextually relevant.

Skills follow the Agent Skills open standard (agentskills.io), adopted across Claude Code, GitHub Copilot, OpenAI Codex, and others.

Anatomy of a skill

Every skill lives in a folder with a SKILL.md file containing two parts:

---
name: explain-code
description: Explains code with visual diagrams and analogies.
  Use when the user asks "how does this work?"
---

When explaining code, always include:
1. Start with an analogy to everyday life
2. Draw an ASCII art diagram showing flow
3. Walk through the code step by step
4. Highlight a common gotcha

Two invocation modes

  1. User-triggered โ€” You type /explain-code and Claude runs it
  2. Claude auto-loads โ€” Claude reads skill descriptions at startup and loads relevant ones based on the current task

This is progressive disclosure: only metadata loads initially; full content loads on activation.

Key frontmatter controls

Field What it does
disable-model-invocation: true Slash command only. Prevents Claude from auto-loading (use for /deploy, /commit)
user-invocable: false Auto-load only. Hides from slash menu (use for background knowledge like coding conventions)
context: fork Runs in an isolated subagent
agent: Explore Which agent model the subagent uses
allowed-tools: Read, Grep, Glob Restricts tools available
argument-hint: [issue-number] Placeholder text in the UI

String substitution works with $ARGUMENTS, $0, $1, and ${CLAUDE_SESSION_ID}.

Including "ultrathink" anywhere in skill content enables extended thinking.

Skill hierarchy

When skills share the same name, priority follows: enterprise > personal > project > plugin

Scope Location
Enterprise Managed settings
Personal ~/.claude/skills/
Project <project>/.claude/skills/

Skill descriptions consume a budget of 2% of the context window. Run /context to check for warnings about excluded skills.

Supporting files

A skill directory can include more than SKILL.md:

my-skill/
โ”œโ”€โ”€ SKILL.md           # Main instructions (required)
โ”œโ”€โ”€ template.md        # Template for Claude to fill in
โ”œโ”€โ”€ examples/
โ”‚   โ””โ”€โ”€ sample.md      # Example output
โ””โ”€โ”€ scripts/
    โ””โ”€โ”€ validate.sh    # Script Claude can execute

When to use skills vs CLAUDE.md

๐Ÿ“– Official docs: code.claude.com/docs/en/skills


5. Subagents: isolated context for parallel work

Subagents are separate Claude instances that handle delegated tasks in their own context window. Subagent work doesn't pollute your main conversation. They cannot spawn other subagents.

Built-in subagents

Agent Model Tools Purpose
Explore Haiku (fast, cheap) Glob, Grep, Read, limited Bash Read-only codebase search
Plan Sonnet Read/explore tools Research before creating plans
General-purpose Sonnet All tools Complex research, multi-step operations

Claude delegates to these automatically when appropriate.

Custom subagents

Defined as Markdown files in .claude/agents/ (project) or ~/.claude/agents/ (user):

---
name: code-reviewer
description: Expert code review. Use proactively after modifying code.
tools: Read, Grep, Glob, Bash
model: inherit
---

You are a senior code reviewer.
Focus on: readability, naming, duplication, error handling,
security, test coverage.

Key fields:

Manage interactively with /agents.

The context: fork pattern

When a skill specifies context: fork, invoking it spawns a subagent and runs the skill's instructions in isolation. This bridges skills and subagents without needing a separate agent file.

Parallel sessions

Power users run multiple Claude Code instances simultaneously. Each needs its own git worktree or full checkout to avoid file conflicts:

git worktree add ../feature-auth -b feature/auth
git worktree add ../feature-search -b feature/search
# Run separate Claude Code sessions in each

Boris Cherny runs 5 local + 5-10 remote sessions simultaneously.

Community perspective on custom subagents

Shrivu Shankar (enterprise scale, billions of tokens/month) argues custom subagents are "brittle" because they "gatekeep context." He prefers letting Claude self-orchestrate via the built-in Task tool. Others find custom agents valuable within plugins. The consensus: use built-in agents for most work; create custom agents only for persistent specialized behavior.

๐Ÿ“– Official docs: code.claude.com/docs/en/sub-agents


6. Hooks: deterministic control in a probabilistic system

CLAUDE.md instructions are suggestions Claude should follow. Hooks are guarantees. They execute as app-level code at specific lifecycle points, regardless of what the LLM decides.

The practitioner wisdom: "CLAUDE.md suggests; hooks enforce."

Lifecycle events

Event When it fires Common use
SessionStart New session, resume, clear, compact Inject context, set up environment
UserPromptSubmit After you submit, before Claude processes Validate prompts, add context
PreToolUse Before Claude executes a tool Block dangerous commands, modify inputs
PermissionRequest When permission dialog appears Auto-allow or auto-deny
PostToolUse After tool completes successfully Auto-format, run tests
Stop / SubagentStop Agent finishes responding Force continuation ("keep going")
Notification Async events (permission, idle, auth) Desktop notifications
PreCompact Before compaction Preserve key context
SessionEnd Session terminates Cleanup only

Configuration

Hooks live in settings.json (user, project, or local scope):

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{
        "type": "command",
        "command": "npx prettier --write \"$(jq -r '.tool_input.file_path')\"",
        "timeout": 30
      }]
    }]
  }
}

How hooks communicate

Claude Code also supports prompt-based hooks (type: "prompt") that query Haiku for context-aware decisions.

Practical examples

Pro tip: block at commit time, not write time

From Shrivu Shankar: blocking mid-plan confuses the agent. Instead, use a PreToolUse hook on Bash(git commit) that checks for a test-pass flag file. This forces Claude into a natural test-and-fix loop before committing.

Use /hooks to view, add, and manage hooks interactively. Changes take effect immediately.

๐Ÿ“– Official docs: code.claude.com/docs/en/hooks ยท code.claude.com/docs/en/hooks-guide


7. MCP connects Claude to external tools

The Model Context Protocol (MCP) is an open-source standard for connecting AI applications to external tools and data sources. Introduced by Anthropic in November 2024, now under the Linux Foundation. Over 97 million monthly SDK downloads and 10,000+ active servers. Supported across Claude, ChatGPT, Cursor, Gemini, VS Code, and more.

What MCP servers provide

Adding servers

# HTTP transport (recommended for remote)
claude mcp add --transport http github https://api.githubcopilot.com/mcp/

# Stdio transport (local processes)
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub \
  --dsn "postgresql://readonly:password@host:5432/analytics"

Configuration scopes

Scope Location Shared?
Project .mcp.json at project root Yes, via version control
Local ~/.claude.json under project path No
User ~/.claude.json globally No

Environment variables expand in all fields: ${VAR} or ${VAR:-default}.

Popular integrations

GitHub, Sentry, PostgreSQL/databases, Notion, Slack, Playwright (browser automation), Stripe, Asana, Figma, and hundreds more at github.com/modelcontextprotocol/servers.

Context budget warning

Every connected MCP server loads tool definitions into the context window before any conversation begins. Real measurements:

MCP Tool Search (shipped January 2026) addresses this: when tool descriptions exceed 10% of the context window, tools load on-demand via search instead of being preloaded. Result: 85% reduction in token overhead.

Monitor context usage with /context. Configure limits with MAX_MCP_OUTPUT_TOKENS.

๐Ÿ“– Official docs: code.claude.com/docs/en/mcp ยท modelcontextprotocol.io


8. Plugins bundle everything for distribution

Plugins package skills, agents, hooks, MCP servers, and LSP servers into installable units. They solve: "how do I share my Claude Code setup with the team?"

Plugin structure

my-plugin/
โ”œโ”€โ”€ .claude-plugin/
โ”‚   โ””โ”€โ”€ plugin.json    # Manifest (only "name" required)
โ”œโ”€โ”€ skills/
โ”œโ”€โ”€ agents/
โ”œโ”€โ”€ commands/
โ”œโ”€โ”€ hooks/
โ”‚   โ””โ”€โ”€ hooks.json
โ”œโ”€โ”€ .mcp.json
โ””โ”€โ”€ .lsp.json

Claude Code auto-discovers components in default locations. Commands from plugins are namespaced as plugin-name:command-name to prevent conflicts.

Installation scopes

Marketplaces

Marketplaces are curated collections hosted as GitHub repos. Anthropic maintains the official one at anthropics/claude-plugins-official.

/plugin marketplace add anthropics/claude-plugins-official

The /plugin command opens a tabbed interface for discovering, installing, enabling/disabling, and updating.

Notable official plugins

๐Ÿ“– Official docs: code.claude.com/docs/en/plugins-reference ยท code.claude.com/docs/en/discover-plugins


9. Prompt engineering for Claude Code

Prompting Claude Code differs from prompting the Claude API. Your instructions shape multi-step autonomous behavior, not a single response.

Be specific

โŒ "Add tests for foo.py" โœ… "Write a test case for foo.py covering the edge case where the user is logged out. Avoid mocks."

โŒ "Why does ExecutionFactory have such a weird API?" โœ… "Look through ExecutionFactory's git history and summarize how its API evolved."

Reference specific files and patterns. Claude takes instructions literally.

State what to do, not what to avoid

โŒ "Do not use markdown" โœ… "Respond in plain prose paragraphs"

Describing behaviors to avoid can prime those behaviors.

Use Plan Mode as a prompting strategy

Start in Plan Mode โ†’ iterate โ†’ execute. This separation consistently produces better results than jumping straight to coding.

CLAUDE.md is persistent prompt engineering

Treat it like any prompt โ€” iterate, test, refine. Add emphasis with "IMPORTANT" or "YOU MUST" for critical rules.

Match thinking depth to problem complexity

Extended thinking can make Claude more verbose on basic tasks. Don't over-apply.

Use checklists for complex work

Have Claude create a Markdown checklist file and work through items one by one. Creates a durable record that survives context resets and helps Claude track progress.

Course correct early

Don't keep correcting in a polluted context.

๐Ÿ“– Official docs: docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview


10. Putting it all together: how power users work

Boris Cherny (Claude Code's creator)

Shrivu Shankar (enterprise, billions of tokens/month)

The pattern both converge on

  1. CLAUDE.md establishes the constitution
  2. Plan Mode for every non-trivial task
  3. Auto-Accept Mode once the plan is solid
  4. Skills auto-activate based on task context
  5. Hooks enforce what CLAUDE.md suggests
  6. Subagents handle exploration and parallel work
  7. MCP connects to GitHub, Slack, databases, Playwright
  8. /clear often โ€” every new task starts fresh

The throughline: context management is the real skill. The 200K token window is your most precious resource. Everything in Claude Code's design โ€” progressive disclosure of skills, isolated subagent contexts, MCP Tool Search โ€” exists to use that window efficiently.


11. The Agent SDK (a brief look ahead)

The Claude Agent SDK provides the same tools, agent loop, and context management that power Claude Code โ€” programmable in Python and TypeScript. It's for building custom AI agents you embed in your own applications.

When to use what:

The SDK supports all Claude Code features: built-in tools, hooks as callbacks, subagents, MCP, skills, structured outputs, and budget controls (max_budget_usd).

We'll cover the Agent SDK in depth in the next post.

๐Ÿ“– Official docs: platform.claude.com/docs/en/agent-sdk/overview ยท github.com/anthropics/claude-agent-sdk-python ยท anthropic.com/engineering/building-agents-with-the-claude-agent-sdk