Skip to content

Latest commit

 

History

History
1888 lines (1329 loc) · 50.9 KB

File metadata and controls

1888 lines (1329 loc) · 50.9 KB
theme seriph
background https://images.unsplash.com/photo-1555066931-4365d14bab8c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80
addons
slidev-component-progress
slidev-addon-qrcode
class text-center
highlighter shiki
lineNumbers false
info ## Claude Code Training By Kenneth Kousen Learn more at [KouseniT](https://kousenit.com)
drawings
persist
transition slide-left
title Claude Code Training
mdc true
slidev
slide-number controls progress
true
true
true
css unocss
<style> .slidev-page-num { display: block !important; opacity: 1 !important; visibility: visible !important; position: fixed !important; bottom: 1rem !important; right: 1rem !important; z-index: 100 !important; color: #666 !important; font-size: 0.875rem !important; } </style>

Claude Code Training

Press Space for next page

Contact Info

Ken Kousen
Kousen IT, Inc.


Course Overview

  • Duration: 5 hours of hands-on learning
  • Format: Instructor-led with multiple labs
  • Hands-on Labs: Real codebases in Python, JavaScript, Java
  • Prerequisites: Command-line experience, development background

Topics Covered

  • Foundation: Installation, surfaces, CLI basics, code exploration
  • Core Skills: Testing, documentation, git operations
  • Customization: CLAUDE.md, skills, hooks, output styles
  • Extensibility: Plugins, MCP integration
  • Advanced: Effort Levels, Plan Mode, Code Review, Subagents, Agent Teams, Dynamic Workflows, SDKs

What is Claude Code?

  • AI development tool across 5 primary surfaces (CLI, VS Code, JetBrains, Desktop, Web) plus integrations (Slack, Chrome, iOS, GitHub Actions, GitLab CI/CD)
  • Context-aware codebase understanding
  • Autonomous, collaborative, and multi-agent modes
  • Multi-language support with LSP code intelligence
  • Integrated git operations
  • Extensible: Skills, Plugins, MCP, Hooks

Five Surfaces

  • CLI (Terminal) — Full-featured, primary interface
  • VS Code Extension — Inline diffs, @-mentions, plan review
  • JetBrains Plugin — IntelliJ, PyCharm, WebStorm
  • Desktop App — Native Mac/Windows with visual diffs, scheduling, connectors
  • Web (claude.ai/code) — Browser-based, no local setup required

Local surfaces share: settings, CLAUDE.md, MCP servers, skills, and hooks. Web sessions only inherit repo-committed config — not user-level ~/.claude settings.


Claude Desktop App

  • Three tabs: Chat (general), Cowork (background agent), Code (interactive coding)
  • Visual diff review with inline comments and "Review code" button
  • Live app preview with embedded browser and auto-verify
  • Scheduled tasks — persistent, local, survives restarts
  • Connectors — GitHub, Slack, Linear, Notion, Google Calendar
  • Computer use (research preview) — Claude controls screen on macOS/Windows
  • Parallel sessions with automatic git worktree isolation

Claude Code on the Web

  • claude.ai/code — Run tasks on Anthropic cloud infrastructure
  • --cloud flag: Start a web session from CLI: claude --cloud "Fix the auth bug"
  • Diff view: Review changes file-by-file before creating PRs
  • Auto-fix PRs: Claude responds to CI failures and review comments automatically
    • Caveat: Replies post under your account — may trigger automation (Atlantis, Actions)
  • /teleport: Pull web sessions back to your local terminal
  • Setup: Connect GitHub, install Claude GitHub App, select environment
  • Also accessible from Claude iOS and Android apps

Integrations & Headless Surfaces

  • Slack — invoke Claude Code in channels and threads
  • Chrome extension — page-aware assistance in the browser
  • iOS app — read sessions, dispatch work, review diffs from your phone
  • GitHub Actionsanthropics/claude-code-action for PR reviews, auto-fix, scripted workflows
  • GitLab CI/CD — official integration for pipelines
  • No clean handoff from Desktop Code tab back to terminal as of writing — plan accordingly

Surface handoff slash commands you'll meet again later:

  • /desktop (alias /app) — terminal → desktop Code tab (macOS / Windows)
  • /teleport (alias /tp) — web → terminal
  • /remote-control (alias /rc) — make terminal session controllable from claude.ai

Dispatch & Remote Control

Dispatch

  • Send tasks from your phone to your Desktop app
  • Dispatch routes dev tasks to Code tab, others to Cowork
  • Push notification when done or needs approval

Remote Control

  • Continue a running CLI session from phone or browser
  • claude --rc to start with Remote Control enabled
  • /remote-control to enable mid-session
  • Session runs locally — web/mobile is just a window into it

Code Review: /code-review

  • /code-review reviews the current diff — or a PR: /code-review <level> <pr#> (/review is an alias)
  • Effort dial: pass a level (lowmax); with none, it reuses the level you typed last
  • At high, xhigh, and max the review runs in a background agent — you keep working
  • /code-review ultra: deep multi-agent review in the cloud (user-triggered, billed)
  • Claude no longer runs /code-review or /verify on its own — invoke them deliberately
# Review what you're about to commit
/code-review

# Deep review of a GitHub PR
/code-review xhigh 1234

When NOT to Use Claude Code

  • One-line edits you already know how to make — typing is faster than prompting
  • Highly regulated codebases without an enterprise plan + audit trail in place
  • Tasks needing real-time human judgment (UX copy decisions, brand voice, legal review)
  • Production incidents under time pressure — pair with a human, don't drive solo
  • Learning a new language/framework — let the friction teach you first
  • When you can't review the diff — if you won't read it, don't ship it

The right question isn't "can Claude do this?" — it's "will I understand what shipped?"


Subscription Tiers

  • Pro — $20/mo · Sonnet (current default model)
  • Max — from $100/mo · 5x and 20x usage tiers · Sonnet or Opus
  • Usage limits are shared across Claude and Claude Code and reset every 5 hours — exact numbers shift; check the support article below
  • Team — shared seats, central billing, admin controls
  • Enterprise — SSO, audit, custom retention, Bedrock / Vertex / Foundry routing
  • Opus draws down usage faster than Sonnet — model choice affects how far a session goes
  • API path: pre-paid credits via Console; auto-creates a "Claude Code" workspace for cost tracking

📖 Full details: Using Claude Code with your Pro or Max plan


Picking a Model

Tier When to reach for it
Opus (top tier) Architecture decisions, multi-file refactors, hard debugging, agent orchestration
Sonnet (default daily driver) Most coding, exploration, doc generation
Haiku (fastest/cheapest) Fast loops, batch operations, hooks, classifiers, cheap tool calls
  • Switch mid-conversation: Alt+P / Option+P, or /model (press s for this session only, d to set the default for new sessions)
  • Set per session at launch: claude --model opus
  • Effort levels (/effort low\|medium\|high\|xhigh\|max) are orthogonal — control depth on whichever model you picked

Run /model to see what's current — the lineup advances often (Opus 5 — 1M context — is the default Opus as of this writing, with the Fable family above it; the current Opus defaults to high effort).

Rule of thumb: Sonnet first. Reach for Opus when you've already failed once on Sonnet, not preemptively.


Enterprise Providers

Three first-class providers for enterprises that need their own infrastructure:

  • AWS BedrockCLAUDE_CODE_USE_BEDROCK=1
  • Google Vertex AICLAUDE_CODE_USE_VERTEX=1
  • Microsoft FoundryCLAUDE_CODE_USE_FOUNDRY=1

⚠️ Gotcha — short model aliases (opus, sonnet) often resolve to a previous-generation model on all three providers, lagging the latest by a version.

Don't rely on the alias if you need the newest model — pin an explicit version ID and check your provider's model catalog for the exact string:

ANTHROPIC_MODEL=claude-opus-5           # explicit version, not the bare "opus" alias
ANTHROPIC_MODEL=claude-sonnet-5         # explicit version, not the bare "sonnet" alias

Auth via the cloud provider's IAM, not an Anthropic API key. LLM gateway pattern: ANTHROPIC_BASE_URL + CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1.

Softer alternative: ANTHROPIC_DEFAULT_MODEL sets where new sessions start, while a /model pick still overrides it and persists — most teams want this, not the hard ANTHROPIC_MODEL pin.


Installation

  • Recommended (macOS / Linux / WSL): native installer, auto-updates
    curl -fsSL https://claude.ai/install.sh | bash
  • Homebrew (macOS): brew install --cask claude-code (manual upgrade)
  • WinGet (Windows): winget install Anthropic.ClaudeCode (manual upgrade)
  • Linux packages: apt, dnf, apk for Debian / Fedora / RHEL / Alpine
  • Advanced (legacy): npm install -g @anthropic-ai/claude-code
  • Verify: claude --version

The claude binary is itself native — npm is no longer the primary path.


Creating Projects from Scratch

  • Start from nothing: Empty directory + idea = working application
  • Iterative development: Concept → foundation → enhancements
  • Full-stack creation: UI, logic, styling, tests in one session
  • Real example: Our lyrics-trainer exercise started exactly this way
mkdir my-project && cd my-project && git init
claude
"Create a web app that displays song lyrics one line at a time
with Next, Previous, and Play buttons"

Operation Modes

  • Manual Mode (the default) - Interactive conversation; prompts before actions
  • Auto-Accept Mode (Shift+Tab) - Autonomous execution
  • Plan Mode (/plan or cycle with Shift+Tab) - Review plans before execution
  • Auto Mode - Safety classifier eliminates permission prompts (opt-in)
  • Effort levels: /effort low|medium|high|xhigh|max to control reasoning depth
  • Model switch: Alt+P / Option+P, or /model, to change models mid-conversation

Core Productivity Features

Get Productive Immediately

Essential features for daily development work


Code Exploration

  • Find files, functions, patterns
  • Understand system architecture
  • Trace dependencies
  • Identify frameworks
  • Reference specific files with @path/to/file.java
"Analyze the UserService class"
"Explain @src/main/java/com/example/UserController.java"
"How does @pom.xml configure Spring Boot?"

Test Generation

  • Unit test creation
  • Edge case identification
  • Integration tests
  • Mock object setup
"Create unit tests for the UserService"
"Add tests for error scenarios"

Refactoring, Docs, Debugging

Refactoring

"Convert all callbacks in @src/api/ to async/await"
"Replace the manual JSON parsing with Jackson annotations"

Documentation

"Generate JavaDoc for every public method in UserService"
"Write a README.md from the current package.json scripts and folder layout"

Debugging

"Here's the stack trace — trace it back to the root cause and propose a fix"
"@logs/2026-05-08.log shows three different errors. Group them by likely cause."

Pattern: name the file or symbol, state the outcome, and let Claude pick the steps.


Git Integration

  • Commit message generation
  • Branch management
  • Merge conflict resolution
  • Pull request creation
"Commit these changes with an appropriate message"
"Create a pull request for this feature"

Multi-Tool Workflows

  • Batch operations: Call multiple tools in single response
  • Parallel execution: Run git status + diff + log simultaneously
  • Performance optimization: Reduces round-trips
  • Complex workflows: Chain dependent operations
# Parallel git operations
"Show me git status, recent commits, and current diff"

# Multi-file analysis
"Check all test files and their coverage simultaneously"

💡 Pro tip: Request "in parallel" for faster execution


Essential Workflow Tools

Customize Your Experience

Session management and personalization


CLAUDE.md Files

  • Project memory: ./CLAUDE.md (shared with team)
  • User memory: ~/.claude/CLAUDE.md (personal preferences)
  • Rules directory: .claude/rules/ for organized project rules
  • Auto-discovered up directory tree
  • Quick add: Start input with # to add memory
  • Automatic memory: Claude records and recalls across sessions
  • Commands: /memory to edit, /init to bootstrap
  • Import files: Use @path/to/import syntax

AGENTS.md vs CLAUDE.md (the trap)

  • AGENTS.md is the convention for other tools (Codex, etc.)
  • Claude Code does NOT natively read AGENTS.md — only CLAUDE.md (open issue #6235)
  • A repo with both files looks bilingual but is silently single-language to Claude Code
  • Bridge pattern — reference AGENTS.md from CLAUDE.md so Claude Code picks it up:
# CLAUDE.md
…project-specific guidance for Claude Code…

## Cross-tool conventions
See @AGENTS.md for conventions shared with Codex and other agentic tools.
  • The @ import keeps a single source of truth without duplicating content

Custom Statusline

  • Configure context display: ~/.claude/settings.json or /statusline
  • Shows git branch, status, working directory, custom info
  • Keeps important context visible without asking
  • Reduces repetitive status checks
{
  "statusline": {
    "items": [
      {"type": "git_branch"},
      {"type": "git_status"},
      {"type": "cwd"},
      {"type": "custom", "command": "node -v"}
    ]
  }
}

Perfect for teams wanting standardized context visibility


Slash Commands (Four Categories)

  • Built-in/help, /clear, /compact, /init, /memory, /permissions, /code-review, /config, /plan, /login, /mcp, … (~30 and growing)
  • Custom (now merged into skills).claude/commands/<name>.md still works; skills are the modern path
  • Skill-derived — any skill with user-invocable: true exposes /<skill-name>
  • Plugin-supplied — installed plugins contribute their own commands
  • Discovery: /help lists current commands; / completion as you type
  • Conflict rule: if a command and a skill share a name, the skill wins
  • Scope: project (.claude/) shares with team; user (~/.claude/) is personal

Don't memorize the catalog — it changes monthly. Learn the categories and let /help enumerate.


Creating Custom Commands

  • Simple commands: Just a markdown file — no frontmatter needed
  • Skills: Add YAML frontmatter for model, effort, tools, paths
  • Use $ARGUMENTS or $0, $1 for dynamic content
# Quick command (lightweight)
mkdir -p .claude/commands
echo "Create service for $ARGUMENTS entity" > .claude/commands/service.md

# User-scoped command (personal, available across projects)
mkdir -p ~/.claude/commands
echo "Fix issue #$ARGUMENTS" > ~/.claude/commands/fix.md

# Usage: /service User  or  /fix 123

Real-world example:

# ~/.claude/commands/docs.md
Update both the README.md and CLAUDE.md files as appropriate.
If either file does not exist, please create it. Generate the
CLAUDE.md file as though the user invoked the init task.

Hooks & Automation

  • Event-driven workflow automation with four hook types:
    • Command hooks: Run shell commands on events
    • HTTP hooks: POST JSON to a URL endpoint
    • Prompt hooks: Ask Claude for yes/no decisions
    • Agent hooks: Spawn subagents to verify conditions
  • Conditional hooks: if field filters when hooks run (permission rule syntax)
  • PreToolUse: Modify tool inputs, block dangerous operations
  • Security controls: Validate and filter operations before they run
  • Configuration: ~/.claude/settings.json or .claude/settings.json

Hook Examples

Security validation (block dangerous edits)

{ "hooks": { "PreToolUse": [{
  "type": "command", "command": "validate-edit.sh", "if": "Edit(**)"
}] } }

Workflow automation (auto-format on write)

{ "hooks": { "PreToolUse": [{
  "type": "command", "command": "prettier --write $FILE", "if": "Write(**)"
}] } }

Session lifecycle (report on end)

{ "hooks": { "SessionEnd": [{
  "type": "command", "command": "generate-session-report.sh"
}] } }

Important: Treat hook feedback as user input — Claude adjusts if blocked.


Hook Events

  • Session: SessionStart, SessionEnd, InstructionsLoaded
  • Tools: PreToolUse, PostToolUse, PermissionRequest, PermissionDenied
  • Teams: TeammateIdle, TaskCreated, TaskCompleted
  • Files: FileChanged, CwdChanged, WorktreeCreate, WorktreeRemove
  • Config: ConfigChange, Notification
  • Context: PreCompact, PostCompact
  • Output: MessageDisplay — transform or hide assistant message text
  • MCP: Elicitation, ElicitationResult
  • Agent-level hooks: Skills and agents define their own hooks in frontmatter

Customizable Keybindings

  • /keybindings command to configure keyboard shortcuts
  • Config file: ~/.claude/keybindings.json
  • Remap any action to preferred key combinations
  • chat:newline action for configurable multi-line input
  • Argument shorthand: $0, $1 in custom commands (not just $ARGUMENTS)
{
  "chat:submit": "enter",
  "chat:newline": "shift+enter",
  "chat:switch_model": "alt+p",
  "chat:open_external_editor": "ctrl+x ctrl+e"
}

Key shortcuts: Ctrl+B (background), Ctrl+X Ctrl+K (kill agents), Ctrl+X Ctrl+E (external editor)


LSP: Code Intelligence

  • Language Server Protocol integration for precise code navigation
  • Go to definition: Jump to where symbols are defined
  • Find references: Locate all usages across the codebase
  • Hover info: Get type information and documentation
  • Call hierarchy: Trace incoming and outgoing calls
  • Workspace symbols: Search for symbols across the project
  • Works with any configured LSP server (TypeScript, Java, Python, etc.)

Output Styles

  • Modify the system prompt to set role, tone, and format — not what Claude knows
  • Built-in styles: Default, Concise, Explanatory, Learning
  • Custom styles: Create your own in ~/.claude/output-styles/ (user) or .claude/output-styles/ (project)
  • Use cases:
    • Onboarding new team members (Explanatory)
    • Pair-programming and teaching (Learning — drops TODO(human) markers for you to fill in)
    • Custom registers for code review, production work, etc.
  • For project-specific guidance (conventions, codebase facts), use CLAUDE.md instead

Using Built-in Output Styles

  • Default: Standard software-engineering system prompt
  • Concise: Leads with results, skips preamble and narration — same thoroughness
  • Explanatory: Adds educational "Insights" between coding steps
  • Learning: Collaborative learn-by-doing — Claude inserts TODO(human) markers for you to implement
  • Switch via /config → select Output style from the menu
  • Or edit outputStyle directly in .claude/settings.local.json:
{ "outputStyle": "Explanatory" }
  • Changes take effect on the next session (the system prompt is fixed at session start so prompt caching stays warm)

Creating Custom Output Styles

Create ~/.claude/output-styles/production.md:

---
name: Production
description: Concise output for experienced developers
---

# Instructions for Claude

- Be concise and action-focused
- Skip explanations unless asked
- Show code without lengthy preambles
- Assume expert-level knowledge

Then run /configOutput style and pick Production. Start a new session for the change to apply.


Resuming Conversations

  • --continue: Automatically resume most recent conversation
  • --resume: Interactive picker showing conversation history with timestamps and message counts
  • Full history restored: Complete message context maintained (even hundreds of messages)
  • Original settings preserved: Model and configuration retained
  • Stored locally: Complete conversation database maintained on your machine
# Continue most recent conversation
claude --continue

# Show conversation picker with details
claude --resume

# Continue with new prompt
claude --continue --print "Continue with my task"

Working with Images

  • Drag and drop images into Claude Code window
  • Copy/paste with Ctrl+V (not Cmd+V even on a Mac!)
  • Provide file path: "Analyze this image: /path/to/screenshot.png"
  • Analyze UI designs, error screenshots, diagrams
  • Generate code from visual mockups
  • Debug visual issues and layouts
# Common image workflows
"Analyze this error screenshot and suggest fixes"
"Generate HTML/CSS for this UI mockup"
"Explain what this diagram shows"
"Convert this whiteboard sketch to code"

Jupyter & Data Science Support

  • Read .ipynb files with full cell outputs
  • Analyze notebooks: Code, markdown, and visualizations
  • Edit notebook cells: Use NotebookEdit tool
  • Data analysis workflows: Process datasets and results
  • Visualization understanding: Interpret charts and graphs
"Analyze this Jupyter notebook and explain the data pipeline"
"Add error handling to the data processing cells"
"Convert this notebook to a production Python script"

Advanced Features

Power User Capabilities

Complex features for sophisticated workflows


The Decision Ladder

Before you build anything, name what you're building:

If... You have a... Lives at
The work happens once Prompt the conversation
Work repeats the same way each time Skill .claude/skills/<name>/SKILL.md
A coherent suite needs to ship Plugin <plugin>/.claude-plugin/plugin.json
The agent needs live access to a system MCP server .mcp.json (or inside a plugin)
A step must be deterministic Hook settings.json (or plugin hooks/)

Most installable capabilities are single skills. Plugins typically bundle a coherent suite from one author — document-skills ships ~16 skills (xlsx, pdf, docx, pptx…); autoresearch ships ~10.

📖 Full vocabulary in glossary.md at the repository root.


Skills: Persistent Domain Expertise

  • Modular capabilities that extend Claude's functionality beyond the base model
  • Unified with slash commands (v2.1): Skills and commands merged into one system
  • Three-tier loading system for efficiency:
    • Metadata (always loaded): Name and description (~100 tokens)
    • Instructions (triggered): Main SKILL.md with procedures
    • Resources (on-demand): Scripts, templates, reference files
  • Hot-reload: Edit SKILL.md and changes take effect immediately
  • Automatic activation when contextually relevant
  • Progressive disclosure: Load only what's needed for each task

Built-in Skills

Anthropic provides four production-ready Agent Skills:

  • 📊 Excel (xlsx): Build spreadsheets, generate reports with charts
  • 📄 Word (docx): Create and format professional documents
  • 📽️ PowerPoint (pptx): Create and edit presentations
  • 📑 PDF (pdf): Generate formatted PDF documents and reports

Usage: These skills activate automatically when you reference relevant file types or request document creation

# Skills activate automatically
"Create a quarterly report spreadsheet with sales data"
"Generate a PDF proposal document with our company branding"
"Build a presentation deck for the product launch"

Creating Custom Skills

Skill Structure

~/.claude/skills/my-skill/
├── SKILL.md      # Required: YAML frontmatter + instructions
├── templates/    # Optional: reusable templates
├── scripts/      # Optional: helper scripts
└── reference/    # Optional: docs, schemas

Frontmatter options: effort, context: fork, paths, shell, model


Example SKILL.md

---
name: Java Spring Generator
description: Generate Spring Boot components
effort: high
paths:
  - "src/**/*.java"
---

# Instructions

When generating Spring Boot code:
1. Use constructor injection, not @Autowired
2. Follow controller/service/repository packages
3. Include JavaDoc
4. Generate tests with @SpringBootTest

Plugins: Team-Wide Extensibility

  • Plugin system (v2.0.12+) provides installable packages of commands, agents, hooks, and MCP servers
  • Plugin marketplace: Discover and share team workflows
  • Repository-level config: extraKnownMarketplaces for enterprise control
  • Management commands:
    • /plugin install <name> - Install from marketplace
    • /plugin enable/disable <name> - Control active plugins
    • /plugin marketplace - Browse available plugins
    • /plugin list - View installed plugins

Plugin Use Cases

Enterprise Workflows

  • Standardize code generation across teams
  • Enforce security review processes
  • Automate compliance documentation
  • Integrate with internal tools and APIs

Team Collaboration

  • Share custom commands and agents
  • Distribute MCP server configurations
  • Onboard new team members faster

Plugin Example

# Install company's internal plugin
/plugin install acme-corp-standards

# Plugin provides:
# - Slash commands for service generation
# - Security review hooks
# - MCP servers for internal APIs
# - Pre-configured output styles

Effort Levels

  • /effort low|medium|high|xhigh|max controls reasoning depth (picker labels: Faster ↔ Smarter)
  • Low: Fast responses for simple tasks
  • Medium: Balanced reasoning
  • High: Deep analysis for complex architecture (current Opus defaults here)
  • xhigh: Very deep reasoning for hard tasks
  • max: The ceiling — reserve for the hardest problems
  • Keywords still work: "think", "think harder", "ultrathink"
  • Can set in skill frontmatter: effort: high
/effort high

# Or use keywords in your prompt
"Ultrathink about the best approach for implementing OAuth2"

Plan Mode

  • Type /plan or cycle with Shift+Tab to activate
  • Claude presents implementation plan before writing code
  • Review strategy, approve, or modify approach
  • Perfect for complex, multi-file changes
  • Uses the Plan subagent behind the scenes
  • Plan big work in the cloud: claude --cloud "…", review from any surface, /teleport it back

Subagents: Specialized Task Handlers

  • Autonomous agents that Claude launches for specialized tasks
  • Dynamic selection: Claude chooses appropriate subagent automatically
  • Model selection: Different subagents can use different models
  • Built-in types:
    • Plan: Strategic task decomposition and planning
    • Explore: Fast codebase exploration and search
    • General-purpose: Full read/write access for complex work
  • Custom agents: Define in .claude/agents/ as markdown with YAML frontmatter
    • Specify: model, tools, effort, hooks, permissionMode
  • Background execution: Ctrl+B to background, Ctrl+X Ctrl+K to kill
  • Worktree isolation: isolation: "worktree" for safe parallel work

When Claude Uses Subagents

Automatic Activation

Claude launches subagents when tasks match specialized capabilities:

# Triggers Explore subagent (read-only, fast search)
"Find all API endpoints in this codebase"
"How does authentication work across the project?"

# Triggers Plan subagent
/plan or "Create a plan for adding OAuth"

# Triggers General-purpose subagent (full read/write)
"Generate comprehensive test coverage for UserService"
"Create API documentation for all REST endpoints"

You don't manage this - Claude handles subagent selection automatically for optimal results


Agent Teams (Research Preview)

  • Multi-agent orchestration: A lead agent coordinates multiple teammates
  • Shared task list: Tasks with dependencies, ownership, and status tracking
  • Independent context: Each teammate gets its own context window
  • Inter-agent messaging: Direct messages, broadcasts, and shutdown coordination
  • Automatic work distribution: Teammates self-claim tasks as they finish
# Enable teams (still gated by this env var)
export CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1

# Example prompt
"Create a team to refactor the auth module: one agent updates
the service layer, another updates tests, a third updates docs"

With the env var set, every session already has one implicit team — no TeamCreate step.


How Agent Teams Work

  • Lead agent spawns teammates directly via the Agent tool's name parameter — the old TeamCreate/TeamDelete tools were removed
  • Teammates work independently, report back, claim new tasks
  • Messaging: continue a teammate with SendMessage (relayed messages don't carry user authority — a security guardrail)
  • Idle state is normal: Teammates go idle between turns, wake on message
  • Hook events: TeammateIdle, TaskCompleted for automation
  • Best for: Large refactors, multi-file features, parallel code + test work
Lead Agent ──→ creates tasks ──→ assigns teammates
     ↑                              │
     └── receives results ←─────────┘
         (via shared task list + messages)

Dynamic Workflows

  • Orchestrate tens to hundreds of background agents from a single request
  • Deterministic control flow: loops, conditionals, fan-out, and pipelines decide what runs — not model improvisation
  • Opt-in: include the keyword ultracode in your prompt, or just ask Claude to "use a workflow" (the keyword was renamed from workflowultracode)
  • Runs in the background: keeps each agent's tool output out of your main context; you're notified when it completes
  • View runs: /workflows

Built for work one context can't hold: exhaustive multi-dimension code review, a migration swept across many files, or N independent design attempts scored against each other.


Agent Teams vs. Dynamic Workflows

Agent Teams Dynamic Workflows
Coordination Model-driven — a lead agent decides Script-driven — deterministic control flow
Best when Work shape emerges as you go You can describe the structure up front
Scale A handful of teammates Tens to hundreds of agents
Trigger CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 + ask ultracode keyword / "use a workflow"
  • Both spend tokens at scale — reach for them on genuinely large, parallelizable work, not quick edits

Background Agents

  • Run tasks while you keep working — your prompt stays free
  • Ctrl+B to background a running agent
  • Ctrl+X Ctrl+K to kill all background agents
  • /batch skill: parallel changes across many files (uses worktrees under the hood)
  • Subagents can declare isolation: "worktree" in frontmatter for safe parallel writes
  • See the Git Worktrees slide later for the worktree mechanics

Session Management

  • Named sessions: /rename my-feature for easy identification later
  • PR-linked sessions: claude --from-pr 123 resumes with PR context loaded
  • Session branching: /branch to fork a conversation when you want to try two paths
  • Resume picker: claude --resume shows up to 50 recent sessions with timestamps
  • Continue last: claude --continue jumps straight back into the most recent
  • Auto-memory: Claude records and recalls context across sessions

(Cross-surface handoffs — --remote, /teleport, /desktop, Dispatch — are covered in the Surfaces section.)


Auto-Memory

  • Claude automatically records and recalls memories as it works
  • Stored at ~/.claude/projects/<project>/memory/
  • MEMORY.md index file loaded at session start (first 200 lines)
  • Topic files loaded on demand when relevant
  • /memory command to view and manage memories
  • Memory types: user preferences, feedback, project context, references
  • Subagents can maintain their own auto memory
  • Toggle with autoMemoryEnabled setting

Auto Mode

  • Eliminates permission prompts via a background safety classifier
  • Classifier reviews each action and allows/blocks automatically
  • Different from Auto-Accept (Shift+Tab): Auto Mode is intelligent, not blanket
  • Allows: Local file ops, dependency installs, read-only HTTP, pushing to current branch
  • Blocks: Downloading + executing code, production deploys, force pushes, IAM changes
  • Requirements: a current Sonnet / Opus / Fable model; available across paid plans (Pro, Max, Team, Enterprise, API)
  • Enable: --permission-mode auto, or cycle with Shift+Tab
  • Recommended over --dangerously-skip-permissions for new workflows; the old flag still works for personal/Pro use

Scheduled Tasks: Three Tiers

/loop Desktop Cloud
Runs on Your machine Your machine Anthropic cloud
Requires open session Yes No No
Persistent No Yes Yes
Local file access Yes Yes No
Min interval 1 minute 1 minute 1 hour

Using Scheduled Tasks

  • /loop — Session-scoped polling: /loop 5m check if the deployment finished
  • Desktop — Persistent local tasks that survive restarts
  • Cloud — Always-on via /schedule — runs even with your machine off
  • Cloud tasks clone the repo fresh each run (default branch)

Channels (Research Preview)

  • Push events from external sources into running Claude Code sessions
  • Supported: Telegram, Discord, iMessage (via plugins)
  • Two-way: Claude reads events and replies back
  • Use cases: chat bridge from phone, CI/monitoring webhooks
  • --channels flag to enable: claude --channels plugin:telegram@claude-plugins-official
  • Requires claude.ai login
  • Enterprise: admin must enable channelsEnabled

Model Context Protocol (MCP)

  • Standard protocol for AI-to-system connections
  • Tool integration (APIs, databases, services)
  • Context enhancement for better AI responses
  • Security controls and permissions
  • MCP Tool Search (default since v2.1): Lazy-loads tools on demand
    • Reduces context usage by ~95% with many MCP tools
    • Tools discovered automatically when needed

MCP Configuration

# Import from Claude Desktop
claude mcp add-from-claude-desktop

# Add remote server (HTTP)
claude mcp add --transport http context7 https://mcp.context7.com/mcp

# Add local server
claude mcp add context7 -- npx -y @upstash/context7-mcp
  • Project config: .mcp.json in project root
  • Management: claude mcp list, /mcp enable|disable

MCP Server Examples

  • GitHub MCP - Repository operations, issues, PRs
  • Context7 - Downloads latest API docs and examples for modern code
  • Docker MCP Toolkit - Container management and operations
  • Playwright MCP - UI test generation and browser automation
  • Heroku MCP - Deployment and app management

Setting Up MCP Servers

  • Interactive setup: claude mcp
  • Local servers: Full configuration control
  • Remote servers: OAuth authentication, zero maintenance
  • Docker MCP Toolkit: docker mcp gateway run
# List existing MCP servers
claude mcp list

# Add local server
claude mcp add my-server -e API_KEY=123 -- /path/to/server

# Add remote server (HTTP)
claude mcp add --transport http remote-server https://example.com/mcp

# Add Docker MCP toolkit
claude mcp add docker-mcp docker mcp gateway run

Claude Code SDKs

  • Available SDKs: TypeScript, Python, Command Line
  • Build AI-powered coding assistants into your workflows
  • Multi-turn conversations and session management
  • Custom system prompts and flexible I/O formats
  • MCP integration for extended capabilities
# Command line usage
claude -p "Write a function to calculate Fibonacci numbers"
claude -p "Generate a hello world function" --output-format json
// TypeScript SDK
import { query } from "@anthropic-ai/claude-code";

for await (const message of query({
  prompt: "Write a haiku about foo.py",
  options: { maxTurns: 3 }
})) {
  // Process messages
}

SDK in Three Patterns

Python — async iteration with context files

from claude_code import query

async for msg in query("Refactor this module",
                       context_files=["app.py"], max_turns=3):
    print(msg.content)

CI/CD — JSON output for parsing

- name: AI Code Review
  run: claude -p "Review PR changes" --output-format json > review.json

Git hooks — restricted tools, fail fast

# .git/hooks/pre-commit
claude -p "Check for security issues" --allowed-tools read,grep

Same SDK, three deployment shapes: interactive script, CI step, git hook.


VS Code Extension

  • Native IDE integration bringing Claude Code into your editor
  • In-editor experience: Work with Claude without leaving VS Code
  • Context-aware: Accesses your workspace files and settings
  • All Claude Code features: Skills, MCP, custom commands available
  • Installation: Search "Claude Code" in VS Code Extensions marketplace

VS Code Extension Features

Integrated Workflow

  • Reference files with @ syntax directly in VS Code
  • View diffs and approve changes inline
  • Session management with AI-generated titles, rename, fork
  • Plan view panel with full markdown and commenting
  • MCP server management via /mcp in extension
  • Compaction display as collapsible card

Also Available

  • JetBrains Plugin: IntelliJ, PyCharm, WebStorm — same core features

Management & Control

Monitor and Control

Cost, context, and permission management


Cost Monitoring

  • Use /cost command to check usage
  • Shows current usage and limits
  • Pro Plan: Displays prompt count vs limit
  • Max Plans: Shows monthly usage summary
  • Limits reset every 5 hours
  • Plan ahead for intensive work sessions
# Check your current usage
/cost

# Example output (Pro Plan):
# 📊 Cost information:
#    - Input tokens: 1,245
#    - Output tokens: 3,782
#    - Total cost: $0.076

# Example output (Max Plan):
# With your Claude Max subscription, no need to monitor cost
# — your subscription includes Claude Code usage

Context Management

  • /compact compresses conversation history while preserving essentials
  • Auto-compaction triggers near the context limit; you'll see a warning first
  • Manual is better when you know a logical chunk is done — pick the seam
  • Long sessions stay coherent over hundreds of messages with periodic compacts
  • /context shows what's currently consuming the window
/compact   # proactive — pick your moment

# What you'll see when auto-compaction is imminent:
⚠️ Context limit approaching. Auto-compacting in next response
to preserve conversation history and continue working.

Configuring Permissions

  • Fine-grained control over Claude Code's capabilities
  • Use /permissions UI to manage tool permissions
  • Allow/Deny rules for specific tools and actions
  • Enterprise policies for organization-wide control
  • Permission precedence: Enterprise → CLI → Project → User
# Example permission rules
Bash(npm run test:*)     # Allow npm test commands
Edit(docs/**)           # Allow editing docs directory
Read(src/*)             # Allow reading source files

# Access permissions UI
/permissions

Permission Modes

Six modes (cycle with Shift+Tab)

  • Default: Prompts for each action
  • Accept Edits: Auto-approves file edits
  • Plan: Read-only exploration, no edits
  • Auto: Safety classifier decides (Team/Enterprise/API)
  • Don't Ask: Only pre-approved tools run (CI/CD)
  • Bypass Permissions: No prompts at all
# Quick permission profiles via aliases
alias claude-dev='claude --allowed-tools all'
alias claude-review='claude --allowed-tools read,grep'
alias claude-safe='claude --disabled-tools bash,webfetch'
alias claude-ci='claude --allowed-tools bash,git,test'

Team & Best Practices

Collaborate Effectively

Team workflows and professional practices


Git Worktrees for Parallel Sessions

  • Built-in worktree support: claude -w or claude --worktree
    • Automatically creates isolated worktree + new branch
    • Prompts to keep or remove on session exit
  • Manual worktrees also work for full control
  • Share git history while isolating working files
  • Perfect for multi-feature development
# Built-in (preferred) — automatic isolation
claude -w                     # Start in new worktree
claude --worktree             # Same thing

# Manual worktrees for full control
git worktree add ../project-feature-a -b feature-a
cd ../project-feature-a && claude

# Manage worktrees
git worktree list
git worktree remove ../project-feature-a

Effective Prompting & Best Practices

Effective Prompting

  • Be specific about what you want to achieve
  • Provide context about your goals and constraints
  • Use iterative refinement for complex tasks
  • Include examples when possible to show desired patterns

Best Practices

  • Create a git branch first for any significant changes
  • Commit checkpoints regularly during development
  • Review all AI-generated code before accepting
  • Test generated code thoroughly

Troubleshooting & Configuration

System Health Check

claude doctor   # Diagnose installation issues (in-session: /doctor)

Global Configuration

Settings live in JSON files, not CLI commands (claude config was retired in 2.0):

$EDITOR ~/.claude/settings.json      # user settings (model, hooks, permissions…)
$EDITOR .claude/settings.json        # project settings, checked in

Check Current Settings

# In-session: /config opens the interactive settings panel
cat ~/.claude/settings.json
echo $ANTHROPIC_API_KEY  # Verify API key

Common Issues: Installation

  • Command not found → Check PATH: which claude (native) or npm list -g @anthropic-ai/claude-code (npm install)
  • Permission denied → Re-run the native installer; for npm, fix prefix or use sudo
  • Windows users → Use WinGet or run inside WSL 2 (note: /sandbox requires WSL 2, not native Windows or WSL 1)
# Recommended: native installer (auto-updates)
curl -fsSL https://claude.ai/install.sh | bash

# Legacy npm (still works, no auto-update)
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code

Common Issues: Runtime

  • API key not found → Set ANTHROPIC_API_KEY environment variable
  • Rate limits → Use /cost to monitor usage
  • Context too large → Use /compact to reduce conversation size
# Reinstall the native binary (auto-updates after install)
curl -fsSL https://claude.ai/install.sh | bash

Development Process

  • Start with clean git state
  • Generate tests if none exist
  • Commit checkpoints regularly
  • Use Claude for git workflows (commits, issues, merges)
  • Use git worktrees for parallel sessions on different branches
  • Review changes before accepting
  • Test generated code thoroughly

Command Reference: Workflow

Command Description
/effort low|medium|high|xhigh|max Set reasoning depth
/plan Enter Plan Mode from prompt
/code-review [level] [pr#] Review the current diff or a PR (ultra = cloud)
/workflows View dynamic-workflow runs (trigger with ultracode)
/batch Parallel changes across codebase
/loop 5m prompt Recurring prompt execution
/memory View and manage auto-memory

Command Reference: Utilities

Command Description
/branch Branch the conversation
/fork Copy the session into a background session (own worktree)
/subtask Launch an in-session background subagent
/copy N Copy Nth-latest response to clipboard
/context Get context optimization suggestions
/color Set prompt-bar color for session
/powerup Interactive feature lessons

Removed: /tag, /vim (use /config).


Quick Access

Claude Code Docs

code.claude.com/docs

Course Repository

github.com/kousen/claude-code-training


Important Links

📚 Claude Code Documentation

https://code.claude.com/docs/en/overview

🐙 Official GitHub Repository

https://github.com/anthropics/claude-code

💻 Course Source Code & Exercises

https://github.com/kousen/claude-code-training

🆘 Support & Issues

https://github.com/anthropics/claude-code/issues


Thank You!

Questions?

Kenneth Kousen
Author, Speaker, Java & AI Expert

kousenit.com | @kenkousen