Deep Dive — Advanced Course

Claude Code Advanced Full Course

Mastering Agent Teams, Auto-Research, Browser Automation & Beyond
Nick Saraev ~3:18:23 12 Modules

Video embed unavailable in this context.

Watch on YouTube

📋 Course Overview

Nick Saraev delivers a comprehensive 3-hour advanced course on Claude Code, covering everything from CLAUDE.md optimization to agent teams, auto-research workflows, browser automation, security audits, workspace organization, and the future of AI-assisted development. This is aimed at intermediate-to-advanced users already familiar with Claude Code basics.

Nick runs a $4M/year business using Claude Code daily and teaches ~2,000 people how to use these tools. This course distills his production-grade workflows into actionable frameworks you can apply immediately.

🎯 Who this is for: Developers who've used Claude Code and want to go from "useful assistant" to "autonomous development partner." If you haven't used Claude Code at all, start with the basics first.

Table of Contents

1
CLAUDE.md and System Prompts

Nick opens the course with arguably the most important concept: understanding 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 you'd pass via API, CLAUDE.md is version-controlled, shareable, and persistent. It travels with your repository. When Claude Code starts, it reads CLAUDE.md and uses it as foundational instructions for everything that follows.

2. A Project Map

Contains project structure, conventions, tech stack info. It tells Claude what the codebase looks like and where things are. This is critical because it reduces exploratory searches that waste context. Without a good project map, Claude will spend tokens reading files just to figure out your project structure — tokens that could be spent on actual work.

4:03

3. A Skill Router

When CLAUDE.md references skills, it acts as a dispatch table. Claude reads the CLAUDE.md, sees available skills, and loads the appropriate one based on the task. This is the most advanced usage pattern and turns CLAUDE.md into a dynamic routing layer.

5:01

🔹 Layered CLAUDE.md Hierarchy

8:39

CLAUDE.md files are hierarchical — Claude walks UP the directory tree, loading all CLAUDE.md files it finds:

All layers are merged together, giving you fine-grained control over Claude's behavior at different scopes.

🔹 Key Advice for CLAUDE.md

🔹 The Lab Notes Pattern

17:00

Include a "Lab Notes — What NOT to Do" section documenting failed approaches so Claude doesn't repeat mistakes. This is a high-ROI pattern: Claude reads the lab notes and avoids previously-attempted dead ends.

💡 Pro Tip: Lab notes are especially valuable in long-running projects where you've already tried and discarded certain approaches. Without them, Claude will waste time rediscovering the same dead ends.

🔹 Profile Sections and User Context

22:33

Nick recommends including a brief profile section in your global CLAUDE.md — your role, expertise level, preferred communication style. This helps Claude calibrate its responses appropriately.

2
Agent Harnesses

Nick defines what an "agent harness" actually means: Claude Code IS the harness around the model Claude 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 harness includes all the infrastructure that wraps around the base model:

💎 Key Insight: "The harness matters as much as the model." Two identical models with different harnesses will produce vastly different results. This is why Claude Code outperforms raw API Claude for development tasks — the harness provides the scaffolding for effective work.

🔹 Building Harnesses: Code Walkthrough

37:42

Nick demonstrates building harnesses that combine all these components into a coherent system. The walkthrough covers how prompts, memory, skills, and tools are injected into the model's context, and how to think about the harness as an engineering system, not just a prompt.

The critical mental model shift: stop thinking "I'm writing a prompt" and start thinking "I'm building an agent system." The prompt is just one input among many. The tools, memory, and skills are equally important inputs that shape the agent's behavior.

💡 Takeaway: 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.
3
Parallelization

Long-running sequential tasks waste enormous time. Instead of one parent agent doing tasks 1→2→3→4 sequentially, you can stack tasks 2, 3, 4 in parallel, then add a synthesizer step to combine results.

🔹 Why Parallelize?

🔹 Agents Are Stochastic

A fundamental truth: agents don't produce the same output every time. The same prompt with the same context can yield different approaches, different code, different solutions. Most people see this as a weakness. Nick reframes it as a feature.

🔹 The Stochastic Consensus Pattern

45:09

This is the star pattern of the parallelization section:

  1. Fan out: Run N agents on the same problem with different approaches
  2. Collect: Gather all N outputs
  3. Synthesize: Have a synthesizer agent combine the best elements from all N outputs 54:22
💎 Key Insight: Stochastic consensus produces higher-quality results than any single run. It's like having three developers independently solve a problem, then having a tech lead pick the best parts from each solution.

🔹 Sub-Agent Coordination

1:00:59

Nick walks through how to coordinate sub-agents in practice — how the parent agent delegates, how sub-agents communicate results back, and how the synthesis step works mechanically within Claude Code.

🔹 Stochastic Consensus Skill Demo

1:03:18

A hands-on demo showing the stochastic consensus pattern running in real time. Multiple agents tackle the same task, their outputs are collected, and a final synthesis produces a result superior to any individual agent's work.

⚠️ Note: Parallelization increases API costs proportionally. Running 3 agents in parallel costs 3× as much as a single run. Balance quality gains against budget constraints.
4
Agent Teams

Agent teams go beyond simple sub-agents. Instead of one agent orchestrating sequential sub-tasks, you define a TEAM of specialized agents that collaborate on a complex goal.

🔹 Teams vs. Simple Sub-Agents

Simple sub-agent delegation: Parent assigns task → sub-agent completes → returns result. This is one-directional and sequential.

Agent teams: Multiple specialized agents work simultaneously on different aspects of a task, with coordination and a consensus/synthesis step that combines their work.

💎 Key Insight: "Agent teams are a lot better" than simple sub-agent delegation for complex, multi-faceted tasks. The difference is analogous to assigning one person three tasks sequentially vs. having three specialists work on their domain simultaneously.

🔹 Agent Teams + Skills Combination

1:11:09

Nick shows how to combine skills with agent teams: read a skill definition, then use the agent teams feature to spawn specialized workers based on the skill's requirements. This is where the power multiplies — skills provide the SOPs, teams provide the execution model.

🔹 Spawning Specialized Sub-Agents

1:14:56

Each team member can be a specialist — one agent handles database work, another handles frontend, another handles testing. They run in parallel, each with their own context window and tool access, then a coordinator synthesizes their outputs into a coherent result.

💡 When to use teams: Complex tasks with clearly separable concerns. Don't over-engineer simple tasks with teams — the coordination overhead isn't worth it for straightforward work.
5
Skills and Sub-Agents

Skills are markdown files with structured definitions that encode reusable workflows. They're one of the most powerful patterns in advanced Claude Code usage — essentially, you're teaching Claude repeatable procedures.

🔹 Skill Anatomy

A SKILL.md file contains:

🔹 Skills in Practice

Nick demonstrates two key skills:

🔹 Skill Organization

🔹 Sub-Agents Explained

Sub-agents are just Claude Code instances spawned by a parent agent to do focused tasks. They run in their own context window and return summaries. This is important because it means they don't pollute the parent's context — they do their work, compress it into a summary, and hand it back.

💎 Key Pattern: Skills define WHAT to do (the procedure). Sub-agents define HOW to execute (in isolation). Agent teams define WHO works together (coordination). These three concepts compose together for powerful workflows.
6
Context Management

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

🔹 The Context Toolkit

💎 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 feed information to the model at the right time in the right format.

🔹 The Real Challenge

Context management is ultimately about information retrieval at the right time. The model has a limited context window. You can't dump everything in. So the challenge is: what information does Claude need RIGHT NOW for THIS TASK, and how do you ensure it gets exactly that?

Solutions stack:

  1. CLAUDE.md — always loaded, so keep it high-signal
  2. Skills — loaded on demand when a matching task appears
  3. MCP servers — queried dynamically as needed
  4. Sub-agents — explore and summarize, compressing information
  5. Memory — persists across sessions for continuity
💡 Mental Model: Think of context management like a librarian system. CLAUDE.md is the reference desk (always accessible). Skills are the card catalog (find the right procedure). MCP is the interlibrary loan (get external information). Sub-agents are research assistants (go find specific things).
7
Karpathy's Auto-Research Approach

Inspired by Andrej Karpathy's approach: use agents to progressively improve things over time through automated research loops. This is one of the most powerful patterns in the entire course.

🔹 The Auto-Research Loop

1:33:04
  1. Define a metric to improve (e.g., 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 the metric reaches the target or diminishing returns
💎 Key Insight: This is recursive self-improvement applied to practical tasks. The agent doesn't just try once — it iterates, measures, and adapts. Works best when the feedback loop is short (ideally ~30 seconds per iteration) and the metric is objectively measurable.

🔹 Live Demo: Website Performance Optimization

Nick applies auto-research to website performance optimization on his own site (leftclick.ai), demonstrating real-time improvement cycles. The agent:

🔹 When Auto-Research Works Best

⚠️ When it doesn't work well: Subjective metrics (design quality), long feedback loops (deployment-dependent metrics), or irreversible changes. Always ensure you can roll back.
8
Browser Automation

Nick compares three major approaches to browser automation, each with different strengths and ideal use cases.

🔹 Approach 1: Computer Use (Anthropic)

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

1:58:11

🔹 Approach 2: Browser Use

DOM-based — interacts with actual HTML elements. Understands the page structure.

🔹 Approach 3: Playwright/Puppeteer via MCP

Programmatic browser control — write code that controls the browser.

🔹 Decision Guide

Use Case Best Approach
Desktop apps, native UIs Computer Use
Web forms, data extraction Browser Use
Automated pipelines, CI/CD Playwright/MCP

Nick demonstrates booking a real appointment through browser automation to show practical capabilities — the agent navigates a booking interface, selects options, fills forms, and completes the process autonomously.

9
Performance Fluctuations

Nick honestly acknowledges that Claude Code performance varies — sometimes dramatically. This isn't unique to Claude; it's inherent to LLM-based agents. The key is having strategies to handle it.

🔹 Strategies for Dealing with Variance

Model Switching

Different models excel at different tasks. Use the right model for the right job — some are better at reasoning, others at code generation, others at following complex instructions.

Retry Patterns

If a task fails, retry with different framing. Sometimes rephrasing the task or breaking it into smaller steps produces dramatically better results. Don't just retry the same prompt — vary your approach.

Multi-Agent Orchestration

2:18:05

Use multiple providers/models simultaneously. If Claude is having a bad day on a specific task, route to GPT-4 or Gemini. This requires more infrastructure but provides resilience.

Stochastic Consensus (Again)

Leverage variation as a feature, not a bug. Run multiple attempts, synthesize the best elements. Performance variance becomes quality improvement when you have a synthesis step.

🔹 Alternatives to Claude Code

Nick discusses alternatives honestly:

💎 Nick's View: Claude Code is the most capable but not always the most reliable. Capability ceiling is highest, but the floor can sometimes be lower than expected. Build your workflow to handle both peaks and valleys.
10
Workspace Organization

Nick reveals his personal workspace structure — how he organizes projects, skills, and context for his $4M/year business running on Claude Code daily.

🔹 Nick's Workspace Structure

🔹 Information Hierarchy

2:25:14
  1. Global CLAUDE.md (~/.claude/CLAUDE.md) — universal rules that apply everywhere
  2. Business CLAUDE.md — business-wide conventions and standards
  3. Project CLAUDE.md — project-specific context and requirements
  4. Skills — reusable workflows and procedures
  5. Memory — persistent learned context from past sessions

🔹 Client vs. Business Skills

2:26:47

For client work (selling AI development as a service): separate client workspaces with their own skills and context, while still being able to reference shared business skills. This prevents cross-contamination between clients while maintaining shared best practices.

💡 Key Principle: Keep the root clean. Don't pollute global context with project-specific details. Global = universal truths. Project = local conventions. Skills = reusable procedures. This layering prevents information overload.

🔹 Auto-Research Integration

2:32:40

Nick shows how auto-research patterns integrate into workspace organization — having dedicated research outputs that feed back into project context, creating a continuous improvement loop for the workspace itself.

11
Security

Nick addresses the security elephant in the room. Two camps exist: accelerationists ("Claude Code for everything") vs. security-paranoid ("AI will steal everything"). Nick advocates for 80/20 security — get the biggest wins with the least effort.

🔹 The 80/20 Security Approach

2:40:52

Low-Hanging Fruit

⚠️ Real Finding: Nick's security audit actually found that many production apps don't have RLS enabled. This means any authenticated user can potentially access any other user's data. This is a critical vulnerability that takes minutes to fix.

🔹 Auto-Research for Security Audits

2:52:58

Apply the Karpathy auto-research pattern to security:

  1. Agent reads security blogs, best practices, OWASP guidelines
  2. Agent audits your codebase against those standards
  3. Produces an architecture summary and vulnerability report
  4. Prioritizes findings by severity and ease of fix

🔹 Full Security Audit Demo

2:56:08

Nick demonstrates running a full security audit on his auto-research repo, finding real issues. The agent examines authentication flows, database access patterns, API endpoints, and configuration files, producing an actionable report.

💡 Actionable: Run a security audit on your own projects using this pattern. You'll likely find at least one critical issue you didn't know about. The 30 minutes it takes could save you from a data breach.
12
The Future of Claude Code and AI Development

Nick closes the course with his predictions for where AI-assisted development is heading — and what it means for developers who learn these tools now.

🔹 Short-Term Predictions (Months)

🔹 Medium-Term Predictions (1–2 Years)

3:01:31

🔹 Long-Term Vision

🔹 Auto-Research as Future Template

3:03:20

Karpathy's auto-research pattern is a template for the future of all AI development: agents that progressively improve themselves and their outputs through automated feedback loops. This will extend beyond code to design, content, business strategy, and beyond.

🔹 Agent Memory and Learning

3:12:55

Agents will get better at remembering and learning across sessions — not just persisting notes, but genuinely accumulating expertise over time. Your Claude Code instance will eventually "know" your codebase as deeply as a senior team member.

💎 Closing Message: "The future is already here, it's just not evenly distributed." Even without money, you have access to incredible technology. The key is discipline in learning how to use it effectively. The people who understand how to build agent harnesses, run auto-research loops, and coordinate agent teams will have enormous leverage.
3:16:05"The future is already here" 3:17:31 — Closing remarks on security, productivity divide, and the road ahead

🎯 Key Takeaways

1
CLAUDE.md serves THREE roles: system prompt wrapper, project map, and skill router. Understanding all three unlocks its full potential.
2
Keep CLAUDE.md lean — highest-ROI bullet points only. Add "lab notes" for failed approaches to prevent repeated mistakes.
3
Agent harness = everything around the model — prompts, tools, memory, skills, MCP servers, hooks, and security configs. The harness matters as much as the model.
4
Parallelization turns stochastic weakness into strength — run N agents, synthesize the best elements via consensus for higher-quality results than any single run.
5
Agent teams > simple sub-agents for complex, multi-faceted tasks. Skills define WHAT, sub-agents define HOW, teams define WHO.
6
Skills are structured markdown SOPs — organize by project vs. client vs. global scope for maximum reusability.
7
Karpathy's auto-research: define a metric → research → implement → measure → loop. Best with short feedback loops and measurable outcomes.
8
Browser automation trifecta: Computer Use for desktop, Browser Use for web DOM, Playwright/MCP for automated pipelines.
9
Performance varies — use multi-model strategies, retry with different framing, and leverage stochastic consensus to handle variance.
10
80/20 security: .env files for secrets, RLS on databases, auto-research security audits. Minutes of setup prevent hours of disaster.
11
Workspace hierarchy: global → business → project → skills → memory. Keep each layer focused on its scope.
12
The future is AI as development partner, not just tool. The productivity divide is real — those who master agent workflows will have enormous leverage.

⏱️ Complete Timestamp Index

0:00Introduction and course overview
0:30Course syllabus: 11 modules
1:39Setup: Antigravity + Claude Code extension
2:42Module 1: CLAUDE.md and system prompts
4:03CLAUDE.md as project map
5:01CLAUDE.md as skill router
8:39Layered CLAUDE.md hierarchy
12:12Using MCP servers for dynamic context
13:15Sub-agents for exploration
17:00Lab Notes pattern: what NOT to do
19:14Workspace-level CLAUDE.md tips
22:33Profile sections and user context
26:03Lab notes and failure documentation
28:20User workspace organization
34:38Module 2: Agent harnesses
37:42Building harnesses: code walkthrough
42:39Module 3: Parallelization
45:09Stochastic consensus pattern
54:22Synthesis step
1:00:59Sub-agent coordination
1:03:18Stochastic consensus skill demo
1:06:55Model-chat skill
1:09:36Module 4: Skills deep dive
1:10:06Agent teams
1:11:09Agent teams + skills combination
1:14:56Spawning specialized sub-agents
1:17:28Module 5: Context management
1:24:19Organizational hierarchy of agents
1:30:13Module 6: Karpathy's auto-research
1:33:04Auto-research loop in practice
1:44:07Module 7: Browser automation
1:58:11Computer Use demo
2:00:55Module 8: Performance fluctuations
2:18:05Multi-model strategies
2:24:18Module 9: Workspace organization
2:25:14Skills storage hierarchy
2:26:47Client vs business skills
2:32:40Auto-research integration
2:39:14Module 10: Security
2:40:5280/20 security approach
2:44:52Row Level Security
2:52:58Security audit via auto-research
2:56:08Full security audit demo
3:00:23Module 11: Future of Claude Code
3:01:31Medium-term predictions
3:03:20Auto-research as future template
3:12:55Agent memory and learning
3:16:05"The future is already here"
3:17:31Closing: security, productivity divide