Claude Code Mastery: The Complete Agent Engineering Guide

A comprehensive one-hour course from Anthropic covering how Claude Code works under the hood, including state management, permissions, skills, dynamic workflows, and intent-driven development practices. Features live demos of building a 3D slingshot game and rebuilding it with multi-agent workflows, plus expert tips from YK Sugi (CS Dojo) and Lydia Haley (Anthropic) on maximizing autonomous code generation while maintaining control and code quality.

How Claude Code Works: The Architecture

Models are Stateless

Claude Code models have no in-session memory or memory between calls. Every invocation starts from zero, so the harness must provide all state including files, conversation history, and environment setup.

The Assembled Prompt Structure

When you press enter, Claude Code assembles a complete request containing tool schemas (defining available actions like bash, edit, read, web fetch), system prompt (hardcoded by Anthropic), environment context (OS, shell, git branch), and the messages array with conversation history and CloudMD file contents.

The Tool Call Loop

The model receives the assembled prompt, identifies needed actions via tool schemas, emits a tool call (e.g., read file), the harness executes it, and the result is added back to the messages array. This loop repeats until the task completes.

Permissions and Control

Permission Modes: Allow, Ask, Deny

Claude Code offers three permission levels: allow (runs without prompt), ask (prompts user each time), and deny (blocks execution). You can set defaults and create specific rules per tool, e.g., allow 'npm run' but deny 'git push' to protect remotes.

Auto Mode: Intelligent Permission Handling

Auto mode uses a classifier to determine if a tool call is dangerous. Safe operations (read, edit) run automatically; dangerous ones (delete, push) trigger prompts. This avoids permission fatigue while preventing accidental damage and is better against prompt injection.

Permission Hierarchy: Enterprise to Project

Permissions follow a hierarchy where enterprise settings override team settings, which override user settings, which override project settings. The highest level always takes precedence, ensuring team and company policies cannot be bypassed by individual developers.

Fewer Permission Prompts Command

This command analyzes your transcript history to find tool calls you repeatedly allow, then automatically adds them to your settings.json. It is conservative, skipping redundant or potentially unsafe rules to maintain security.

Skills: Reusable Workflows

What Skills Are

Skills are markdown files containing specific procedures you want to repeat without retyping the same prompt. They can be deployment, integrations, Q&A loops, or any multi-step workflow specific to your project.

Skill Configuration Options

Skills support configuration including model selection (e.g., always use Sonnet for code review), disable_model_invocation (slash command only), user_invocable (model only), and arguments for parameterization (e.g., deploy staging or deploy production).

Skill Creator Command

The built-in skill_creator command makes it easy to generate custom skills. Instead of manually writing markdown, you describe what you want (e.g., 'code reviewer skill') and Claude Code creates the skill structure for you.

Intent-Driven Development

Intent-Driven Development Philosophy

Rather than specifying how to build something, you express what you want to build. This means clearly articulating your intent, using voice mode for faster expression, and allowing Claude to determine the implementation approach.

Voice Mode for Better Expression

Using voice-to-text instead of typing allows you to express intent faster and more naturally. You may make mistakes or say 'um', but as long as your intent is clear, Claude understands. This reduces the friction between idea and implementation.

Start Broad, Then Dig Deeper

Begin with broader architectural questions (what libraries, frameworks, architecture?) before diving into implementation details. This allows Claude to make informed decisions early and refine them iteratively as you provide more context.

Verification is Part of Intent

Intent-driven development includes verification: using plan mode, adding images for visual verification, and ensuring you understand what Claude is building. This is not just about the prompt structure but about the entire workflow.

Live Demo: Building a 3D Slingshot Game

YK's Slingshot Game Demo

YK demonstrated intent-driven development by describing a 3D slingshot game where drag distance controls X/Y direction and hold duration controls Z direction. He used voice mode, asked Claude for physics library options (chose Rapier over Canon), and iteratively added features like trajectory visualization and shattering targets.

Key Tips from the Demo

YK shared five practical tips: (1) Use aliases to avoid typing 'claude' repeatedly, (2) Organize projects in one folder for agent context, (3) Ask broader questions first before implementation, (4) Learn Git and CLI well, (5) Verify outputs by testing behavior, checking code, and writing tests.

Draft PR Workflow

YK demonstrated creating a draft PR instead of pushing directly to main. This simulates code review and allows checking before marking ready for review, making it clear the PR was agent-generated and not yet approved.

Dynamic Workflows and Sub-Agents

What Dynamic Workflows Are

Dynamic workflows are Claude Code's deterministic solution to multi-agent task orchestration. Instead of asking Claude to use sub-agents (which is nondeterministic), you request a dynamic workflow and Claude Code generates a JavaScript file defining phases and parallel sub-agents.

Sub-Agents vs. Workflows

Sub-agents spawn automatically but nondeterministically (sometimes 4, sometimes 10). Workflows are deterministic, can spawn hundreds of sub-agents for long-running tasks, run phases sequentially but agents in parallel, and generate a reusable JavaScript file.

Lydia's Slingshot V2 Demo with Workflows

Lydia used Claude Design to create a visual wireframe of an improved slingshot game with levels, menus, health bars, and haptics. She then used a dynamic workflow with the command 'read this design file and use a dynamic workflow to rebuild the game'. Claude created four parallel build agents (engine, UI, audio, levels/haptics) plus integration, review, and verify phases.

Saving and Reusing Workflows

After running a dynamic workflow, you can save it as a slash command by pressing 'S' and naming it. Claude Code generates a JavaScript file you can edit (e.g., change model from Fable to Sonnet for specific sub-agents) and rerun deterministically.

Lydia's Anthropic Perspective

Claude Design for Visual Planning

Claude Design is a research preview tool for creating presentations, slides, and websites via prompts. Lydia used it to create an HTML wireframe of the slingshot game improvements, allowing visual planning before implementation.

Setup Vertex Wizard

The setup_vertex command automates Google Cloud integration for Claude Code. It handles credentials, project selection, model availability checks, and configuration, eliminating manual setup steps.

The Role of Software Engineers is Changing

Lydia argues that as agents write more code, the software engineer role shifts toward product manager: owning architecture, understanding why features are needed, and maintaining technical expertise in design and verification rather than syntax.

Code Review Shift: 90% to 10%

With hand-written code, 90% of review happens during writing and 10% after. With Claude Code, it flips: 90% review happens after generation and 10% is hand-coding. This requires a mindset shift toward thorough verification.

Lydia's Personal Workflow

Lydia focuses on setting up routines and scheduled Claude Code sessions. She uses Claude's ecosystem (Code, Codebase, Chat) to clarify problems, automates non-enjoyable tasks, but preserves creative work like keynote slide design. She also uses Claude Bot on GitHub for auto-fixing PRs.

Beyond Coding: Claude Code as Universal Interface

Claude Code for Non-Coding Tasks

Claude Code is used for video editing, data analysis, storage cleanup, research, writing, and more. YK saved $10,000 by using Claude Code to compile a list of realtors with email addresses formatted for outreach.

The Terminal as Everything

Computers started with terminals, moved to GUIs, and are now returning to the terminal as the primary interface. Claude Code enables this by handling tasks from research (fetching Reddit threads) to media conversion (MP4 encoding) via CLI.

Claude Codebase vs. Claude Code

Anthropic built Claude Codebase for non-technical tasks like email, calendar, and file management. It uses the same Claude Code runtime but with better connectors and system prompts. Claude Code remains the choice for technical work.

The Bottleneck is Imagination

With Claude Code handling video editing, image manipulation, and file operations via CLI, the limiting factor is no longer software capability but user creativity in what to ask for.

Code Quality and Craft

Simplify Over Complicated Code

Code generation models have a bias toward writing more code than necessary. YK's tip 38 emphasizes not committing all generated code—only merge what is valuable. You are responsible for deciding what enters production.

You Are Responsible for the Output

Claude Code is a tool; the developer is accountable. If you generate 100,000 lines, you don't have to commit 100,000 lines. Use draft PRs, manual review, and automated tests to ensure quality before merging.

Verification Layers: Manual and Automated

Verify outputs by testing behavior, reviewing code manually, and writing tests and GitHub Actions. This is more important with Claude Code than hand-written code because the review burden has shifted from during-writing to post-generation.

Senior Developers Become More Valuable

AI makes senior developers more valuable, not less, because they can better architect systems, verify outputs, and make decisions about what code to keep. Technical depth and good taste remain essential.

Practical Tips and Mindset

Clottify Your Life Strategically

Automate tasks you don't enjoy so you can focus on what you like. But don't over-optimize: Lydia enjoys creating keynote slides and chooses not to automate that. The goal is balance, not total automation.

Ask Questions When You Have Less Context

If you're unfamiliar with options (e.g., physics libraries), ask Claude for recommendations. As you gain familiarity, you can be more directive. This mirrors how you'd work with a colleague.

Be Braver in the Unknown

YK encourages developers to use Claude Code confidently even when uncertain. The tool is designed to handle exploration; you can always review and refine outputs.

Reading Documentation Remains Important

Despite AI assistance, reading documentation is valuable for curiosity and understanding. It's not dead; it's complementary to using Claude Code.

Learning New Languages Still Matters

Learning new programming languages is not a waste of time. Focus on software architecture over specific language features, but language knowledge remains valuable.

Setting Up Claude Code on Google Cloud

Installation Steps

Install Claude Code on your machine, then install G-Cloud SDK. Set your project ID from Google Cloud Console, enable Vertex AI APIs, configure environment variables for Vertex AI integration, and start Claude to run on Google's infrastructure.

Enterprise Deployment

Claude Code can run on Google Cloud Agent Platform, enabling transition from experimentation to enterprise rollout across teams. This provides the infrastructure for scaling agent-driven development.

Notable quotes

The model is stateless. It has no in-session memory, no memory between calls. — Instructor
You're responsible for the output. Don't produce bad code and push it. — YK Sugi
The bottleneck now is just your imagination. Claude Code can do pretty much anything on your computer. — Lydia Haley

Action items

  • Install Claude Code and G-Cloud SDK; set up Vertex AI integration following the provided commands to run Claude Code on Google Cloud.
  • Create a CloudMD file in your project to define coding conventions, security rules, and project context for Claude Code.
  • Set up permission rules in claude_settings.json (allow, ask, deny) tailored to your workflow; use the 'fewer permission prompts' command to auto-generate rules from your history.
  • Build reusable skills as markdown files for repeated workflows (deployment, testing, code review); use the skill_creator command to generate them.
  • Practice intent-driven development: use voice mode to express what you want to build, start with broad architectural questions, then iterate on details.
  • Implement a draft PR workflow: ask Claude to create draft PRs, review manually or with AI, then merge only high-quality code.
  • Learn and use Git and CLI commands well; organize projects in a single folder so Claude Code has better context for cross-project references.
  • Verify all Claude Code outputs by testing behavior, reviewing code, and writing tests before merging to production.
  • Experiment with dynamic workflows for complex multi-step tasks; save and reuse workflows as slash commands for deterministic execution.
  • Use Claude Code beyond coding: research, data analysis, video editing, file management—treat the terminal as your universal interface.
Prof.Dr. Ahmed Ebada
1 hr 1 min video
3 min read
Claude Code Mastery: The Complete Agent Engineering Guide
You just saved 58 min.
The big takeaway
A comprehensive one-hour course from Anthropic covering how Claude Code works under the hood, including state management, permissions, skills, dynamic workflows, and intent-driven development practices. Features live demos of building a 3D slingshot game and rebuilding it with multi-agent workflows, plus expert tips from YK Sugi (CS Dojo) and Lydia Haley (Anthropic) on maximizing autonomous code generation while maintaining control and code quality.
How Claude Code Works: The Architecture
Models are Stateless
Claude Code models have no in-session memory or memory between calls. Every invocation starts from zero, so the harness must provide all state including files, conversation history, and environment setup.
The Assembled Prompt Structure
When you press enter, Claude Code assembles a complete request containing tool schemas (defining available actions like bash, edit, read, web fetch), system prompt (hardcoded by Anthropic), environment context (OS, shell, git branch), and the messages array with conversation history and CloudMD file contents.
1
Tool schemas define available actions (bash, edit, read, web fetch)
2
System prompt sets model behavior and security rules
3
Environment captures OS, shell, model, git branch
4
Messages array includes CloudMD, skills list, and user prompt
5
All assembled into one JSON request to API
Components of Claude Code's assembled prompt sent to the API
The Tool Call Loop
The model receives the assembled prompt, identifies needed actions via tool schemas, emits a tool call (e.g., read file), the harness executes it, and the result is added back to the messages array. This loop repeats until the task completes.
1
Model sees assembled prompt and identifies missing information
2
Model emits tool call (e.g., read file) based on tool schema
3
Harness executes the tool call (e.g., FS read file)
4
File contents returned as tool result
5
Entire prompt reassembled with new messages and tool result
6
Loop continues until task complete
The tool call execution loop in Claude Code
Permissions and Control
Permission Modes: Allow, Ask, Deny
Claude Code offers three permission levels: allow (runs without prompt), ask (prompts user each time), and deny (blocks execution). You can set defaults and create specific rules per tool, e.g., allow 'npm run' but deny 'git push' to protect remotes.
1
Allow
Runs without prompt
2
Ask
Prompts user each time
3
Deny
Blocks execution
Three permission levels for controlling Claude Code execution
Auto Mode: Intelligent Permission Handling
Auto mode uses a classifier to determine if a tool call is dangerous. Safe operations (read, edit) run automatically; dangerous ones (delete, push) trigger prompts. This avoids permission fatigue while preventing accidental damage and is better against prompt injection.
Permission Hierarchy: Enterprise to Project
Permissions follow a hierarchy where enterprise settings override team settings, which override user settings, which override project settings. The highest level always takes precedence, ensuring team and company policies cannot be bypassed by individual developers.
1
Enterprise
Highest precedence
2
Team
Second level
3
User
Third level
4
Project
Lowest precedence
Permission hierarchy from enterprise to project level
Fewer Permission Prompts Command
This command analyzes your transcript history to find tool calls you repeatedly allow, then automatically adds them to your settings.json. It is conservative, skipping redundant or potentially unsafe rules to maintain security.
Skills: Reusable Workflows
What Skills Are
Skills are markdown files containing specific procedures you want to repeat without retyping the same prompt. They can be deployment, integrations, Q&A loops, or any multi-step workflow specific to your project.
Skill Configuration Options
Skills support configuration including model selection (e.g., always use Sonnet for code review), disable_model_invocation (slash command only), user_invocable (model only), and arguments for parameterization (e.g., deploy staging or deploy production).
1
Model selection
Choose specific model per skill
2
disable_model_invocation
Slash command only
3
user_invocable false
Model only
4
Arguments
Parameterize execution
Configuration options available for Claude Code skills
Skill Creator Command
The built-in skill_creator command makes it easy to generate custom skills. Instead of manually writing markdown, you describe what you want (e.g., 'code reviewer skill') and Claude Code creates the skill structure for you.
Intent-Driven Development
Intent-Driven Development Philosophy
Rather than specifying how to build something, you express what you want to build. This means clearly articulating your intent, using voice mode for faster expression, and allowing Claude to determine the implementation approach.
Voice Mode for Better Expression
Using voice-to-text instead of typing allows you to express intent faster and more naturally. You may make mistakes or say 'um', but as long as your intent is clear, Claude understands. This reduces the friction between idea and implementation.
Start Broad, Then Dig Deeper
Begin with broader architectural questions (what libraries, frameworks, architecture?) before diving into implementation details. This allows Claude to make informed decisions early and refine them iteratively as you provide more context.
Verification is Part of Intent
Intent-driven development includes verification: using plan mode, adding images for visual verification, and ensuring you understand what Claude is building. This is not just about the prompt structure but about the entire workflow.
Live Demo: Building a 3D Slingshot Game
YK's Slingshot Game Demo
YK demonstrated intent-driven development by describing a 3D slingshot game where drag distance controls X/Y direction and hold duration controls Z direction. He used voice mode, asked Claude for physics library options (chose Rapier over Canon), and iteratively added features like trajectory visualization and shattering targets.
Key Tips from the Demo
YK shared five practical tips: (1) Use aliases to avoid typing 'claude' repeatedly, (2) Organize projects in one folder for agent context, (3) Ask broader questions first before implementation, (4) Learn Git and CLI well, (5) Verify outputs by testing behavior, checking code, and writing tests.
1
Use aliases
Faster command entry
2
Organize projects in one folder
Better agent context
3
Ask broad questions first
Better architecture
4
Learn Git and CLI
More powerful workflows
5
Verify outputs
Test behavior and code
Five key tips from YK's slingshot game demo
Draft PR Workflow
YK demonstrated creating a draft PR instead of pushing directly to main. This simulates code review and allows checking before marking ready for review, making it clear the PR was agent-generated and not yet approved.
Dynamic Workflows and Sub-Agents
What Dynamic Workflows Are
Dynamic workflows are Claude Code's deterministic solution to multi-agent task orchestration. Instead of asking Claude to use sub-agents (which is nondeterministic), you request a dynamic workflow and Claude Code generates a JavaScript file defining phases and parallel sub-agents.
Sub-Agents vs. Workflows
Sub-agents spawn automatically but nondeterministically (sometimes 4, sometimes 10). Workflows are deterministic, can spawn hundreds of sub-agents for long-running tasks, run phases sequentially but agents in parallel, and generate a reusable JavaScript file.
Sub-agents (automatic)
Nondeterministic, unpredictable count
Dynamic workflows
Deterministic, parallel phases, reusable
Comparison of sub-agents versus dynamic workflows
Lydia's Slingshot V2 Demo with Workflows
Lydia used Claude Design to create a visual wireframe of an improved slingshot game with levels, menus, health bars, and haptics. She then used a dynamic workflow with the command 'read this design file and use a dynamic workflow to rebuild the game'. Claude created four parallel build agents (engine, UI, audio, levels/haptics) plus integration, review, and verify phases.
1
Build phase: 4 parallel agents (engine, UI, audio, levels/haptics)
2
Integration phase: Combine outputs
3
Review phase: Quality check
4
Verify phase: Test functionality
Phases in Lydia's dynamic workflow for slingshot game rebuild
Saving and Reusing Workflows
After running a dynamic workflow, you can save it as a slash command by pressing 'S' and naming it. Claude Code generates a JavaScript file you can edit (e.g., change model from Fable to Sonnet for specific sub-agents) and rerun deterministically.
Lydia's Anthropic Perspective
Claude Design for Visual Planning
Claude Design is a research preview tool for creating presentations, slides, and websites via prompts. Lydia used it to create an HTML wireframe of the slingshot game improvements, allowing visual planning before implementation.
Setup Vertex Wizard
The setup_vertex command automates Google Cloud integration for Claude Code. It handles credentials, project selection, model availability checks, and configuration, eliminating manual setup steps.
The Role of Software Engineers is Changing
Lydia argues that as agents write more code, the software engineer role shifts toward product manager: owning architecture, understanding why features are needed, and maintaining technical expertise in design and verification rather than syntax.
Code Review Shift: 90% to 10%
With hand-written code, 90% of review happens during writing and 10% after. With Claude Code, it flips: 90% review happens after generation and 10% is hand-coding. This requires a mindset shift toward thorough verification.
Hand-written code
90% review during writing, 10% after
Claude Code generated
10% review during, 90% after generation
Shift in code review distribution with Claude Code
Lydia's Personal Workflow
Lydia focuses on setting up routines and scheduled Claude Code sessions. She uses Claude's ecosystem (Code, Codebase, Chat) to clarify problems, automates non-enjoyable tasks, but preserves creative work like keynote slide design. She also uses Claude Bot on GitHub for auto-fixing PRs.
Beyond Coding: Claude Code as Universal Interface
Claude Code for Non-Coding Tasks
Claude Code is used for video editing, data analysis, storage cleanup, research, writing, and more. YK saved $10,000 by using Claude Code to compile a list of realtors with email addresses formatted for outreach.
The Terminal as Everything
Computers started with terminals, moved to GUIs, and are now returning to the terminal as the primary interface. Claude Code enables this by handling tasks from research (fetching Reddit threads) to media conversion (MP4 encoding) via CLI.
Claude Codebase vs. Claude Code
Anthropic built Claude Codebase for non-technical tasks like email, calendar, and file management. It uses the same Claude Code runtime but with better connectors and system prompts. Claude Code remains the choice for technical work.
Claude Code
1 Technical tasks
Claude Codebase
1 Non-technical tasks
Division of labor between Claude Code and Claude Codebase
The Bottleneck is Imagination
With Claude Code handling video editing, image manipulation, and file operations via CLI, the limiting factor is no longer software capability but user creativity in what to ask for.
Code Quality and Craft
Simplify Over Complicated Code
Code generation models have a bias toward writing more code than necessary. YK's tip 38 emphasizes not committing all generated code—only merge what is valuable. You are responsible for deciding what enters production.
You Are Responsible for the Output
Claude Code is a tool; the developer is accountable. If you generate 100,000 lines, you don't have to commit 100,000 lines. Use draft PRs, manual review, and automated tests to ensure quality before merging.
Verification Layers: Manual and Automated
Verify outputs by testing behavior, reviewing code manually, and writing tests and GitHub Actions. This is more important with Claude Code than hand-written code because the review burden has shifted from during-writing to post-generation.
Senior Developers Become More Valuable
AI makes senior developers more valuable, not less, because they can better architect systems, verify outputs, and make decisions about what code to keep. Technical depth and good taste remain essential.
Practical Tips and Mindset
Clottify Your Life Strategically
Automate tasks you don't enjoy so you can focus on what you like. But don't over-optimize: Lydia enjoys creating keynote slides and chooses not to automate that. The goal is balance, not total automation.
Ask Questions When You Have Less Context
If you're unfamiliar with options (e.g., physics libraries), ask Claude for recommendations. As you gain familiarity, you can be more directive. This mirrors how you'd work with a colleague.
Be Braver in the Unknown
YK encourages developers to use Claude Code confidently even when uncertain. The tool is designed to handle exploration; you can always review and refine outputs.
Reading Documentation Remains Important
Despite AI assistance, reading documentation is valuable for curiosity and understanding. It's not dead; it's complementary to using Claude Code.
Learning New Languages Still Matters
Learning new programming languages is not a waste of time. Focus on software architecture over specific language features, but language knowledge remains valuable.
Setting Up Claude Code on Google Cloud
Installation Steps
Install Claude Code on your machine, then install G-Cloud SDK. Set your project ID from Google Cloud Console, enable Vertex AI APIs, configure environment variables for Vertex AI integration, and start Claude to run on Google's infrastructure.
1
Install Claude Code locally
2
Install G-Cloud SDK
3
Set project ID from Google Cloud Console
4
Enable Vertex AI APIs
5
Configure environment variables
6
Start Claude on Vertex AI
Steps to set up Claude Code on Google Cloud Vertex AI
Enterprise Deployment
Claude Code can run on Google Cloud Agent Platform, enabling transition from experimentation to enterprise rollout across teams. This provides the infrastructure for scaling agent-driven development.
Worth quoting
"The model is stateless. It has no in-session memory, no memory between calls."
— Instructor, at [0:00]
"You're responsible for the output. Don't produce bad code and push it."
— YK Sugi, at [53:47]
"The bottleneck now is just your imagination. Claude Code can do pretty much anything on your computer."
— Lydia Haley, at [58:53]
Try this
Install Claude Code and G-Cloud SDK; set up Vertex AI integration following the provided commands to run Claude Code on Google Cloud.
Create a CloudMD file in your project to define coding conventions, security rules, and project context for Claude Code.
Set up permission rules in claude_settings.json (allow, ask, deny) tailored to your workflow; use the 'fewer permission prompts' command to auto-generate rules from your history.
Build reusable skills as markdown files for repeated workflows (deployment, testing, code review); use the skill_creator command to generate them.
Practice intent-driven development: use voice mode to express what you want to build, start with broad architectural questions, then iterate on details.
Implement a draft PR workflow: ask Claude to create draft PRs, review manually or with AI, then merge only high-quality code.
Learn and use Git and CLI commands well; organize projects in a single folder so Claude Code has better context for cross-project references.
Verify all Claude Code outputs by testing behavior, reviewing code, and writing tests before merging to production.
Experiment with dynamic workflows for complex multi-step tasks; save and reuse workflows as slash commands for deterministic execution.
Use Claude Code beyond coding: research, data analysis, video editing, file management—treat the terminal as your universal interface.
Made with Glimpse by Wozart
glimpse.wozart.com/v/dautbz1p
Share this infographic

More like this