This is Part 2 of a 3-part series on Mastering Claude Code in 2026.


In Part 1, we set up our environment and explored the interface. Now, let’s look at how to actually drive Claude Code as an expert by focusing on context, planning, and specialized skills.


Part 8: CLAUDE.md — Your Project’s Brain

This is arguably the most important concept in Claude Code, and most people skip it.

CLAUDE.md is a markdown file that Claude reads automatically at the start of every session. It’s your project’s persistent memory — the context that makes Claude useful instead of generic.

What Goes in CLAUDE.md?

What — your tech stack, directory structure, and key files.

Why — the purpose of each module, design decisions, gotchas.

How — build/test/lint commands, deployment workflows, coding conventions.

Here’s a real-world example:

# CLAUDE.md

## Tech Stack
SvelteKit + TypeScript + Tauri (desktop app)

## Commands
- `npm run dev` — Start dev server on port 5173
- `npm run build` — Production build
- `npm test` — Run Vitest tests
- `npm run lint` — ESLint + Prettier check

## Architecture
- `/src/routes` — SvelteKit pages and API routes
- `/src/lib` — Shared components and utilities
- `/src-tauri` — Rust backend for desktop

## Conventions
- Use Svelte 5 runes syntax ($state, $derived, $effect)
- TypeScript strict mode, no `any` types
- All components use `.svelte` extension
- Commit messages: imperative mood, < 72 chars

## Gotchas
- Tauri commands must be registered in `src-tauri/src/lib.rs`
- CSS modules don't work with Svelte — use scoped styles
- The auth token is stored in Tauri's secure storage, not localStorage

Keep It Concise

Aim for 50-100 lines in the root file. For each line, ask: “Would removing this cause Claude to make a mistake?” If not, cut it.

The CLAUDE.md Hierarchy

Claude Code loads memory files in layers:

Global (~/.claude/CLAUDE.md) — applies to all your projects. Put your personal preferences here: preferred languages, coding style, how you like commit messages formatted.

Project root (CLAUDE.md or .claude/CLAUDE.md) — applies to this project. This is where your tech stack, commands, and conventions go. Commit this to version control so your team gets the same context.

Subdirectory (frontend/CLAUDE.md) — applies only when working in that directory. Use for package-specific conventions in monorepos.

Each level appends to the parent. Subfolder files add context; they never overwrite the root.

Generate It Automatically

Don’t want to write it from scratch? Run:

/init

Claude Code analyzes your codebase and generates a starter CLAUDE.md with detected build systems, test frameworks, and code patterns. Edit it from there.


Part 9: Plan Mode vs. Just Doing It

Claude Code has two main work modes, and knowing when to use each is the difference between “wow, that was fast” and “oh no, what did it just do?”

Plan Mode

Activated with /plan or by pressing Shift+Tab until you see “Plan” in the mode indicator.

In Plan Mode, Claude explores your codebase, thinks through the approach, outlines steps, and waits for your approval before making any changes. It’s read-only until you say go.

Use Plan Mode when:

  • The task touches more than 2-3 files
  • You’re unfamiliar with part of the codebase
  • There are multiple valid approaches and you want to choose
  • The change has architectural implications (refactors, migrations, new features)
  • You want to understand before you commit

Example workflow:

/plan
Refactor the authentication module to use JWT tokens instead of session cookies

Claude will explore the relevant code, identify all the files involved, outline the migration steps, flag potential issues, and present the plan. You review, adjust, and then approve execution.

Direct Execution (Auto Accept)

Toggle with Shift+Tab to “Auto Accept” or press Tab for auto-approve on individual actions.

In this mode, Claude just does the work. It reads files, makes changes, runs commands — with minimal interruption.

Use Direct Execution when:

  • The task is well-scoped and simple (fix this one bug, add this one test)
  • You have a clear stack trace pointing to the problem
  • You’re iterating rapidly and trust the direction
  • The changes are easily reversible (you’re using git, right?)

The Best Workflow: Combine Both

Start in Plan Mode to investigate and design. Once you’ve approved the plan, switch to Direct Execution for implementation. This gives you the safety of planning with the speed of autonomous execution.


Part 10: Skills — Your Custom Superpowers

Skills are reusable prompts that show up as slash commands. They’re how you teach Claude Code your specific workflows.

Every skill needs a SKILL.md file with two parts: YAML frontmatter (the configuration) and markdown content (the instructions).

Creating a Skill

Create a file at .claude/skills/deploy/SKILL.md:

---
name: deploy
description: Deploy the application to production
argument-hint: "[environment]"
user-invocable: true
---

Deploy the application to the $ARGUMENTS environment (default: staging).

Steps:
1. Run the test suite first
2. Build the production bundle
3. Deploy using the deploy script
4. Verify the deployment is healthy
5. Report the deployment URL

Now you can type /deploy production and Claude follows your playbook.

Skill Scoping

Project skills (.claude/skills/) — shared via version control, available to your whole team.

Personal skills (~/.claude/skills/) — available across all your projects, just for you.

Advanced Skill Features

context: fork — runs the skill in an isolated sub-agent context. Great for skills that produce verbose output (like codebase analysis) so they don’t pollute your main conversation.

allowed-tools — restricts which tools the skill can use. For example, limit a read-only analysis skill to just Read, Grep, Glob so it can’t accidentally modify files.

model — run a specific skill on a different model. Use claude-3-5-haiku-20241022 for fast, cheap skills like linting checks.

Skills vs. CLAUDE.md

Think of it this way: CLAUDE.md is always loaded (universal context). Skills are on-demand (task-specific workflows). Put your coding conventions in CLAUDE.md. Put your deployment workflow in a skill.


Part 11: MCP — Connecting Claude Code to the World

MCP (Model Context Protocol) is how you give Claude Code access to external tools and data sources. Think of it as plugins for your AI agent.

With MCP, Claude Code can connect to GitHub, your database, Slack, Jira, Google Drive — whatever you need. Each connection is an “MCP server” that exposes tools Claude can use.

Configuring MCP Servers

Create a .mcp.json file in your project root:

{
  "mcpServers": {
    "github": {
      "type": "stdio",
      "command": "npx",
      "args": ["@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
      }
    }
  }
}

Notice the ${GITHUB_TOKEN} syntax — this pulls from your environment variables so you never commit secrets to version control.

MCP Scoping

Project-level (.mcp.json) — shared with your team via git. Use for standard integrations everyone needs (GitHub, your staging database).

User-level (~/.claude/.mcp.json) — personal servers that apply to all your projects. Use for experimental tools or personal integrations.

Managing MCP in a Session

Use /mcp during a session to see connected servers, enable/disable connections, and troubleshoot issues.

When to Use MCP vs. CLI Tools

If a single CLI command does the job (gh pr list, aws s3 ls), just use the CLI tool through Claude Code’s Bash capability. MCP shines when you need richer, structured interactions — browsing issue lists, querying databases, managing complex workflows across services.


Part 12: Hooks — Automation Guardrails

Hooks are scripts that run automatically at specific points in Claude Code’s workflow. They’re deterministic callbacks — they always run, unlike prompt-based instructions that Claude might occasionally skip.

Three Types of Hooks

PreToolUse — runs before Claude executes a tool. Use it to validate, block, or modify tool calls. Example: block any rm -rf commands, or prevent refunds above a certain amount.

PostToolUse — runs after a tool returns results. Use it to normalize data formats, log results, or trigger notifications.

Notification — runs when Claude wants to notify you about something.

Configuring Hooks

In your .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "scripts/validate-command.sh",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Exit codes control behavior: 0 = allow, 2 = block.

Why Hooks Matter

Prompt instructions are probabilistic — Claude will usually follow them. Hooks are deterministic — they always run. For anything safety-critical (blocking destructive commands, enforcing code style, requiring tests before commits), use hooks instead of relying on prompt instructions alone.


Part 13: Working with Multiple Agents

As of early 2026, Claude Code supports multi-agent workflows. This is where things get powerful.

Subagents

You can define custom subagents in .claude/agents/. Each agent has its own personality, tool access, and instructions. Think of them as specialized teammates.

---
name: security-reviewer
description: Reviews code for security vulnerabilities
model: claude-opus-4-6
allowed-tools: Read, Grep, Glob
---

You are a security-focused code reviewer.
Focus on: SQL injection, XSS, exposed credentials, insecure configurations.
Do not suggest style changes — only security issues.

Git Worktrees — Parallel Work Without Conflicts

Claude Code supports git worktrees, which create isolated copies of your codebase for each agent or session. No file conflicts between parallel agents.

# Create an isolated worktree session
claude --worktree feature-auth

# Combined with tmux for background work
claude --worktree feature-auth --tmux

This is the infrastructure that makes Agent Teams and batch processing safe. Each agent gets its own copy of the code.

The Coordinator Pattern

For complex workflows, you can set up a coordinator agent that delegates to specialized subagents: one for web search, one for code analysis, one for writing tests, one for documentation. The coordinator breaks down the task, assigns subtasks, and combines the results.

This is enterprise-grade architecture running from your terminal.


Part 14: Claude Code in CI/CD

Claude Code isn’t just for interactive development. You can integrate it into your automated pipelines.

Running in Pipelines

Use the -p flag for non-interactive mode:

claude -p "Review this pull request for security issues and code quality"

This processes the prompt, outputs the result, and exits — no interactive input needed. Without -p, Claude Code will hang waiting for user input, which breaks CI/CD pipelines.

Structured Output for Automation

claude -p "List all TODO comments with file and line number" \
  --output-format json \
  --json-schema '{"type": "array", "items": {"type": "object", "properties": {"file": {"type": "string"}, "line": {"type": "integer"}, "comment": {"type": "string"}}}}'

This gives you machine-parseable output you can pipe into other tools, post as PR comments, or feed into dashboards.

CI/CD Best Practices

Use separate Claude instances for generating code and reviewing it. A model reviewing its own output in the same session is less effective than an independent review.

Include prior review findings in context when re-running reviews after new commits, and instruct Claude to report only new or still-unaddressed issues to avoid duplicate comments.

Document your testing standards, valuable test criteria, and available fixtures in CLAUDE.md so CI-invoked Claude Code generates high-quality, non-redundant tests.


In Part 3, we’ll finish with Cost Management, the Daily Workflow, and the new Claude Architect Certification.


The Truly Deep Claude Code FAQ

Frequently Asked Questions

What is Claude?

Claude is an AI assistant made by Anthropic. You chat with it at claude.ai or in the Claude app. It can write, analyze, brainstorm, code, and explain things — all within a conversation window. Think of it as a very smart collaborator you talk to through text.

What is Claude Code?

Claude Code is a tool that runs in your terminal (the command-line interface on your computer). Unlike the chat version, Claude Code can see your actual files, edit your code, run commands, and manage git — all through natural language. You tell it what you want, it does the work, and you approve the changes.

What's a terminal?

The terminal (also called command line, shell, or console) is the text-based interface on your computer where you type commands instead of clicking buttons. On Mac, it’s the Terminal app. On Windows, it’s PowerShell or Command Prompt. It looks like a black or dark window with a blinking cursor.

What is CLAUDE.md?

A markdown file you put in your project folder that Claude reads automatically at the start of every session. It contains your project’s tech stack, build commands, coding conventions, and gotchas. Think of it as a briefing document that makes Claude actually useful for your specific project instead of giving generic answers.

What does 'agentic' mean?

In AI context, ‘agentic’ means the AI can take autonomous actions — not just respond to questions. Claude Code is agentic because it can read files, write code, run tests, and execute commands on its own (with your permission), rather than just generating text for you to copy-paste.

What is MCP?

MCP stands for Model Context Protocol. It’s an open standard that lets AI tools connect to external apps and data sources. Think of it as USB for AI — a universal plug that lets Claude talk to GitHub, Slack, your database, your file system, or any tool that supports the protocol.

What are Connectors?

Connectors are pre-built integrations that let Claude access your work tools — Gmail, Google Drive, Slack, Asana, Figma, Notion, and 50+ more. You set them up with a couple of clicks through OAuth (the ‘Sign in with Google’ type flow). They’re built on MCP under the hood.

What is the Filesystem connector?

A specific MCP server that gives Claude direct access to files and folders on your computer. You specify which directories Claude can touch, and it can read, write, create, move, and search files within those directories. It asks permission before every action.

What is Cowork?

Cowork is a feature in Claude Desktop that gives you Claude Code’s power without opening a terminal. You describe a task, Claude breaks it into steps, executes them in an isolated environment on your computer, and delivers finished work — organized files, formatted documents, compiled research. It’s designed for knowledge workers, not just developers.

What is Dispatch?

A feature inside Cowork that lets you send tasks to Claude from your phone. Claude works on your desktop computer, and you come back to the finished result. Your phone is the remote control; your desktop does the processing.

What is Computer Use?

A research preview feature (March 2026) that lets Claude navigate your actual screen — clicking, typing, opening apps — when there isn’t a connector available. Claude prioritizes connectors first (faster, more reliable), then falls back to screen control as a last resort. Currently macOS only.

What is Plan Mode?

A mode in Claude Code where Claude explores your codebase and proposes a plan before making any changes. It’s read-only until you approve. Use it for complex tasks, unfamiliar code, or anything touching multiple files. Toggle it with /plan or Shift+Tab.

What are Skills?

Reusable prompts that show up as slash commands in Claude Code. You create a SKILL.md file with instructions, and Claude follows that playbook when you invoke the skill. Example: a /deploy skill that runs your test suite, builds, deploys, and verifies — triggered with one command.

What are Hooks?

Scripts that run automatically at specific points in Claude Code’s workflow — before a tool runs (PreToolUse), after it returns (PostToolUse), or on notifications. Unlike prompt instructions (which Claude might occasionally skip), hooks always run. Use them for safety guardrails, data normalization, or compliance rules.

What does /compact do?

It compresses your conversation history to free up context window space. Use it when your session has been going for a while and responses start feeling less precise or Claude starts ‘forgetting’ earlier context. You can specify what to keep: /compact retain the error handling patterns.

What's a context window?

The total amount of text (measured in tokens) that Claude can ‘see’ at once during a conversation. It includes your messages, Claude’s responses, file contents, and tool results. When it fills up, Claude starts losing track of earlier information. Opus 4.6 supports up to 1 million tokens.

What's a token?

A unit of text that AI models process. Roughly, 1 token ≈ ¾ of a word in English. So 1,000 tokens ≈ 750 words. Tokens matter because they determine cost (on API) and how much context Claude can hold at once.

What is git?

A version control system that tracks changes to your files over time. Think of it as unlimited undo + a complete history of every change ever made. Developers use it to safely experiment (you can always revert) and collaborate (multiple people can work on the same codebase). Claude Code can manage git operations through natural language.

What is CI/CD?

Continuous Integration / Continuous Deployment. It’s the automated pipeline that tests your code, checks for issues, and deploys it to production whenever you push changes. Claude Code can integrate into CI/CD pipelines to automatically review pull requests, generate tests, and provide feedback.

What does -p mean in claude -p?

The -p flag (or –print) runs Claude Code in non-interactive mode. It processes your prompt, outputs the result, and exits — no interactive input needed. Essential for automation and CI/CD pipelines where there’s no human to type responses.

What's the difference between Opus, Sonnet, and Haiku?

Three Claude models at different capability/speed tradeoffs. Opus 4.6 is the most powerful (deep reasoning, complex tasks). Sonnet 4.6 balances speed and intelligence (everyday work). Haiku 4.5 is the fastest and cheapest (simple tasks). Use Sonnet for 80% of your work, Opus for the hard 20%.

Can I use Claude Code with local models or NVIDIA GPUs?

Yes. While Claude Code defaults to Anthropic’s cloud, you can use Ollama to run models like NVIDIA Nemotron or Qwen3 through an Anthropic-compatible local gateway. See our guide on Launching Claude, Codex, and OpenClaw with Ollama for the full CLI setup.

Do I need to be a developer to use any of this?

For Claude chat and Connectors — no. For Cowork — no, it’s designed for knowledge workers. For Claude Code — you need to be comfortable (or willing to learn) the terminal. The article walks you through every step.

How much does it cost?

Claude Pro at $20/month includes Claude chat, Connectors, Cowork, and Claude Code. Claude Max at $100-200/month adds higher usage limits. All connectors are free — you just need the paid Claude plan and a subscription to the tool you’re connecting.


System Update: Thinking Modes

Explore the Framework

These concepts are part of a broader framework for building intent-aware AI systems. I've distilled these strategies into a short, practical guide called Thinking Modes.

View the Book →

Carmelyne is a Full Stack Developer and AI Systems Architect. She is a previously US-bound Filipino solopreneur, former Media and Information Literacy and Empowerment Technologies instructor, and the author of Thinking Modes: How to Think With AI — The Missing Skill.