Claude Code Advanced Full Course thumbnail

Claude Code Advanced Full Course

Deep Dive · Nick Saraev · 12 Modules · ~3h 18m
Claude Code Advanced Full Course thumbnail
⏱ ~3h 18m 🎤 Nick Saraev 🏷 Claude Code 🏷 Agent Harnesses 🏷 Skills 🏷 Parallelization 🏷 Security

01 CLAUDE.md & System Prompts ▶ 2:42

Nick opens with the most important concept: what CLAUDE.md actually IS. Most users treat it as a simple config file, but it serves three distinct and critical roles.

🔹 The Three Roles of CLAUDE.md

  1. A System Prompt Wrapper — CLAUDE.md becomes the system prompt that controls Claude's behavior. Unlike raw system prompts via API, CLAUDE.md is version-controlled, shareable, and persistent. It travels with your repository.
  2. A Project Map ▶ 4:03 — Contains project structure, conventions, tech stack info. Tells Claude what the codebase looks like. Critical because it reduces wasted tokens on exploration.
  3. A Skill Router ▶ 5:01 — When CLAUDE.md references skills, it acts as a dynamic dispatch layer. Claude reads CLAUDE.md, sees available skills, and selects the right one for the current task.

🔹 Layered CLAUDE.md Hierarchy ▶ 8:39

CLAUDE.md files are cumulative — Claude walks UP the directory tree loading all CLAUDE.md files:

  • ~/.claude/CLAUDE.md — Global (applies to all projects)
  • ~/projects/CLAUDE.md — Workspace-level
  • ~/projects/my-app/CLAUDE.md — Project-specific

All layers merged together for fine-grained control at different scopes.

🔹 Key Advice for CLAUDE.md

  • Keep it concise — every extra word is tokens Claude must process
  • Focus on what matters — conventions, gotchas, project structure
  • Use natural language — Claude reads it like documentation
  • Use lab notes ▶ 12:12 to document failed approaches so Claude doesn't repeat mistakes
  • Profile sections ▶ 13:15 for user-specific context

🔹 The Lab Notes Pattern ▶ 17:00

A section documenting failed approaches so Claude doesn't repeat mistakes. High-ROI pattern.

🔹 Profile Sections and User Context ▶ 22:33

02 Agent Harnesses ▶ 34:38

Nick defines what an "agent harness" actually means: Claude Code IS the harness around the model that enables tool calling and actual work. The model alone is just a text predictor — the harness turns it into an agent.

🔹 Components of the Harness

  • The system prompt (CLAUDE.md) — behavioral instructions
  • Tool definitions — file editing, terminal, search, etc.
  • Memory systems — persistent context across sessions
  • Skills — reusable workflow definitions
  • MCP servers — external tool integrations
  • Hooks — pre/post-execution actions
  • Security configurations — permission boundaries

🔹 Building Harnesses: Code Walkthrough ▶ 37:42

Critical mental model shift: stop thinking "I'm writing a prompt" and start thinking "I'm building infrastructure for an AI worker."

💡 Key Insight: When debugging bad Claude Code output, don't just tweak the prompt. Examine the entire harness: are the right tools available? Is memory stale? Are skills loaded? The issue is often in the infrastructure, not the instructions.

03 Parallelization ▶ 42:39

Long-running sequential tasks waste enormous time. Instead of tasks 1→2→3→4 sequentially, stack tasks 2, 3, 4 in parallel, then synthesize results.

🔹 Why Parallelize?

  • Speed — N tasks at T seconds each complete in T seconds (not N×T)
  • Quality — Multiple perspectives yield better solutions
  • Resilience — If one agent path fails, others may succeed

🔹 Agents Are Stochastic

Fundamental truth: agents don't produce the same output every time. Same prompt + context = different approaches, code, solutions. Nick reframes this as a strength for consensus patterns.

🔹 The Stochastic Consensus Pattern ▶ 45:09

Star pattern of the parallelization section:

  • Spawn multiple agents on the same task with different approaches
  • Each produces an independent solution
  • A synthesizer agent evaluates all solutions and picks the best / merges them

Demo at ▶ 54:22

🔹 Sub-Agent Coordination ▶ 1:00:59

🔹 Stochastic Consensus Skill Demo ▶ 1:03:18

04 Agent Teams ▶ 1:10:06

Agent teams go beyond simple sub-agents. Multiple specialized agents collaborate simultaneously.

🔹 Teams vs. Simple Sub-Agents

  • Simple: Parent assigns → sub-agent completes → returns result. One-directional and sequential.
  • Teams: Multiple specialized agents work simultaneously on different aspects, with coordination and consensus/synthesis step.

🔹 Agent Teams + Skills Combination ▶ 1:11:09

Read a skill definition, then use agent teams to spawn specialized workers based on the skill's requirements. Skills provide SOPs, teams provide execution model.

🔹 Spawning Specialized Sub-Agents ▶ 1:14:56

05 Skills & Sub-Agents ▶ 1:09:36

Skills are markdown files with structured definitions that encode reusable workflows. Teaching Claude repeatable procedures.

🔹 Skill Anatomy

A SKILL.md file contains: Name, Description, Allowed tools, SOPs (Standard Operating Procedures), MCP tool references.

🔹 Skills in Practice

Nick demonstrates the Model-Chat Skill ▶ 1:06:55 — structured conversation. Skill Organization patterns.

🔹 Sub-Agents Explained

Sub-agents are spawned Claude Code instances that handle subtasks and return results to the parent agent.

06 Context Management ▶ 1:17:28

Context management is about all the files, folders, and methods you put into a workspace to help Claude understand and navigate the project.

🔹 The Context Toolkit

  • CLAUDE.md files (layered hierarchy) — static instructions
  • SKILL.md files — reusable procedures
  • MCP server connections — dynamic external context
  • Memory files — persistent learned context across sessions
  • Organizational hierarchy of agents — delegation structure ▶ 1:24:19
💡 Key Insight: "These are just different ways of organizing information." Skills, memory, sub-agents, MCP servers — they're all context management tools. None are magic; they're just structured ways to give Claude the right information.

07 Karpathy's Auto-Research Approach ▶ 1:30:13

Inspired by Andrej Karpathy: use agents to progressively improve things over time through automated research loops.

🔹 The Auto-Research Loop ▶ 1:33:04

  1. Define a metric to improve (page load speed, CLS score, test coverage)
  2. Agent researches current state and proposes improvements
  3. Agent implements changes
  4. Agent measures results against the metric
  5. Loop: if improved, keep; if not, revert and try another approach
  6. Repeat until target reached or diminishing returns
💡 Key Insight: This is recursive self-improvement applied to practical coding tasks.

🔹 The Power of Metrics

The loop only works if you have a clear, measurable metric. Vague goals produce vague results.

🔹 When Auto-Research Fails ▶ 1:39:51

Fails when metrics are subjective, problem space is too broad, or the agent lacks necessary context.

08 Browser Automation ▶ 1:44:07

Nick compares three major approaches to browser automation.

🔹 Approach 1: Computer Use (Anthropic)

Screenshot-based — takes screenshots and clicks at specific coordinates. Like a human looking at a monitor.

  • ✅ Works on anything — desktop apps, native UIs
  • ❌ Lower precision for web tasks, slower

🔹 Approach 2: Browser Use ▶ 1:58:11

DOM-based — interacts with actual HTML elements.

  • ✅ Higher precision for web tasks
  • ✅ Can read specific elements
  • ❌ Only works with web content

🔹 Approach 3: Playwright/MCP

Most precise, code-driven automation. Direct API-level access to browser.

09 Performance Fluctuations ▶ 2:00:55

Nick honestly acknowledges Claude Code performance varies — sometimes dramatically. Inherent to LLM-based agents.

🔹 Strategies for Dealing with Variance

  • Model Switching — different models for different tasks
  • Retry Patterns — retry with different framing, not same prompt
  • Multi-Agent Orchestration — consensus from multiple agents
  • Context Window Hygiene — fresh context when performance degrades
💡 Key Insight: Bad outputs usually signal a harness problem, not a model problem.

10 Workspace Organization ▶ 2:24:18

Nick reveals his personal workspace structure for his $4M/year business running on Claude Code daily.

🔹 Nick's Workspace Structure

  • Root level: Business workspaces separated by concern
  • Each workspace: .claude/ folder with CLAUDE.md, skills, memory
  • Client projects: Separate from business projects
  • Global skills: Shared across all workspaces
  • Client-specific skills: Scoped to individual clients

🔹 Information Hierarchy ▶ 2:25:14

  • Global CLAUDE.md (~/.claude/CLAUDE.md) — universal rules
  • Business CLAUDE.md — business-wide conventions
  • Project CLAUDE.md — project-specific context

11 Security ▶ 2:39:14

Two camps: accelerationists ("Claude Code for everything") vs. security-paranoid. Nick advocates 80/20 security.

🔹 The 80/20 Security Approach ▶ 2:40:52

Low-Hanging Fruit:

  • Never store secrets in code — use .env files
  • Enable Row Level Security (RLS) on databases, especially Supabase ▶ 2:44:52
  • Auto mode considerations — understand what you're approving
  • OAuth implications — careful with third-party integrations Claude configures
⚠️ Real Finding: Nick's security audit found significant issues with standard Claude setups.

12 The Future of Claude Code & AI Development ▶ 3:00:23

Nick's predictions for AI-assisted development.

🔹 Short-Term Predictions (Months)

Better model reliability, improved context handling, more robust tool calling.

🔹 Medium-Term Predictions (1–2 Years) ▶ 3:01:31

Multi-modal agents, agent teams become standard workflow, better inter-agent communication.

🔹 Long-Term Vision

AI becomes true development partner, not just tool. Continuous autonomous improvement.

🔹 Career Advice for Developers ▶ 3:06:12

The developers who learn to build effective harnesses NOW will have enormous advantage. Harness engineering is the new high-leverage skill.

🎯 Key Takeaways

  1. CLAUDE.md is three things: system prompt, project map, and skill router
  2. Agent harness > model — infrastructure matters more than prompt engineering
  3. Stochastic consensus: spawn multiple agents, synthesize best results
  4. Agent teams collaborate simultaneously vs sub-agents work sequentially
  5. Skills are reusable markdown SOPs — the most powerful pattern in advanced usage
  6. Context management: CLAUDE.md, skills, MCP, memory are all just information organization
  7. Karpathy's auto-research: define metric → implement → measure → loop
  8. Browser automation: Computer Use (visual) vs Browser Use (DOM) vs Playwright (code)
  9. Performance variance is normal — fix the harness, not the prompt
  10. Workspace organization: layered CLAUDE.md hierarchy (global → business → project)
  11. 80/20 security: .env files, RLS, understand auto-mode permissions
  12. Harness engineering is the new high-leverage career skill

⏱ Full Timestamps

▶ 0:00 Introduction
▶ 2:42 CLAUDE.md & System Prompts
▶ 4:03 CLAUDE.md as Project Map
▶ 5:01 CLAUDE.md as Skill Router
▶ 8:39 Layered CLAUDE.md Hierarchy
▶ 12:12 Lab Notes Pattern
▶ 13:15 Profile Sections
▶ 17:00 Lab Notes Demo
▶ 22:33 User Context
▶ 34:38 Agent Harnesses
▶ 37:42 Building Harnesses
▶ 42:39 Parallelization
▶ 45:09 Stochastic Consensus Pattern
▶ 54:22 Consensus Demo
▶ 1:00:59 Sub-Agent Coordination
▶ 1:03:18 Consensus Skill Demo
▶ 1:06:55 Model-Chat Skill
▶ 1:09:36 Skills & Sub-Agents
▶ 1:10:06 Agent Teams
▶ 1:11:09 Teams + Skills
▶ 1:14:56 Spawning Sub-Agents
▶ 1:17:28 Context Management
▶ 1:24:19 Agent Hierarchy
▶ 1:30:13 Karpathy Auto-Research
▶ 1:33:04 Auto-Research Loop
▶ 1:39:51 When Auto-Research Fails
▶ 1:44:07 Browser Automation
▶ 1:58:11 Browser Use
▶ 2:00:55 Performance Fluctuations
▶ 2:24:18 Workspace Organization
▶ 2:25:14 Information Hierarchy
▶ 2:39:14 Security
▶ 2:40:52 80/20 Security
▶ 2:44:52 RLS on Databases
▶ 3:00:23 Future of AI Dev
▶ 3:01:31 Medium-Term Predictions
▶ 3:06:12 Career Advice