Mastering AI-Assisted Development

Tools, Workflows & Best Practices

Terminal-First AI MCP Integration Agentic Workflows

by Mikul Gohil

Duration: 2.5-3 hours | Level: Beginner to Intermediate

What You'll Be Able To Do

By the end of this training, you'll be able to:

Set Up Your Environment

Configure CLAUDE.md, MCP servers, and hooks for your projects

Use Agents Effectively

Delegate tasks to Explore, Plan, and custom agents with proper model selection

Optimize Costs

Use Haiku for exploration, Sonnet for coding, subagents for parallel work

Create Custom Workflows

Build commands, skills, and automation hooks tailored to your needs

Manage Context Efficiently

Use /compact, /clear, /cost to stay within limits and track usage

Follow Best Practices

Apply the Explore → Plan → Code → Verify → Clear workflow

Training Agenda

Part 1: Foundations

~30 minutes

  • Introduction to AI & LLMs
  • AI Developer Tools Landscape
  • What is Claude Code?
  • Prompt Engineering Basics

Part 2: Core Features

~60 minutes

  • MCP (External Tools)
  • Agents (AI Workers)
  • Commands & Skills
  • Hooks (Automation)
  • Memory (CLAUDE.md)

Part 3: Mastery

~30 minutes

  • Token Optimization
  • Best Practices
  • Real-World Workflow
  • Summary & Resources
Navigation: Use ← → to move between sections, ↑ ↓ to navigate within a section. Press ? for help.

Section 1

Introduction to AI

The LLM Revolution (2022-2026)

What is Artificial Intelligence?

Traditional Programming

Input + Rules → Output

if (temperature > 30) {
return "hot";
}

You write explicit rules

Machine Learning / AI

Input + Output → Rules

model.train(examples)
model.predict(new_input)

AI learns patterns from data

The Evolution of Language AI

2017 - Transformers - Google's "Attention Is All You Need" paper
2018-2020 - GPT-1, GPT-2, GPT-3 - OpenAI scales up
2022 - ChatGPT (GPT-3.5) - AI goes mainstream
2023 - GPT-4, Claude 2 - Multimodal, improved reasoning
2024 - Claude 3, Claude 3.5 - Sonnet becomes coding leader
2025 - Claude Code, GPT-5 - Agentic AI workflows
2026 - Claude Opus 4.5 - Advanced reasoning, 200K context

Major LLM Players (2026)

CompanyModelKey Strength
AnthropicClaude Opus 4.5 / Sonnet / HaikuBest for code, reasoning, Claude Code CLI
OpenAIGPT-5 / o1Multimodal, broad capabilities
GoogleGemini 2.5 Pro2M+ context window
MetaLlama 4Open-source, customizable
Why Claude for coding? Claude excels at coding tasks due to training emphasis on helpfulness, harmlessness, and honesty — plus Claude Code provides terminal-native workflows.

How LLMs Work: The Basics

1. Tokenization

Text is split into tokens (words/subwords)

"Hello world" → ["Hello", " world"]
"unhappiness" → ["un", "happiness"]

2. Embeddings

Tokens become number vectors

"cat" → [0.2, -0.5, 0.8, ...]
"dog" → [0.3, -0.4, 0.7, ...] (similar!)

3. Transformer Architecture

Self-attention weighs token relationships

"The cat sat on the mat"
→ "mat" attends strongly to "cat", "sat"

4. Next Token Prediction

Predicts most likely next word

"The quick brown" → "fox" (90%)
Autoregressive: one token at a time

Context Windows: Why They Matter

What is a Context Window?

Maximum tokens the model can "see" at once

GPT-3.5 (2022)4K tokens
GPT-4 (2023)128K tokens
Claude 3 (2024)200K tokens
Gemini (2025)2M+ tokens

Why It Matters for Code

200K tokens ≈
• ~150,000 words
• ~500 pages of text
• An entire codebase!

Larger context = better understanding of your entire project

LLM Limitations: What You Must Know

Understanding limitations prevents frustration and mistakes.

Knowledge Cutoffs

Models don't know anything after their training date. New libraries, APIs, or updates are unknown.

Hallucinations

LLMs confidently generate plausible but incorrect code, facts, or explanations. ~30-40% error rate on complex tasks.

No Code Execution

Can't run or test code unless explicitly integrated with tools. Output is text, not verified results.

No Persistent Memory

Each session starts fresh. No memory of previous conversations unless explicitly provided.

LLMs generate statistically likely text, not verified truth. Always validate outputs.

Working Effectively with AI

Practical tips to maximize productivity with AI coding assistants.

Always Verify
Treat AI outputs as suggestions, not solutions. Run the code, check the logic, test edge cases.
Provide Rich Context
Include error messages, library versions, OS, constraints. Vague prompts = vague answers.
Iterate in Small Steps
Break complex tasks into smaller pieces. Review each step before proceeding.
Know the Strengths
Great: boilerplate, syntax, refactoring, explanations.
Verify: complex logic, security, edge cases.

Section 2

AI Developer Tools

The Landscape in 2025

AI Coding Tools Timeline

June 2021 - GitHub Copilot preview - first AI pair programmer
2022 - AWS CodeWhisperer enters the market
2023 - Cursor AI-first IDE launched
2024 - Claude Code - terminal-first approach
2025 - Agentic era: autonomous agents handling full PRs
Key shift: From autocomplete → autonomous agents handling full features

The Major Players (2025)

ToolTypeStrengthBest For
GitHub CopilotIDE PluginEcosystem, 1.8M usersVS Code, general coding
CursorAI-first IDESpeed (320ms), ComposerMulti-file refactoring
Claude CodeTerminal CLIAgentic, context-awareComplex workflows
WindsurfIDEFull-stack generationRapid prototyping

How AI Changed Development

Before AI (Traditional)

  • Manual typing, copy-paste from Stack Overflow
  • Hours debugging by reading docs
  • Write tests manually after code
  • Code reviews take days

With AI (2025)

  • Describe intent → get working code
  • AI explains errors & fixes them
  • TDD with AI-generated tests
  • Instant AI code review
Productivity boost: 2-3x faster development, 70% less boilerplate

Tool Categories

Understanding the different types of AI coding tools.

CategoryExamplesHow It WorksBest For
AutocompleteCopilot, Tabnine, CodeiumInline suggestions as you typeSpeed, boilerplate
Chat + IDECursor, Windsurf, CodyChat panel integrated with editorRefactoring, explanations
Terminal/AgentClaude Code, AiderCLI-first, agentic workflowsComplex tasks, automation
Trend: Tools are moving from autocomplete → chat → autonomous agents

Choosing the Right Tool

Match the tool to your task.

Quick Autocomplete

Use: GitHub Copilot, Tabnine

Best for: Fast typing, boilerplate, familiar patterns

Multi-file Refactoring

Use: Cursor, Windsurf

Best for: Large changes across files, visual diff review

Complex Workflows

Use: Claude Code

Best for: CLI-first, git operations, agentic tasks, full PR workflows

Learning & Exploration

Use: ChatGPT, Claude.ai

Best for: Understanding code, exploring options, research

Section 3

What is Claude Code?

Anthropic's Terminal-First AI Coding Assistant

Claude Code: Overview

What is it?

Anthropic's official CLI tool that brings Claude directly into your terminal.

$ claude

> Fix the auth bug in login.ts

Analyzing codebase...
Found issue. Applying fix...

Key Features

Terminal-native - Works where developers live
Agentic - Executes multi-step tasks autonomously
Codebase-aware - Understands your entire project
Extensible - Skills, hooks, agents, MCP

Why Terminal-First?

Speed

No context switching. Stay in flow state.

Integration

Pipe output, chain commands, use with git/npm.

Automation

Script AI into your workflows. CI/CD ready.

Philosophy: "The best interface is no interface" — Claude Code meets you where you already work.

Installing Claude Code

macOS / Linux

$ curl -fsSL https://claude.ai/install.sh | bash

Windows (PowerShell)

PS> irm https://claude.ai/install.ps1 | iex

Prerequisites

  • macOS 13.0+ or Windows 10+
  • 4 GB+ RAM
  • Internet connection
  • Active billing (Claude Pro/Max or API)

First Run

cd your-project
claude

→ Choose theme
→ Connect Anthropic account
→ Trust directory

Claude Code vs Others

FeatureClaude CodeGitHub CopilotCursor
InterfaceTerminal CLIIDE PluginFull IDE
Agentic TasksNativeAgent ModeComposer
Context Window200K tokensVariesVaries
Custom WorkflowsSkills, Hooks, AgentsLimitedRules
MCP SupportNativeNoYes
Best ForPower users, automationQuick completionsVisual editing

Section 4

Prompt Engineering

Writing Effective Prompts for Claude

The Art of Good Prompts

Bad Prompt

"Fix the bug"

Vague, no context, unclear what "bug" means

VS

Good Prompt

"Fix the authentication bug in src/auth/login.ts where users get logged out after 5 minutes despite 'remember me' being checked."

Specific file, clear problem, context

Prompt Structure: The 4 C's

1. Context

What's the situation? What file/feature?

"In the user dashboard component..."

2. Clarity

What exactly do you want?

"Add a logout button that calls the auth API"

3. Constraints

Any requirements or limitations?

"Must work with our existing Redux store"

4. Criteria

How will you know it's done?

"Should redirect to login page after logout"

Prompt Patterns for Coding

Bug Fix: "In [file], there's a bug where [symptom]. Expected: [correct]. Actual: [wrong]. Related to [hypothesis]."
Feature: "Add [feature] to [component]. It should [behavior]. Use [existing pattern]. Acceptance: [criteria]."
Refactor: "Refactor [code] to [goal]. Keep [constraints]. Current: [problem]. Desired: [solution]."
Explain: "Explain how [code/system] works. Confused about [specific part]. My understanding: [current]."

Claude Code Specific Tips

Do This

  • Reference specific files: src/auth/login.ts
  • Use slash commands: /plan, /review
  • Ask Claude to read files first
  • Break complex tasks into steps

Avoid This

  • Vague requests: "make it better"
  • Multiple unrelated tasks at once
  • Assuming Claude knows your codebase
  • Ignoring Claude's questions
Pro tip: Use "Understand → Plan → Approve → Code" workflow

Real-World Prompt Examples

Adding a Feature
"Add a dark mode toggle to the navbar in src/components/Navbar.tsx. Use our existing theme context from src/contexts/ThemeContext. The toggle should persist preference to localStorage."
Debugging
"The login form in src/pages/Login.tsx submits twice when clicking the button. Console shows two API calls. I think it's related to the useEffect on line 23. Can you investigate?"
Code Review
"Review my PR changes in src/utils/validation.ts. Focus on: edge cases I might have missed, performance concerns, and if it follows our existing patterns in src/utils/helpers.ts."
Refactoring
"Refactor the getUserData function in src/api/users.ts. It's 200 lines with nested callbacks. Convert to async/await and extract the validation logic into a separate function."

Iterative Prompting

First prompt rarely gets perfect results. Here's how to refine:

If Output is Wrong

"That's not quite right. The issue is [specific problem]. Instead, I need [specific change]."

If Stuck

"Before writing code, explain your approach. What's your understanding of the problem?"

If Too Complex

"Let's break this down. First, just [step 1]. We'll handle [step 2] after that works."

If Unclear

"I'm not sure about [X]. What are the trade-offs between [option A] and [option B]?"

Key insight: Treat AI like a junior developer - give feedback, be specific, iterate.

Advanced Prompting Techniques

Chain-of-Thought

"Think through this step by step before writing code."

Forces deliberate reasoning, reduces errors.

Role Prompting

"As a senior security engineer, review this auth code for vulnerabilities."

Activates domain-specific knowledge.

Few-Shot Examples

"Here's how we format tests in this project: [example]. Now write tests for [new code]."

Shows desired output format.

Negative Constraints

"Don't use any deprecated APIs. Don't add new dependencies. Don't modify the database schema."

Prevents common mistakes.

Section 5

Everything Claude Code

Overview & Philosophy

The Core Philosophy

Token Optimization

Use right model for each task. Delegate to cheaper models.

Memory Persistence

Don't lose context. Save state, load history.

Continuous Learning

Extract patterns. Build skills. Get better over time.

Workflow: Understand → Plan → Approve → Code → Verify → Learn

Component Overview

Five building blocks that extend Claude Code's capabilities.

ComponentWhat It DoesWhy You Need It
AgentsSpecialized AI workers for specific tasksDelegate complex work, use cheaper models for simple tasks
CommandsQuick actions triggered by /slashOne-keystroke access to common workflows
SkillsReusable domain patternsEncode expertise once, apply everywhere
RulesAlways-active guidelinesEnforce standards without repeating instructions
HooksEvent-driven automationAutomate repetitive tasks, integrate with CI/CD

How They Work Together

Components integrate into a seamless workflow.

1. You make a request
"Add authentication to the API"
2. Commands trigger
/plan creates implementation strategy
3. Skills apply patterns
Auth skill provides JWT best practices
4. Agents handle subtasks
Security agent reviews, test agent writes tests
5. Rules guide behavior
Security rules enforce no hardcoded secrets
6. Hooks automate follow-up
Pre-commit runs linting, tests before commit

Configuration Levels

Organize settings at the right scope for your needs.

Global

~/.claude/

  • Your personal preferences
  • Applies to all projects
  • API keys, default settings

Use for: Personal workflow, credentials

Project

.claude/

  • Project-specific configs
  • Can be gitignored
  • Local experiments

Use for: Project settings, local overrides

Team (Shared)

CLAUDE.md in repo

  • Checked into version control
  • Shared with entire team
  • Coding standards, patterns

Use for: Team standards, shared rules

Repository Structure

What's inside "Everything Claude Code" and where to find it.

agents/ — 13 Specialized Workers
code-reviewer, test-runner, security-auditor, refactor-agent...
commands/ — 24 Slash Commands
/plan, /commit, /review, /tdd, /debug, /learn...
skills/ — 28 Domain Patterns
react-components, api-design, database-migrations, testing...
rules/ — 8 Coding Guidelines
coding-style, git-workflow, security, testing, performance...
hooks/ — Event Automation
pre-commit, post-save, session-start, context-compact...
mcp-configs/ — External Integrations
github, jira, slack, databases, APIs...
contexts/ — Session Management
Save/restore conversation state, project context...
docs/ — Documentation
Guides in multiple languages, examples, tutorials...

Section 6

Rules

Essential Guidelines for Claude Code Setup

What are Rules?

Rules are always-active guidelines that shape Claude's behavior. Loaded automatically.

coding-style.md

Code style, immutability, file limits

git-workflow.md

Commit conventions, branching

testing.md

TDD, coverage requirements

security.md

Security practices, secrets

agents.md

Subagent orchestration rules

hooks.md

Hook usage and patterns

patterns.md

Design patterns, best practices

performance.md

Performance optimization

Core Workflow: The Golden Rule

Understand → Plan → Approve → Code

Good Practice
"I understand you want to add user auth. I'll modify 3 files: auth.ts, middleware.ts, and routes.ts. Should I proceed?"
Bad Practice
"Done! I added authentication to your app." (No explanation, no approval asked)
Always explain what you understood, the root cause (for bugs), and exact changes planned. Wait for approval before coding.

Mandatory Task Checklist

Every task needs a checklist — even small changes.

Before Starting

  • Create clear task checklist
  • Define acceptance criteria
  • Identify files to change

Before Marking Complete

  • Re-verify every checklist item
  • Confirm criteria met
  • Confirm no unapproved changes
Rule: A task is NOT complete until the checklist is fully verified.

Clarification Rules

Never assume — always ask when unclear.

Good
"You mentioned 'improve performance'. Do you mean: (a) faster load time, (b) reduce bundle size, or (c) optimize API calls?"
Bad
"I'll optimize everything for you!" (Assumes scope without clarifying)
  • Confirm understanding — Restate the problem before proposing solutions
  • No silent decisions — If choosing between approaches, explain and ask
  • Restate requirements — Summarize in 3-5 bullets before coding

Safety & Scope Rules

Security / Secrets

  • Never paste real API keys or tokens
  • Use placeholders and .env.example
  • Flag immediately if secrets found

Change Size Guardrail

  • Avoid touching >3-7 files unless approved
  • Propose staged changes if needed

Scope Control

  • No hidden changes — Only modify approved files
  • No server/build — Unless explicitly requested
  • Follow existing patterns — Match folder structure, naming
  • Discover commands — Read package.json, don't guess

Testing Requirements

Every feature or bug fix needs appropriate tests.

What to Test

  • Write test cases for every change
  • Use Playwright for UI testing
  • Include edge cases and error states
  • Test boundary conditions

Manual Testing

  • Provide step-by-step test instructions
  • Ask user to verify with test cases
Example:
"To test: 1) Click login, 2) Enter invalid email, 3) Verify error message appears"

Documentation Rules

Every change must be documented in docs/.

File Organization

  • docs/components/<Name>.md
  • docs/features/<Name>.md
  • docs/general/<Topic>.md

Docs are feature-named, not date-named.

Entry Format

## 2024-01-15 14:30
- Summary: What changed
- Files touched: List
- Decisions: Why
- Follow-ups: Next steps

Never delete history — Docs are cumulative.

Problem-Solving Rules

Two-Attempt Rule

If approach fails twice, STOP and change strategy.

Research First

Use Perplexity MCP when stuck. Summarize findings with sources.

Present Alternatives

After failures, present 2+ different approaches before proceeding.

Learn from Failures

Document what didn't work and why in task notes.

Acknowledge knowledge limits — AI knowledge may be outdated. Verify with current docs.

Definition of Done

A task is complete only when ALL criteria are met:

Code Quality

Lint passes, type checks pass, follows patterns

Testing

Tests written and passing, manual QA provided

Documentation

Docs updated, change log appended

Final checks: No new TODOs without approval • No breaking changes • Acceptance criteria verified

Section 7

MCP

Connect Claude to External Tools & Services

What is MCP?

Model Context Protocol is an open standard that connects AI assistants to external data sources, tools, and services.

Think of MCP as:
USB for AI — a universal connector that lets Claude plug into any service without custom integrations.
MCP enables Claude to:
• Query databases in real-time
• Create GitHub PRs and issues
• Send Slack messages
• Automate browser testing
• Access your company's internal APIs

Why MCP Matters

Before MCP
Each AI tool needed custom integrations. Fragmented, expensive, hard to maintain.
With MCP
One protocol, universal compatibility. Build once, works with any MCP-compatible AI.
Open Standard
Not locked to Anthropic. Works with Claude, compatible IDEs, and future AI tools.

MCP Architecture

MCP uses a client-server model with three core components.

Host

The AI application (Claude Code, Claude Desktop, Cursor)

• Runs the LLM
• Manages user interactions
• Orchestrates MCP clients

Client

Embedded in the host, connects to servers

• 1:1 connection per server
• Handles JSON-RPC messages
• Manages authentication

Server

Exposes capabilities (tools, data, prompts)

• Runs as separate process
• GitHub, Slack, DB servers
• Can be local or remote
Transport Options: Stdio (local process, secure, no network) or HTTP+SSE (remote, requires auth)

MCP Capabilities

MCP servers expose three types of capabilities to Claude.

Tools

Executable functions Claude can call

Examples:
create_issue()
send_message()
run_query()
click_button()

Resources

Data sources Claude can read

Examples:
• Database records
• File contents
• API responses
• Live metrics

Prompts

Templates for common workflows

Examples:
• PR review template
• Bug report format
• Code analysis guide
• Deployment checklist
Key insight: Tools let Claude take action, Resources provide context, Prompts guide workflows.

Configuring MCP in Claude Code

CLI Commands (Easiest)

# Add an MCP server
claude mcp add github

# Add with specific scope
claude mcp add slack --scope project

# List configured servers
claude mcp list

# Remove a server
claude mcp remove github

JSON Configuration

~/.claude.json
{ "mcpServers": { "postgres": { "command": "npx", "args": ["-y", "@mcp/postgres"], "env": { "DATABASE_URL": "postgres://..." } } } }
Scopes:
~/.claude.json — Global (all projects)
.mcp.json — Project (version controlled)

Popular MCP Servers

Essential servers for development, research, and frontend workflows.

Research & Documentation

Context7Up-to-date docs for 43K+ libraries (React, Next.js, Vue, etc.)
PerplexityWeb research with AI — find solutions, best practices, tutorials
RepomapCode navigation — search symbols, understand large codebases
GitHubPRs, issues, code review, branch management

Frontend & Productivity

PlaywrightBrowser automation — click, type, screenshot, E2E tests
FigmaDesign-to-code — access files, export assets, inspect designs
Desktop-commanderSystem control — file ops, processes, beyond project scope
SupabaseBackend-as-a-service — database, auth, storage, edge functions
Recommended for Frontend: Context7 + Playwright + Figma
Find more: mcpmarket.compulsemcp.com

Creating Custom MCP Servers

Build your own MCP server in Python or TypeScript to expose custom tools.

Python (FastMCP)

my_server.py
from mcp import Server, tool server = Server("my-tools") @tool() def get_weather(city: str) -> str: """Get weather for a city.""" return f"Weather in {city}: Sunny" if __name__ == "__main__": server.run(transport="stdio")

Run: uv run mcp install

TypeScript (MCP SDK)

server.ts
import { Server } from "@mcp/sdk"; const server = new Server("my-tools"); server.tool("greet", { name: { type: "string" } }, async ({ name }) => { return `Hello, ${name}!`; }); server.run();

Run: npx ts-node server.ts

MCP Best Practices

Do This

  • Start with 2-3 servers — Add more as needed
  • Use project scope for team-shared servers
  • Prefer Stdio for local servers (more secure)
  • Use environment variables for credentials
  • Restart Claude Code after config changes

Avoid This

  • Too many MCPs at once — Context shrinks significantly
  • Hardcoded secrets in JSON configs
  • Untrusted servers without reviewing code
  • Skipping approval for project-scoped servers
Context Window Warning: Each MCP server consumes context for tool definitions. With many servers enabled, your effective context can shrink from 200K to ~70K tokens. Only enable what you need!
Security: Project-scoped servers (.mcp.json) require user approval before use. Enterprise admins can use managed-mcp.json for allowlists.

Section 8

Agents

Delegate Tasks to Specialized AI Workers

What are Agents?

Agents are specialized AI workers that Claude delegates tasks to via the Task tool.

How It Works:
1. Claude receives a complex task
2. Spawns a subagent with specific tools
3. Subagent works in isolated context
4. Returns summary to main conversation

Why Use Agents?

Cost Optimization
Use Haiku for simple searches, Opus for complex reasoning
Context Isolation
Verbose work doesn't bloat your main conversation
Parallel Execution
Multiple agents can work simultaneously

Built-in Agent Types

Claude Code includes 4 built-in subagent types optimized for different tasks.

AgentModelToolsBest For
ExploreHaikuRead-only (Glob, Grep, Read)File discovery, codebase exploration
PlanInheritsRead-onlyResearch phase before code changes
general-purposeInheritsAll toolsComplex multi-step tasks
BashInheritsTerminal executionRunning shell commands
Key insight: Built-in agents cannot spawn nested subagents (prevents infinite recursion).

Creating Custom Agents

Define custom agents using Markdown files with YAML frontmatter.

code-reviewer.md
--- name: code-reviewer description: Reviews code for quality tools: Read, Glob, Grep, Bash model: sonnet --- You are a code review specialist. Analyze code for: - Security vulnerabilities - Performance issues - Best practice violations

Agent Locations

Session--agents CLI flag
Project.claude/agents/
User~/.claude/agents/
Priority: Session → Project → User
Project agents can be committed to version control for team sharing.

Agent Configuration Options

FieldRequiredDescription
nameYesUnique identifier (lowercase, hyphens)
descriptionYesWhen Claude should delegate to this agent
toolsNoAllowed tools: Read, Edit, Bash, Grep, Glob...
disallowedToolsNoExplicitly denied tools
modelNohaiku, sonnet, opus, or inherit
permissionModeNodefault, acceptEdits, plan, bypassPermissions
hooksNoPreToolUse, PostToolUse, Stop lifecycle hooks
Read-only agent:
tools: Read, Grep, Glob
disallowedTools: Write, Edit
Full access agent:
permissionMode: bypassPermissions
Use with caution!

When to Use Agents vs Main Conversation

Use Agents When:

  • Verbose output — Tests, logs, large analysis
  • Tool restrictions needed — Read-only reviewer
  • Work is self-contained — Returns summary only
  • Cost matters — Use Haiku for exploration
  • Parallel work — Multiple independent tasks

Use Main Conversation When:

  • Frequent iteration — Back-and-forth refinement
  • Context sharing — Steps depend on each other
  • Quick changes — Small, targeted edits
  • Low latency — Immediate responses needed
Subagents have isolated context — their verbose work doesn't consume your main conversation's context window.

Parallel & Background Execution

Parallel Agents

Multiple agents can run simultaneously for independent tasks.

> Research auth, database, and API
modules in parallel

Starting 3 Explore agents...
├─ Agent 1: Analyzing auth/
├─ Agent 2: Analyzing database/
└─ Agent 3: Analyzing api/

Background Execution

Continue working while agents run in background.

Trigger background:
Ctrl+B during execution
• "Run this in the background"

Manage tasks:
/tasks — List active tasks
Ctrl+T — Toggle task view
Background agents pre-approve permissions. MCP tools not available in background mode.

Using Agents

Automatic Delegation

# Claude auto-delegates based on task
> Find all files that handle authentication

Using Explore agent (Haiku)...
Found 12 files in src/auth/

Explicit Agent Request

# Request specific agent
> Use code-reviewer agent to
check the auth module

Delegating to code-reviewer...
Found 3 issues...
Resume agents: "Continue that code review and now check authorization" — Agents retain full conversation history when resumed.

Real-World Agent Examples

Security Reviewer

model: opus
tools: Read, Grep, Glob
disallowedTools: Write, Edit

Read-only, uses Opus for thorough analysis. Cannot modify code.

Test Runner

model: haiku
tools: Bash, Read
permissionMode: acceptEdits

Fast Haiku model, runs tests in background, auto-accepts.

DB Query Validator

tools: Bash
hooks:
PreToolUse: validate-query.sh

Uses hook to validate queries are read-only before execution.

Pro tip: Create project-specific agents in .claude/agents/ and commit them to share with your team.

Section 9

Commands

Slash Commands & Custom Workflows

What are Commands?

Commands are shortcuts invoked with /command-name. Claude Code has two types:

Built-in Commands

Core CLI commands provided by Anthropic. Always available, no setup needed.

Examples:
/help, /clear, /compact, /cost, /model, /config

~30 built-in commands for session management, configuration, and info.

Custom Commands

User-created Markdown files that become slash commands. Reusable prompts for your workflows.

Examples:
/commit, /review-pr, /explain, /test-gen

Create your own or install from plugins/skills.

Key insight: Type /help to see all available commands in your current session.

Built-in Commands

Essential commands available in every Claude Code session.

Session Management

/clearClear conversation history, start fresh
/compactCompress context to save tokens
/resumeResume a previous session
/statusShow current session info

Information

/helpList all available commands
/costShow token usage and costs
/doctorDiagnose setup issues

Configuration

/configView/modify settings
/modelSwitch model (Haiku/Sonnet/Opus)
/permissionsManage tool permissions
/mcpManage MCP servers

Other

/initInitialize Claude Code in project
/loginAuthenticate with Anthropic
/logoutSign out of current session

Creating Custom Commands

Turn any prompt into a reusable slash command with a simple Markdown file.

File Location

Project scope (shared with team):
.claude/commands/my-command.md

Global scope (personal):
~/.claude/commands/my-command.md

The filename becomes your command: my-command.md/my-command

Using Arguments

$ARGUMENTS — All text after command
$1, $2 — Positional arguments

Simple Example

explain.md
Explain this code in simple terms, focusing on what it does and why. Be concise but thorough. Include: - Purpose of the code - Key functions/components - Any potential issues

Usage: /explain (while viewing a file)

Advanced Custom Commands

Use frontmatter to add metadata, tool permissions, and model selection.

commit.md
--- description: Create a git commit argument-hint: [commit message] allowed-tools: Bash(git:*) model: claude-3-5-haiku-20241022 --- # Context Current changes: !`git diff --staged` # Task Create a commit with message: $ARGUMENTS Follow conventional commit format. If no message provided, suggest one based on the staged changes.

Frontmatter Options

descriptionShown in /help
argument-hintUsage hint for arguments
allowed-toolsBash commands to allow
modelForce specific model

Special Syntax

!`command`Execute bash inline
@filepathInclude file contents
$ARGUMENTSUser input after /cmd
Pro tip: Use model: haiku for fast, cheap commands like commit messages.

Command Best Practices

Do This

  • Use project scope for team commands
    Commit .claude/commands/ to share with team
  • Add descriptions
    Makes /help output useful
  • Use Haiku for simple tasks
    Commit messages, quick lookups
  • Organize with subdirectories
    /git:commit, /git:status

Avoid This

  • Overly complex prompts
    Keep commands focused on one task
  • Hardcoded paths/secrets
    Use environment variables instead
  • Skipping allowed-tools
    Commands fail without proper permissions
Subdirectory Example:
.claude/commands/git/commit.md
→ Invoked as /project:git:commit
Start small: Create 2-3 commands for your most repetitive tasks. Expand as you learn what works.

Section 10

Skills

Portable AI Expertise Packages

What are Skills?

Skills are directories with a SKILL.md file that package reusable AI workflows. They're the evolution of slash commands.

Skills (New)

StorageDirectory with SKILL.md
InvocationAuto + user (/skill)
ContentsScripts, templates, resources
SubagentsYes (context: fork)
PlatformsWeb, Desktop, Code

Commands (Legacy)

StorageSingle .md file
InvocationUser only (/cmd)
ContentsPrompt text only
SubagentsNo
PlatformsClaude Code only
Key difference: Claude can auto-invoke skills based on your query — no need to type /skill.

Skill File Structure

A skill is a directory containing a required SKILL.md file plus optional resources.

Directory Layout

~/.claude/skills/ └── explain-code/ ├── SKILL.md # Required ├── examples/ # Optional ├── scripts/ # Optional └── templates/ # Optional
Locations:
~/.claude/skills/ — Global (personal)
.claude/skills/ — Project (shared)

SKILL.md Format

SKILL.md
--- name: explain-code description: Explains code in plain English user-invocable: true --- # Instructions When invoked: 1. Analyze the provided code 2. Explain step-by-step 3. Highlight potential issues

name creates /explain-code command

Creating a Skill

Let's create a practical skill that generates commit messages from staged changes.

~/.claude/skills/smart-commit/SKILL.md
--- name: smart-commit description: Generate conventional commit messages from staged git changes. Use when user asks to commit, create commit message, or stage changes. user-invocable: true --- # Smart Commit Generator ## Steps 1. Run `git diff --staged` to see changes 2. Analyze what was modified 3. Generate commit message following Conventional Commits format: - feat: new feature - fix: bug fix - docs: documentation - refactor: code refactoring ## Output Format ``` type(scope): short description - Bullet points for details - Keep under 72 chars per line ```

Frontmatter Fields

nameCommand name (/smart-commit)
descriptionTriggers auto-discovery by Claude
user-invocableAllow manual /name call
Auto-invoke Example:
User: "Help me commit these changes"
→ Claude sees "commit" matches description
→ Automatically loads smart-commit skill
Manual invoke:
/smart-commit

Advanced Skills: Subagents

Use context: fork to run skills in a subagent with isolated context.

deep-research/SKILL.md
--- name: deep-research description: Thoroughly research a topic across the codebase. Use for understanding architecture, finding patterns, or investigating how features work. context: fork agent: Explore --- # Deep Research Research $ARGUMENTS thoroughly: 1. Use Glob to find relevant files 2. Use Grep to search for patterns 3. Read and analyze the code 4. Create a summary with: - Key files involved - How components connect - Potential issues found Be thorough but concise.

Subagent Fields

context: forkRun in separate subagent
agent: ExploreUse Explore agent (read-only, Haiku)
agent: PlanUse Plan agent (research mode)
Why use subagents?
• Isolated context (doesn't bloat main conversation)
• Cheaper model (Explore uses Haiku)
• Returns summary only
$ARGUMENTS passes user input after skill name:
/deep-research authentication flow
→ $ARGUMENTS = "authentication flow"

Skill Best Practices

Do This

  • Write detailed descriptions
    Include trigger words Claude will match
  • Use context: fork for heavy tasks
    Research, analysis, multi-file exploration
  • Bundle related files
    Templates, examples, scripts in subdirectories
  • Share via project scope
    Commit .claude/skills/ for team

Avoid This

  • Vague descriptions
    Claude can't auto-invoke without clear triggers
  • Huge SKILL.md files
    Move details to separate files, reference them
  • Forgetting user-invocable
    Set to false only if truly internal
Skills vs Commands:
Use Skills for: Complex workflows, bundled resources, auto-invoke, subagents
Use Commands for: Simple prompts, quick one-liners
Description is key: Claude scans all skill descriptions to decide which to auto-load. Be specific about when your skill should trigger.

Section 11

Hooks

Event-Driven Automation

What are Hooks?

Hooks are shell commands that run automatically at specific lifecycle events in Claude Code.

Why Use Hooks?
Deterministic — No AI decision-making, always runs
Automated — Format code, validate inputs, log actions
Protective — Block dangerous commands before execution
Contextual — Inject information at session start
Common Use Cases:
• Auto-format files after Claude edits them
• Block rm -rf or other dangerous commands
• Send notification when Claude needs attention
• Log all tool executions for debugging

Lifecycle Flow

SessionStart → Session begins ↓ UserPromptSubmit → User sends message ↓ PreToolUse → Before tool runs ↓ [Tool Executes] ↓ PostToolUse → After tool completes ↓ Stop → Claude finishes response

Hook Event Types

Available events you can hook into.

Tool Events

PreToolUseBefore tool executes — can block or modify
PostToolUseAfter tool completes — format, log, validate

Session Events

SessionStartNew session begins — inject context
PreCompactBefore context compaction — save state
StopClaude finishes responding

User Events

UserPromptSubmitUser sends message — can block or add context
NotificationClaude needs attention — send alert

Subagent Events

SubagentStopSubagent completes its task
Tip: Use /hooks command in Claude Code to see all events and configure interactively.

Configuring Hooks

Hooks are configured in JSON settings files with matchers to filter which tools trigger them.

JSON Format

.claude/settings.json
{ "hooks": { "PostToolUse": [ { "matcher": "Edit|Write", "hooks": [ { "type": "command", "command": "prettier --write $CLAUDE_FILE_PATH" } ] } ] } }

Matchers (Tool Filters)

"*"All tools
"Bash"Exact match
"Edit|Write"Regex — Edit OR Write
"mcp__github"MCP server tools
""Events without tools

Settings Locations

~/.claude/settings.jsonGlobal (all projects)
.claude/settings.jsonProject (shareable)
.claude/settings.local.jsonProject (gitignored)

Creating a Hook Script

Hooks receive JSON via stdin and control execution via exit codes.

block-dangerous.sh
#!/bin/bash # Read JSON input from stdin INPUT=$(cat) # Extract the command being run COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command // empty') # Block dangerous commands if [[ "$COMMAND" =~ ^(rm -rf|dd|mkfs) ]]; then echo "Blocked: $COMMAND is dangerous" >&2 exit 2 # EXIT 2 = BLOCK fi # Allow execution exit 0 # EXIT 0 = PROCEED

Don't forget: chmod +x block-dangerous.sh

Exit Codes

exit 0 — Proceed
Tool executes normally. Stdout adds to context.
exit 2 — Block
Stops tool execution. Stderr shown as error.

Stdin JSON Contains

tool_nameName of the tool
tool_inputInput parameters
session_idCurrent session
Debug tip: Press Ctrl+O to see hook stderr logs.

Practical Hook Examples

Auto-Format on Save

"PostToolUse": [{
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "prettier --write $CLAUDE_FILE_PATH"
}]
}]

Runs Prettier after every file edit.

Desktop Notification

"Notification": [{
"matcher": "",
"hooks": [{
"type": "command",
"command": "osascript -e 'display notification \"Claude needs attention\"'"
}]
}]

macOS alert when Claude waits for input.

Log All Executions

"PostToolUse": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "echo \"$(date): $TOOL_NAME\" >> ~/.claude/tool.log"
}]
}]

Debug log of every tool execution.

Start simple: Begin with PostToolUse for formatting, then add PreToolUse for validation as you learn what to block.

Section 12

Memory & Context

CLAUDE.md Files & Context Management

How Memory Works

Claude Code uses CLAUDE.md files as its memory system — plain Markdown files read at every session start.

What CLAUDE.md Does

  • Project context — codebase conventions, tech stack
  • Preferences — coding style, patterns to follow
  • Instructions — workflows, do's and don'ts
  • Shortcuts — common commands, file locations

How It's Loaded

  • Read automatically at session start
  • Multiple files merged (hierarchy)
  • Content injected into system prompt
  • Persists across all sessions
Key benefit: Unlike chat history, CLAUDE.md content is never lost to context compaction — it's always reloaded fresh.

CLAUDE.md Structure

Use Markdown with clear sections. Claude reads this as instructions, not conversation.

# Project: My React App ## Tech Stack - React 18 + TypeScript - Tailwind CSS for styling - Zustand for state management ## Coding Conventions - Use functional components only - Prefer named exports over default exports - Keep components under 200 lines ## Important Commands - `npm run dev` — Start dev server - `npm run test` — Run Jest tests - `npm run lint` — ESLint check ## File Locations - Components: `src/components/` - API calls: `src/services/` - Types: `src/types/` ## Don't Do - Don't use class components - Don't commit console.log statements - Don't use any type

CLAUDE.md Locations

Claude Code reads CLAUDE.md from multiple locations, merged in priority order.

~/.claude/CLAUDE.md

Global — applies to ALL projects

  • Your personal preferences
  • Universal coding style
  • Common tool configs

/project/CLAUDE.md

Project root — team conventions

  • Commit to git
  • Team-wide standards
  • Project architecture

./CLAUDE.md

Current directory — local context

  • Subpackage rules
  • Module-specific patterns
  • Override parent settings
Merge order: Global → Project → Current directory. Later files can override earlier ones for specific rules.

Context Management

Claude Code has limited context window. These commands help manage it effectively.

/compact

Summarize conversation to free context space.

  • Creates summary of work done
  • Preserves key decisions
  • Frees ~70% of context
  • Use when context fills up
/compact "Focus on API changes"

/clear

Reset conversation completely.

  • Clears all context
  • Fresh start
  • CLAUDE.md still loaded
  • Use for new tasks
/clear

/cost

Check token usage and costs.

  • Shows tokens used
  • Context remaining
  • Session cost estimate
  • Model breakdown
/cost

Memory Best Practices

Do This

  • Keep CLAUDE.md concise — focus on what Claude needs to know
  • Use clear sections — ## headers for organization
  • Include examples — show preferred patterns
  • Document commands — build, test, lint scripts
  • Commit project CLAUDE.md — share with team
  • Run /compact proactively — before context fills

Avoid This

  • Don't dump entire docs — Claude has limited context
  • Don't repeat obvious rules — focus on project-specific
  • Don't include secrets — use .env, not CLAUDE.md
  • Don't make it too long — 200-500 lines max
  • Don't forget to update — stale rules cause confusion
  • Don't ignore /cost — track usage regularly
Pro tip: Use /init to generate a starter CLAUDE.md for any project. It analyzes your codebase and creates appropriate instructions.

Section 13

Token Optimization

Costs, Models & Context Management

Understanding Tokens & Costs

Tokens are the units Claude uses to process text. ~4 characters = 1 token.

What Consumes Tokens

  • Input tokens — your prompts, file contents, context
  • Output tokens — Claude's responses, code
  • System prompt — CLAUDE.md, tool definitions
  • MCP tools — each server adds tool schemas

Subscription Tiers

  • Pro — $20/month (standard limits)
  • Max 5x — $100/month (5× capacity)
  • Max 20x — $200/month (20× capacity)
  • Team — $150/user/month (includes Code)
Pro tip: Use /cost to see your current session's token usage and estimated cost at any time.

Model Comparison

Claude Code supports three model tiers. Choose based on task complexity.

Haiku

Fast & Affordable

  • Fastest response time
  • Lowest cost per token
  • 200K context window
  • Good for simple tasks
Best for: Search, simple edits

Sonnet

Balanced Default

  • Best quality/cost ratio
  • Strong coding ability
  • 200K context window
  • Default model
Best for: Most coding tasks

Opus

Maximum Intelligence

  • Highest reasoning ability
  • Best for complex problems
  • 200K context window
  • Most expensive
Best for: Architecture, security

Model Selection Matrix

Match the model to the task for optimal cost and quality.

Task TypeModelWhy
File exploration / grepHaikuFast, cheap, sufficient for search
Simple single-file editsHaikuStraightforward changes
Multi-file implementationSonnetBest balance of speed/quality
Code reviewSonnetCatches nuances, reasonable cost
Debugging complex issuesSonnetGood reasoning, cost-effective
Architecture designOpusDeep analysis required
Security analysisOpusCan't miss vulnerabilities
Complex refactoringOpusNeeds to understand full system
Use /model haiku for quick searches, then switch back with /model sonnet for implementation.

Context Window Management

All models have 200K token context window. Here's how to manage it effectively.

Key Commands

/contextShow context breakdown
/model [name]Switch model (haiku/sonnet/opus)
/costShow token usage & cost
/compactSummarize to free context
/clearReset conversation

What Fills Context

/context output:

System prompt: 8,500 tokens
MCP tools: 12,300 tokens
CLAUDE.md: 2,100 tokens
Conversation: 45,200 tokens
─────────────────────────
Total: 68,100 / 200,000
MCP impact: Each MCP server adds tool definitions to context. 20+ servers can consume 50K+ tokens, leaving only ~150K for your work.

Cost Optimization Best Practices

Do This

  • Use Haiku for exploration — file search, grep, quick lookups
  • Subagents for parallel work — isolated context, cheaper models
  • Keep files under 500 lines — less context per read
  • Load only needed MCPs — each server costs tokens
  • Run /compact proactively — before hitting limits
  • Check /cost regularly — stay aware of usage

Avoid This

  • Opus for simple searches — 10x more expensive than Haiku
  • 20+ MCP servers loaded — context shrinks drastically
  • Repeating context — don't re-paste what Claude knows
  • 2000+ line files — split into smaller modules
  • Ignoring context warnings — quality drops at limits
  • Never compacting — long sessions get expensive
80% cost reduction is achievable by using Haiku for search tasks and delegating to subagents with appropriate model selection.

Section 14

Best Practices

Workflows, Prompting & Pitfalls

The Effective Workflow

Follow this four-phase cycle for best results with Claude Code.

1. Explore

Use Plan Mode to read files and understand the codebase without making changes.

Enter Plan Mode

2. Plan

Ask Claude to outline the approach. Review and approve before coding.

"What's your plan?"

3. Code

Let Claude implement. Review each change before accepting.

Review diffs carefully

4. Verify

Run tests, check lint, manually verify. Then /clear for next task.

/clear
Key insight: Use /clear frequently between tasks. Fresh context = better results.

Prompting Best Practices

Effective Prompts

  • Be specific: "Fix the null check in UserService.getUser() line 45"
  • Provide context: "This is a React 18 app using Zustand for state"
  • Reference files: Use @filename for auto-reading
  • Ask for plan first: "What's your approach before you start?"
  • Use corrections: Press Escape to interrupt, edit history with double-Escape

Ineffective Prompts

  • "Fix the bug" — which bug? where?
  • "Make it better" — better how?
  • "Update the code" — what changes?
  • "Do what you think is best" — no guidance
  • Long rambling context — be concise
Pipe data in: cat error.log | claude "explain this error" — great for logs and stack traces.

Common Pitfalls

Jumping to code
Skipping exploration → wrong approach, wasted tokens
Vague prompts
"Fix the bug" → Claude guesses, often wrong
Not reviewing changes
Auto-accepting → bugs slip through
Context bloat
Never using /clear → quality degrades over time
Too many MCPs
20+ servers → context shrinks to ~70K usable
Overloaded CLAUDE.md
Too long → rules get ignored, prune ruthlessly

Working with Large Codebases

Strategies for scaling Claude Code to production codebases.

Git Worktrees for Parallel Work

$ git worktree add ../feature-auth feature-auth
$ git worktree add ../feature-api feature-api

# Open separate terminals
$ cd ../feature-auth && claude
$ cd ../feature-api && claude

Each worktree = separate Claude session with isolated context.

Subagents for Isolation

  • Delegate expensive tasks — security review, test generation
  • Use cheaper models — Haiku for search agents
  • Parallel execution — multiple agents at once
  • Fresh context each time — no history bloat
Tip: Break large tasks into smaller subtasks, each handled by a focused agent.

Best Practices Checklist

Setup (Do Once)

  • Create CLAUDE.md in project root
  • Configure only needed MCP servers
  • Set up hooks for formatting/linting
  • Add .claude/ to .gitignore (local settings)
  • Commit CLAUDE.md for team sharing

During Work (Every Session)

  • Start with exploration (Plan Mode)
  • Ask for plan before coding
  • Review every change before accepting
  • Run /clear between unrelated tasks
  • Check /cost periodically
  • Use /compact before context fills
Golden rule: Explore → Plan → Code → Verify → Clear. Repeat for each task.

Section 15

Real-World Workflow

Complete Feature Development with All Claude Code Features

Demo: JWT Authentication Feature

We'll build user authentication using every feature we've learned.

Requirements:
• User registration with email validation
• Login with secure password hashing
• JWT token generation
• Protected route middleware
Features We'll Use:
MCP: context7, Perplexity
Agents: Explore, Plan, subagents
Hooks: Auto-format with Prettier
Commands: /model, /cost, /compact, /clear
Workflow: Setup → Explore → Research → Plan → Code → Verify → Ship

Step 0: Project Setup

Configure CLAUDE.md, MCP servers, and hooks before starting.

CLAUDE.md (Project Root)

# Project: Auth API

## Tech Stack
- Node.js + Express + TypeScript
- bcrypt for password hashing
- jsonwebtoken for JWT

## Commands
- npm run dev - Start server
- npm test - Run Jest tests

## IMPORTANT
- Always hash passwords with bcrypt
- Never log tokens to console

MCP & Hooks Setup

$ claude mcp add context7
$ claude mcp add perplexity

# .claude/settings.json
"hooks": {
  "PostToolUse": [{
    "matcher": "Edit,Write",
    "hooks": [{
      "type": "command",
      "command": "prettier --write $FILE"
    }]
  }]
}

Features used: CLAUDE.md (Memory), MCP configuration, Hooks (auto-formatting)

Step 1: Explore (with Haiku)

Use Explore agent with Haiku model for fast, cheap codebase analysis.

$ claude

# Switch to Haiku for exploration (cheaper)
> /model haiku
Switched to claude-3-haiku

> Use Explore agent to understand our current auth setup.
   Check src/middleware/ and src/routes/ for existing patterns.

🔍 Explore agent analyzing...

Found:
• Existing middleware pattern in src/middleware/validate.ts
• Routes follow RESTful convention in src/routes/
• No auth middleware exists yet
• Using Express Router pattern

Features used: /model command (Haiku), Explore agent, context discovery

Step 2: Research (with MCP)

Use Perplexity MCP for best practices and context7 MCP for library docs.

> Use Perplexity to research JWT best practices for Node.js in 2026.
   What's the recommended approach for refresh tokens?

🔍 Querying Perplexity MCP...

Research findings:
• Store refresh tokens in httpOnly cookies (not localStorage)
• Use short expiry for access tokens (15min)
• Implement token rotation on refresh

> Use context7 to get the jsonwebtoken library API docs.

📚 Fetching from context7...
jwt.sign(payload, secret, options)
jwt.verify(token, secret, options)

Features used: Perplexity MCP (research), context7 MCP (docs)

Step 3: Plan (with Plan Agent)

Use Plan agent to design implementation. Switch back to Sonnet for quality.

> /model sonnet
Switched to claude-3-sonnet

> Enter Plan Mode and design the auth implementation.

📋 Plan Mode - Designing implementation...

Implementation Plan:
1. AuthService - hashPassword(), verifyPassword(), generateTokens()
2. AuthController - register(), login(), refresh()
3. AuthMiddleware - verifyToken() for protected routes
4. Routes - POST /register, POST /login, POST /refresh
5. Tests - Unit tests for AuthService

Files to create: 4 | Files to modify: 1

> Looks good, proceed with implementation.

Features used: /model command (Sonnet), Plan agent, explicit approval before coding

Step 4: Code (with Subagents)

Delegate testing to a subagent. Hooks auto-format every file written.

Main Implementation

> Implement the AuthService first.

✓ Created src/services/auth.service.ts
🎨 Hook: prettier --write executed

✓ Created src/middleware/auth.middleware.ts
🎨 Hook: prettier --write executed

> Delegate test writing to a subagent
   using Haiku model.

🤖 Spawning test-writer subagent (Haiku)...

Subagent (Parallel)

[Subagent: test-writer]

Writing tests for AuthService...

✓ auth.service.test.ts created
  • hashPassword() - 3 tests
  • verifyPassword() - 2 tests
  • generateTokens() - 4 tests

Subagent completed.
Cost: $0.02 (Haiku)

Features used: Subagents (parallel, Haiku model), Hooks (auto-formatting), cost efficiency

Step 5: Verify & Ship

Run tests, check costs with /cost, commit, then /clear for next task.

> Run npm test and verify everything passes.

✓ 9 tests passed (auth.service.test.ts)
✓ ESLint: No errors
✓ TypeScript: No errors

> /cost
Session: 45,200 tokens | Cost: $0.18 | Context: 68K/200K

> Commit these changes with message "feat(auth): add JWT authentication"

✓ Committed: feat(auth): add JWT authentication

> /clear
Context cleared. Ready for next task.

Features used: /cost (token tracking), Git integration, /clear (fresh context for next task)

Workflow Recap: All Features Used

Setup

  • CLAUDE.md — project context
  • MCP servers — context7, Perplexity
  • Hooks — auto-format with Prettier

Explore & Plan

  • /model haiku — cheap exploration
  • Explore agent — codebase analysis
  • Plan agent — design approach

Code & Ship

  • Subagents — parallel test writing
  • /cost — track spending
  • /clear — reset for next task
The cycle: Setup once → Explore (Haiku) → Research (MCP) → Plan (Sonnet) → Code (Subagents + Hooks) → Verify → Ship → /clear → Repeat

Section 16

Summary

Key Takeaways & Next Steps

Key Takeaways

AI Evolution

LLMs: 4K→200K+ context, autocomplete→agentic workflows

Claude Code

Terminal-first AI coding assistant by Anthropic

MCP

Connect Claude to external tools: context7, Perplexity, databases

Agents

Explore, Plan, Bash + custom agents with model selection

Memory

CLAUDE.md files, /compact, /clear for context management

Workflow

Explore → Plan → Code → Verify → Clear

What You Learned

Setup & Memory

  • CLAUDE.md for project context
  • MCP servers for tools
  • Hooks for automation

Commands & Skills

  • Built-in: /help, /clear, /cost
  • Custom commands in .claude/
  • Skills with SKILL.md

Optimization

  • Haiku for exploration
  • Sonnet for implementation
  • Subagents for parallel work

Resources

Getting Help
Run /help or /doctor in Claude Code

Thank You!

Questions?

Get started with Claude Code:

curl -fsSL https://claude.ai/install.sh | bash

Presentation by Mikul Gohil