Welcome 0% Complete

Become a Top 10% Claude Code User

A comprehensive, hands-on training program for knowledge workers who want to master Claude Code for real business impact -- no coding background required.

9 Progressive Modules

From foundations to advanced agent teams, with quizzes and hands-on exercises throughout.

Business-First Examples

Every module includes real-world examples: dashboards, data analysis, reports, automation, and more.

Expert Insights

Learn from Boris Cherny (Claude Code creator), Nate B. Jones, and other top practitioners.

Track Your Progress

Mark sections complete, take quizzes, and earn your certificate of completion.

Version History

Version Date Changes
v2.1 2026-03-07 Fact-check & R code review. Fixed: hook event count (19→16), outdated Opus 4.5 model reference, Nate Jones cost figure ($0.15→$0.10) and clarified case study attribution, replaced unverified /agents command with /config, removed unverified Ctrl+\ and Ctrl+S shortcuts, corrected # shortcut description, softened unverifiable 30-50% cost claim. R code: added missing library(scales) import, removed unused metric_col parameter.
v2.0 2026-03-07 Rebranded from supply-chain-specific to general knowledge worker audience. Replaced all domain-specific examples with broadly applicable business scenarios. Updated exercises, R code samples, dashboard examples, and certificate text. Added version history.
v1.2 2026-03-07 Content audit: added dedicated teaching sections for "Compounding Engineering" and the "2-Correction Rule" to ensure all quiz topics are covered in preceding material.
v1.1 2026-03-07 Fixed layout rendering bug (CSS grid + fixed sidebar double-offset). Sidebar now uses position:fixed with margin-left on main content.
v1.0 2026-03-07 Initial release. 9 modules covering Claude Code fundamentals through advanced features. Interactive quizzes, progress tracking, expert profiles, 30 actionable tips, final assessment, and printable certificate.
Module 1

Foundations Refresher

Intermediate ~15 min

Quick refresher on everything Claude Code can do, all the environments it runs in, and the key commands and shortcuts you should know cold.

What Claude Code Can Do

Claude Code is not just a code autocompleter. It's a full-featured agentic coding assistant that reads your entire codebase, runs terminal commands, searches across files, creates commits, opens PRs, and iterates on its own work. Think of it as a senior developer that works alongside you in the terminal.

Key capabilities at a glance:

  • Read & edit files across your entire project simultaneously
  • Run terminal commands -- build, test, deploy, analyze data
  • Search code with grep and glob patterns for instant navigation
  • Create git commits and PRs with descriptive messages
  • Self-verify by running tests, comparing screenshots, checking outputs
  • Work in parallel via multiple sessions, subagents, and agent teams
  • Connect to external tools through MCP (databases, APIs, Slack, Jira)
  • Build entire applications from natural language descriptions
Business Angle

Claude Code can build interactive dashboards, analyze CSV/Excel data, automate scripts, generate reports, and create entire applications -- all from conversational prompts. You don't need to be a developer to use it effectively.

Execution Environments

Claude Code runs everywhere. Choose the environment that fits your workflow:

EnvironmentBest ForKey Feature
Terminal CLIFull power, scripting, automationComplete feature set, pipes, background tasks
VS Code ExtensionEditing with inline diffsSide-by-side diff review, multiple conversations
JetBrains IDEsIntelliJ/PyCharm/WebStorm usersInteractive diff viewing, IDE integration
Desktop AppVisual diff review, multi-sessionStandalone app, multiple parallel sessions
Web (claude.ai/code)Remote work, long-running tasksCloud execution, no local setup needed
MobileQuick checks, voice promptsMonitor & steer sessions on the go
Pro Tip

You can start a task locally and continue on the web with /teleport, or run 5+ sessions in parallel on claude.ai/code while keeping your terminal focused on implementation.

Slash Commands Reference

These are the commands you type directly in the Claude Code input. Master these to navigate faster:

CommandWhat It DoesWhen to Use
/helpShow documentation and helpWhen you need guidance
/clearReset conversation contextBetween unrelated tasks
/compactCompress conversation historyContext getting large (70%+)
/rewindUndo changes and restore stateClaude went wrong direction
/initInitialize CLAUDE.md for projectNew project setup
/memoryView/edit CLAUDE.md and auto memoryReview project instructions
/costShow token usage and costsMonitor spending
/doctorDiagnose configuration issuesSomething isn't working
/permissionsConfigure tool accessPre-approve common commands
/modelSwitch AI modelChange between Opus/Sonnet/Haiku
/statusShow session informationCheck current state
/mcpManage MCP server connectionsConnect databases, APIs, tools
/hooksManage automation hooksSet up auto-formatting, guards
/vimToggle vim keybindingsVim users
/sandboxEnable OS-level isolationRunning untrusted code safely
/configOpen settings interfaceAdjust permissions, model, preferences
/renameName your sessionOrganizing multiple sessions
/contextView context window usageMonitoring token consumption
/simplifyReview and refactor changed codeAfter implementation, cleanup pass
/batchLarge-scale parallel changesMigrations, bulk refactoring

Keyboard Shortcuts

Speed up your workflow with these essential shortcuts:

ShortcutAction
EscapeStop Claude mid-response
Shift+TabCycle permission modes
Ctrl+CCancel current operation
Ctrl+DExit Claude Code
Ctrl+ROpen history search
Ctrl+TToggle task list
Ctrl+BBackground current task
Ctrl+GOpen in external editor
Ctrl+V / Alt+VPaste image
Cmd+POpen model picker
Cmd+TToggle extended thinking
@Reference a file
#Quick memory note
!Run a bash command inline
Pro Tip

Customize all keybindings by editing ~/.claude/keybindings.json. You can even create chord shortcuts (e.g., Ctrl+K Ctrl+S).

Knowledge Check

Which command should you use between unrelated tasks to prevent context pollution?

Explanation: /clear resets the conversation context entirely, giving you a fresh start. /compact compresses but keeps context. /rewind undoes the last action.

Knowledge Check

What keyboard shortcut stops Claude mid-response if it's going in the wrong direction?

Explanation: Escape stops Claude mid-response. Ctrl+C cancels the current operation entirely, while Ctrl+D exits Claude Code.
Module 2

Mastering CLAUDE.md & Memory

Intermediate~20 min

Configure Claude Code to understand your project, your team's conventions, and your personal preferences through the CLAUDE.md hierarchy and auto memory system.

The CLAUDE.md Hierarchy

CLAUDE.md files are persistent instructions that Claude Code reads at the start of every session. They work like a "briefing document" for your AI assistant. Multiple levels exist, and they cascade from highest to lowest priority:

Managed Policy (IT/Admin controlled)
Project CLAUDE.md (in repo root, shared with team)
User CLAUDE.md (~/.claude/CLAUDE.md, all your projects)
Local CLAUDE.local.md (personal, not committed)
.claude/rules/ (path-scoped modular rules)

Each level has a purpose:

  • Managed Policy -- Enterprise-level rules enforced by IT (e.g., /Library/Application Support/ClaudeCode/CLAUDE.md on macOS)
  • Project CLAUDE.md -- Checked into git, shared with your team. Contains build commands, coding standards, and project-specific instructions.
  • User CLAUDE.md -- Your personal preferences that apply across all projects. Style preferences, preferred tools, etc.
  • Local CLAUDE.local.md -- Personal overrides for a specific project. Not version controlled.
  • .claude/rules/ -- Modular rules that activate only for matching file paths.

What to Put in CLAUDE.md

Keep your CLAUDE.md under 200 lines. It loads into context every session, so every line costs tokens. Focus on things Claude can't guess:

  • Build/test commands -- Rscript run_tests.R, npm run build
  • Coding conventions that differ from defaults -- "Use tidyverse style, pipe with |>"
  • Repository etiquette -- branch naming, PR conventions, commit message format
  • Architectural decisions -- "We use data.table for performance-critical operations"
  • Common gotchas -- "The forecast column is actually demand, not projections"
markdown
# Business Analytics Project

## Build & Test
- Run analysis: `Rscript src/main.R` or `python src/main.py`
- Run tests: `Rscript -e "testthat::test_dir('tests')"`
- Generate report: `quarto render reports/monthly.qmd`

## Conventions
- Use tidyverse style for R (snake_case, |> pipe)
- All dates in ISO 8601 format (YYYY-MM-DD)
- CSV files go in data/raw/, processed data in data/clean/
- Visualizations: ggplot2 with our custom theme (R/theme_company.R)

## Architecture
- data/ -- raw and processed data files
- R/ -- reusable functions and utilities
- src/ -- main analysis scripts
- reports/ -- Quarto reports
- tests/ -- testthat test files

## Important
- Never commit files in data/raw/ (may contain sensitive client data)
- The "revenue" column is in USD cents, not dollars
- Always validate results against source data in data/clean/actuals.csv

Compounding Engineering: A Best Practice from Boris Cherny

Boris Cherny, the creator of Claude Code, calls his team's approach to CLAUDE.md "Compounding Engineering". The idea: your team's institutional knowledge should grow with every PR. His team updates their CLAUDE.md multiple times per week by tagging PR review findings with @.claude. A GitHub Action then adds those learnings directly to the project's CLAUDE.md.

Over time, CLAUDE.md becomes a living document that captures every mistake, every convention, and every architectural decision. Each session, Claude starts smarter because of everything the team has learned before. This compounding effect is what separates teams that get steadily better results from those that keep fighting the same issues.

Pro Tip

Start your own Compounding Engineering practice: after every significant PR or debugging session, add one learning to your CLAUDE.md. Even solo developers benefit -- your future self will thank you.

Modular Rules with .claude/rules/

For path-specific instructions, create files in .claude/rules/ with frontmatter that specifies which file paths they apply to:

markdown
---
paths:
  - "R/**/*.R"
  - "src/**/*.R"
---
# R Code Rules
- Use tidyverse conventions (snake_case, |> pipe operator)
- All functions must have roxygen2 documentation
- Use stopifnot() for input validation
- Prefer purrr::map() over base lapply()
markdown
---
paths:
  - "reports/**/*.qmd"
  - "reports/**/*.Rmd"
---
# Report Rules
- Use professional tone, no jargon
- Include executive summary at top
- All charts must have titles, axis labels, and source notes
- Tables must be formatted with kableExtra

Rules files load only when Claude is working on matching paths, keeping context lean and relevant.

Auto Memory System

Claude Code automatically accumulates learnings across sessions. These are stored at ~/.claude/projects/<project>/memory/ as plain Markdown files.

  • MEMORY.md -- First 200 lines load every session. Keep it concise.
  • Topic files (e.g., debugging.md, patterns.md) -- Loaded on demand when relevant.
  • Manage with /memory command -- view, edit, or clear memories.
  • Toggle with autoMemoryEnabled setting.

What gets remembered automatically:

  • Build commands that work (and ones that don't)
  • Debugging insights you teach Claude
  • Code patterns and preferences confirmed across sessions
  • File locations Claude frequently needs
Watch Out

Auto memory can accumulate stale entries. Periodically review with /memory and clean out anything outdated. If Claude keeps making the same mistake, check whether a wrong memory is causing it.

Import Syntax and Organization

Use @path/to/file in your CLAUDE.md to include content from other files. This lets you keep the main CLAUDE.md lean while referencing detailed documentation:

markdown
# Project Instructions
@.claude/rules/r-conventions.md
@.claude/rules/data-pipeline.md
@docs/architecture-overview.md

Organization strategy:

  • Main CLAUDE.md: <200 lines -- high-level overview and critical rules
  • Move detailed instructions to .claude/rules/ or skill files
  • Use @imports for reference material that doesn't change often
  • Keep frequently-changing instructions in the main file

Exercise: Draft Your CLAUDE.md

Hands-On Exercise

Write a CLAUDE.md for a data analytics project in your domain. Include:

  1. Build/test commands for an R project
  2. Data conventions (file locations, date formats, column naming)
  3. At least 3 coding conventions specific to your workflow
  4. One "gotcha" that Claude needs to know about
  5. An architecture overview of your project structure

Hint: Start with claude /init to auto-generate a starting point, then customize it with your domain knowledge.

Knowledge Check

What is the recommended maximum length for a project CLAUDE.md file?

Explanation: Keep CLAUDE.md under 200 lines. It loads every session, so each line costs tokens. Move detailed reference material to .claude/rules/ or skills.

Knowledge Check

Where should you put path-specific instructions that only apply to R files?

Explanation: The .claude/rules/ directory supports frontmatter with paths: globs. Rules only load when Claude works on matching files, keeping context lean.

Knowledge Check

What does Boris Cherny call the practice of continuously adding PR review learnings to CLAUDE.md?

Explanation: Boris Cherny calls this "Compounding Engineering" -- the team's institutional knowledge grows with every PR as learnings are captured back into CLAUDE.md.
Module 3

Prompt Engineering for Claude Code

Intermediate~25 min

Master the art of communicating with Claude Code: be specific, provide context, course-correct, and chain complex tasks together.

Being Specific: The #1 Skill

Vague prompts produce vague results. Specific prompts produce specific, correct results. Here's the difference:

Bad Prompt

"Fix the data loading code"

Great Prompt

"In R/load_data.R, the read_csv() call on line 23 fails when the supplier CSV has empty date columns. Add na = c('', 'NA', 'N/A') to handle missing dates, and add a validation check that stops with a clear error if required columns (supplier_id, lead_time, quantity) are missing."

What makes a prompt specific:

  • File paths -- Tell Claude exactly where to look: @R/forecast.R
  • Constraints -- "Use only tidyverse functions", "Keep under 50 lines"
  • Verification criteria -- "The test in tests/test_forecast.R should pass"
  • Expected behavior -- "Should return a tibble with columns: date, forecast, lower_95, upper_95"
Pro Tip

A well-structured prompt has three parts: Context (what exists), Objective (what you want), and Constraints (boundaries and verification). This structure reduces back-and-forth by 50%.

The Explore → Plan → Implement → Commit Workflow

This is Anthropic's recommended 4-phase workflow for complex tasks. It's how Boris Cherny's team writes production code:

1
Explore

Use Plan Mode (Shift+Tab) to read files without changes

2
Plan

Ask Claude for a detailed implementation plan, iterate until satisfied

3
Implement

Switch to auto-accept mode, Claude executes the plan

4
Commit

Review changes, create PR with descriptive message

bash
# Phase 1: Explore (Plan Mode)
# Press Shift+Tab to enter Plan Mode
# "Read the files in R/forecast/ and explain the current forecasting approach"

# Phase 2: Plan
# "Create a detailed plan to add ARIMA forecasting alongside the existing
#  exponential smoothing. Show me what files to create and modify."

# Phase 3: Implement (switch to auto-accept)
# Press Shift+Tab to switch to acceptEdits mode
# "Implement the plan. Run the tests after each major change."

# Phase 4: Commit
# "Create a commit with a descriptive message explaining the ARIMA addition"
Business Angle

For a quarterly business review, Phase 1 lets you explore existing data and reports, Phase 2 helps design the analysis approach, Phase 3 builds the dashboards and visualizations, and Phase 4 commits everything for your team.

Providing Rich Context

Claude Code can ingest context from multiple sources. The more relevant context you provide, the better the output:

MethodSyntaxBest For
File references@path/to/file.RPoint Claude to specific files
ImagesCtrl+V to pasteScreenshots of dashboards, error dialogs
URLsPaste URL directlyDocumentation, API references
Piped datacat data.csv | claudeSmall datasets for analysis
Shell output! prefix in promptDynamic context from commands
bash
# Pipe data for analysis
cat data/clean/inventory_levels.csv | claude "Analyze this inventory data. \
Find items below safety stock and suggest reorder quantities."

# Reference multiple files
# In the Claude Code prompt:
# "Using @R/forecast.R and @R/inventory.R, create a combined
#  demand-forecast-to-reorder-point pipeline"

# Use shell output as context
# "The output of !Rscript -e 'sessionInfo()' shows my R setup.
#  Install any missing packages needed for time series analysis."

Course-Correcting

When Claude goes in the wrong direction, you have three escalating options:

ActionWhen to UseWhat Happens
EscapeClaude is mid-response, going wrongStops generation, you can redirect
/rewindClaude made changes you don't wantUndoes file changes and restores conversation state
/clearAfter 2+ failed correctionsFull context reset, start fresh with better prompt

The 2-Correction Rule

This is one of the most important habits to develop: if you've corrected Claude twice and it's still not producing the right result, stop correcting and use /clear. Write a completely fresh prompt from scratch with all the context included upfront.

Why does this work? When you keep correcting within the same conversation, the accumulated wrong context -- failed attempts, misunderstandings, dead-end approaches -- pollutes the context window. Claude tries to reconcile all of it, which often makes things worse. A clean prompt with clear instructions will almost always outperform a long chain of corrections.

Think of it like giving directions: if someone has already taken two wrong turns, it's often faster to say "go back to the start and take Main Street" than to try to navigate from wherever they ended up.

Watch Out

This applies to all Claude Code interactions, not just coding. If you're generating a report and the second revision still isn't right, /clear and write a more specific prompt rather than continuing to tweak.

Prompt Chaining: Decomposing Complex Tasks

Don't ask Claude to do everything at once. Break complex tasks into a chain of focused prompts:

markdown
# Chain 1: Data Understanding
"Read data/raw/purchase_orders.csv and describe the schema,
data quality issues, and date range."

# Chain 2: Data Cleaning
"Based on your analysis, write an R script that cleans this data:
handle missing values, standardize date formats, remove duplicates."

# Chain 3: Analysis
"Using the cleaned data, calculate: average lead time by supplier,
on-time delivery rate, and order fill rate."

# Chain 4: Visualization
"Create a ggplot2 dashboard with 4 charts showing these KPIs.
Use our custom theme from @R/theme_report.R"

# Chain 5: Report
"Generate a Quarto report combining the analysis and visualizations
with executive summary and recommendations."

Each step builds on the previous output, and Claude can verify each step before moving on. If step 3 goes wrong, you only need to redo steps 3-5, not start over.

Context Window Management

Your context window is the fundamental constraint. As it fills, Claude's performance degrades. Manage it aggressively:

  • /clear between unrelated tasks -- the most important habit
  • /compact proactively at ~70% context usage -- don't wait for auto-compaction
  • Subagents for exploration -- "Use a subagent to investigate how the authentication module works." The subagent uses its own context window and returns a summary.
  • Custom /statusline to display context usage so you always know where you stand
bash
# Check context usage
/context

# Compact when getting large
/compact

# Delegate research to keep main context clean
"Use an Explore subagent to find all files that read from the
 inventory database and summarize the patterns used."
Pro Tip

Context management is what separates good Claude Code users from great ones. Top users treat /clear like saving a file -- they do it constantly, between every distinct task.

Exercise: Rewrite Bad Prompts

Hands-On Exercise

Rewrite each bad prompt into a great one using the techniques from this module:

Bad Prompt 1: "Make a chart of our sales data"

Bad Prompt 2: "The forecast is wrong, fix it"

Bad Prompt 3: "Set up the project"

Hint: For each, include: file paths, specific columns/data, expected output format, constraints, and verification criteria.

Knowledge Check

What are the four phases of Anthropic's recommended workflow?

Explanation: Explore (read-only in Plan Mode) → Plan (iterate on approach) → Implement (auto-accept, execute plan) → Commit (review and create PR).

Knowledge Check

What should you do after correcting Claude twice with no improvement?

Explanation: After two failed corrections, /clear and start fresh. Accumulated wrong context degrades Claude's performance. A well-crafted fresh prompt will outperform continued corrections.

Knowledge Check

Why should you delegate exploration to subagents?

Explanation: Subagents run in separate context windows. They explore and return a summary, keeping your main context focused on implementation. This is one of the most powerful context management techniques.

Knowledge Check

What three parts should every well-structured prompt include?

Explanation: Context (what exists), Objective (what you want), and Constraints (boundaries and verification criteria). This structure reduces the number of exchanges needed by about 50%.
Module 4

Business Workflows

Intermediate~25 min

Use Claude Code for dashboards, data analysis, reporting, forecasting, and everyday business tasks -- no coding background needed.

Creating HTML Dashboards

One of Claude Code's most powerful business applications is generating self-contained interactive HTML dashboards. No server needed -- just a single file that opens in any browser.

markdown
# Example Dashboard Prompt

Create a self-contained HTML dashboard for business KPIs.
Use Chart.js (CDN) for visualizations.

Data source: @data/clean/monthly_metrics.csv

Include these sections:
1. Header with date range and key metrics (revenue, margin, customer count)
2. Line chart: Monthly revenue trend (last 12 months)
3. Bar chart: Revenue by region or department (top 10)
4. Gauge chart: Current quarterly target progress vs goal
5. Table: Key accounts with status indicators and action items

Design: Professional, dark sidebar navigation, responsive layout.
Color scheme: Blue/slate corporate theme.
Include filters for date range and department.
Save as dashboards/business-kpi.html

Claude Code will create a complete, working dashboard in a single file. The key pattern: describe what you want to see, provide the data, specify the output format.

Pro Tip

Before creating a dashboard, decide the main decision it should support. "Which region needs more investment?" or "Where are we losing margin?" Frame your charts around that decision.

Data Analysis on CSV/Excel Files

Claude Code can directly analyze your data files. For CSV files, pipe them or reference them with @:

bash
# Quick analysis with piped data
cat data/raw/sales_data.csv | claude "Analyze this sales data. \
Show me: top 5 products by revenue, average deal size by region, \
and identify any transactions with unusual amounts (>3 std dev from mean)."

# In-session reference
# "Read @data/raw/customer_data.csv and create a summary report:
#  - Total customers by segment (enterprise/mid-market/SMB)
#  - Average lifetime value by acquisition channel
#  - Churn rate by cohort
#  - Save the analysis as an R script in R/customer_analysis.R"

For Excel files, Claude Code can use R's readxl package or Python's openpyxl to read multi-sheet workbooks.

Report Generation & Content Creation

Automate recurring reports by teaching Claude Code your report format once:

markdown
# Report Generation Prompt

Generate the weekly business performance report using:
- Data: @data/clean/weekly_metrics.csv
- Template: @reports/templates/weekly_template.qmd
- Previous report: @reports/2026-W09.html (for comparison)

Structure:
1. Executive Summary (3-4 bullet points, highlight changes from last week)
2. KPI Dashboard (revenue, conversion rate, margin, customer satisfaction)
3. Team Performance (top/bottom 5 teams by goal attainment)
4. Risk Alerts (metrics trending below target, accounts at risk of churn)
5. Recommendations (2-3 actionable items)

Tone: Professional, data-driven, concise. Audience: VP / Department Head.
Render to reports/2026-W10.html

Forecasting Models

Claude Code can build and run forecasting models for revenue projections, headcount planning, budget forecasting, and trend analysis:

markdown
# Forecasting Prompt

Using @data/clean/monthly_revenue.csv (columns: date, segment, revenue):

1. For each segment, fit three models: ETS, ARIMA, and Prophet
2. Use last 3 months as holdout for validation
3. Select best model per segment by MAPE
4. Generate 12-month forecasts with 80% and 95% prediction intervals
5. Create a summary table: segment, best_model, MAPE, next_quarter_forecast
6. Visualize top segments with forecast bands
7. Flag any segments where all models have MAPE > 30% (needs manual review)

Save R script to R/revenue_forecast.R
Save forecasts to data/output/forecasts_12month.csv
Business Angle

Always include prediction intervals in forecasts -- point forecasts alone don't support good decisions. The width of the interval tells leadership how much uncertainty exists and helps size contingency budgets.

Risk Analysis

Build risk assessment tools with Claude Code for business risk management:

markdown
# Risk Analysis Prompt

Create a business risk analysis tool in R:

1. Risk Matrix: Plot likelihood vs impact for risks in @data/risk_register.csv
   - Color code by risk category (financial, operational, market, regulatory)
   - Label high-risk items (likelihood * impact > 15)

2. Monte Carlo Simulation: For our revenue model in @data/clean/revenue_drivers.csv
   - Simulate 10,000 scenarios varying key assumptions (+/- 20%)
   - Calculate probability of missing quarterly target
   - Show P10, P50, P90 revenue outcomes

3. Concentration Analysis: Using @data/client_revenue.csv
   - Identify revenue concentration risk (top 10 clients as % of total)
   - Calculate revenue at risk if any top-5 client churns

Output: Interactive HTML report with all three analyses.
Save to reports/risk_analysis.html

Working with Data Pipelines

Claude Code excels at building ETL (Extract, Transform, Load) pipelines for business data:

bash
# Build a data pipeline
# "Create an R script that:
#  1. Reads all CSV files from data/raw/monthly_exports/
#  2. Standardizes column names (snake_case)
#  3. Converts all dates to ISO 8601
#  4. Validates: no negative amounts, no future dates
#  5. Deduplicates by transaction_id
#  6. Joins with @data/reference/departments.csv for department names
#  7. Writes cleaned output to data/clean/transactions_combined.csv
#  8. Logs summary stats: rows processed, rows rejected, date range
#  Save as R/etl_transactions.R"
Pro Tip

Give Claude Code a verification step: "After building the pipeline, run it on the test data in data/test/ and compare output row counts with the expected values in data/test/expected_counts.csv." This catches errors before production.

Exercise: Create a Business Dashboard Prompt

Hands-On Exercise

Write a complete prompt that would generate a KPI dashboard for your team or organization. Include:

  1. The specific decision the dashboard supports
  2. At least 4 KPI metrics with targets
  3. 3+ chart types (line, bar, gauge, table, etc.)
  4. Filters (date range, location, product category)
  5. Data source reference and output location
  6. Design specifications (colors, layout, responsive)

Hint: Start with "What decision does my audience need to make?" and work backwards to the data and charts that support it.

Knowledge Check

What's the key pattern for getting Claude Code to create effective dashboards?

Explanation: The pattern is: describe what you want to see (charts, metrics, layout), provide the data source, and specify the output format (self-contained HTML). Claude handles the implementation.

Knowledge Check

Why should business forecasts always include prediction intervals?

Explanation: Point forecasts alone don't support good decisions. Prediction intervals quantify uncertainty, helping leadership understand risk and size contingency budgets appropriately.

Knowledge Check

What should you include in a data pipeline prompt to catch errors before production?

Explanation: Giving Claude a verification step -- test data with known expected outputs -- lets it self-check the pipeline. This "verification criteria" principle is the single highest-leverage technique in Claude Code.
Module 5

R Programming with Claude Code

Intermediate~25 min

Leverage Claude Code for R-based data analytics: tidyverse, ggplot2, forecasting, optimization, and report automation.

Setting Up Claude Code for R

Configure your CLAUDE.md with R-specific instructions so Claude writes idiomatic R code from the start:

markdown
# R Project Configuration (for CLAUDE.md)

## R Environment
- R version: 4.4+ with Rscript at /usr/local/bin/Rscript
- Package manager: renv (run renv::restore() if packages missing)
- Run scripts: Rscript src/main.R
- Run tests: Rscript -e "testthat::test_dir('tests')"

## R Conventions
- Use tidyverse style: snake_case, |> pipe (not %>%)
- Prefer tibble over data.frame
- Use readr::read_csv() not base read.csv()
- Visualization: ggplot2 with theme_minimal() as base
- Dates: lubridate for all date manipulation
- Strings: stringr for all string operations

## Package Preferences
- Data manipulation: dplyr, tidyr, purrr
- Time series: forecast, tsibble, fable
- Optimization: lpSolve, ompr
- Reporting: quarto, kableExtra for tables
- Interactive: plotly for dashboards, DT for tables
Pro Tip

Specify |> vs %>% in your CLAUDE.md. Claude defaults to the base pipe |> in modern R, but if your team uses magrittr's %>%, state it explicitly.

Business Calculations & Optimization in R

Claude Code can build calculation engines and optimization models for resource allocation, budgeting, and scenario analysis:

r
# ROI and Break-Even Analysis with Claude Code
# Prompt: "Write R functions for ROI calculation and break-even analysis"

library(tidyverse)

calculate_roi <- function(investment, returns_monthly, months, discount_rate = 0.08) {
  # Simple ROI
  total_return <- sum(returns_monthly[1:min(months, length(returns_monthly))])
  simple_roi <- (total_return - investment) / investment

  # Net Present Value
  monthly_rate <- discount_rate / 12
  npv <- -investment + sum(returns_monthly / (1 + monthly_rate)^seq_along(returns_monthly))

  # Payback period (months)
  cumulative <- cumsum(returns_monthly)
  payback <- which(cumulative >= investment)[1]

  tibble(simple_roi = simple_roi, npv = npv, payback_months = payback)
}

# Scenario comparison
compare_scenarios <- function(scenarios_df, weight_col = NULL) {
  # Weighted scoring model for decision analysis
  if (is.null(weight_col)) {
    scenarios_df |> mutate(score = rowMeans(across(where(is.numeric))))
  } else {
    scenarios_df |> mutate(
      weighted_score = rowSums(across(where(is.numeric)) * .data[[weight_col]])
    )
  }
}

Data Transformation with dplyr/tidyr

Claude Code writes fluent tidyverse pipelines. Give it your data structure and desired output:

r
# Prompt: "Transform sales data into a team performance scorecard"

library(tidyverse)
library(lubridate)
library(scales)

team_scorecard <- read_csv("data/clean/sales_activity.csv") |>
  filter(activity_date >= today() - months(6)) |>
  group_by(team_id, team_name) |>
  summarise(
    total_deals      = n(),
    total_revenue    = sum(deal_value),
    avg_deal_size    = mean(deal_value, na.rm = TRUE),
    win_rate         = mean(status == "won", na.rm = TRUE),
    avg_cycle_days   = mean(days_to_close, na.rm = TRUE),
    customer_sat     = mean(csat_score, na.rm = TRUE),
    .groups = "drop"
  ) |>
  mutate(
    composite_score = 0.3 * win_rate + 0.3 * rescale(customer_sat) +
                      0.2 * rescale(total_revenue) + 0.2 * (1 - rescale(avg_cycle_days)),
    rank = min_rank(desc(composite_score)),
    tier = case_when(
      composite_score >= 0.9 ~ "Gold",
      composite_score >= 0.7 ~ "Silver",
      TRUE ~ "Bronze"
    )
  ) |>
  arrange(rank)
Business Angle

When asking Claude to build scorecards, specify the weights for your composite score. Every organization prioritizes differently -- some value revenue over customer satisfaction, others the reverse.

Forecasting & Statistical Analysis

r
# Prompt: "Build a multi-model forecast comparison for our revenue segments"

library(tidyverse)
library(tsibble)
library(fable)
library(fabletools)

revenue_ts <- read_csv("data/clean/monthly_revenue.csv") |>
  mutate(month = yearmonth(date)) |>
  group_by(segment, month) |>
  summarise(revenue = sum(revenue), .groups = "drop") |>
  as_tsibble(key = segment, index = month)

# Fit multiple models
models_fit <- revenue_ts |>
  filter(month <= yearmonth("2025-09")) |>   # training set
  model(
    ets     = ETS(revenue),
    arima   = ARIMA(revenue),
    snaive  = SNAIVE(revenue)      # seasonal naive baseline
  )

# Forecast and evaluate
fc <- models_fit |>
  forecast(h = "6 months")

accuracy_tbl <- models_fit |>
  forecast(new_data = revenue_ts |> filter(month > yearmonth("2025-09"))) |>
  accuracy(revenue_ts) |>
  select(segment, .model, MAPE, RMSE) |>
  arrange(segment, MAPE)

# Select best model per segment
best_models <- accuracy_tbl |>
  group_by(segment) |>
  slice_min(MAPE, n = 1)

Visualization: ggplot2 Business Charts

r
# Prompt: "Create a business theme and key visualizations"

library(ggplot2)
library(scales)

theme_business <- function(base_size = 12) {
  theme_minimal(base_size = base_size) +
  theme(
    plot.title = element_text(face = "bold", size = rel(1.2)),
    plot.subtitle = element_text(color = "grey50"),
    panel.grid.minor = element_blank(),
    panel.grid.major.x = element_blank(),
    legend.position = "bottom",
    strip.text = element_text(face = "bold")
  )
}

# Performance heatmap by team and month
team_performance <- ggplot(team_data, aes(x = month, y = reorder(team, -avg_score))) +
  geom_tile(aes(fill = goal_attainment), color = "white", linewidth = 0.5) +
  scale_fill_gradient2(
    low = "#EF4444", mid = "#F59E0B", high = "#10B981",
    midpoint = 1.0,
    name = "Goal Attainment"
  ) +
  labs(title = "Team Performance by Month", x = "Month", y = NULL) +
  theme_business()

# Revenue trend with target line
revenue_trend <- ggplot(monthly_metrics, aes(x = month, y = revenue)) +
  geom_line(linewidth = 1, color = "#4F46E5") +
  geom_point(size = 2, color = "#4F46E5") +
  geom_hline(yintercept = quarterly_target / 3, linetype = "dashed", color = "#EF4444") +
  annotate("text", x = max(monthly_metrics$month), y = quarterly_target / 3 * 1.02,
           label = "Monthly Target", hjust = 1, color = "#EF4444", size = 3) +
  scale_y_continuous(labels = dollar_format()) +
  labs(title = "Monthly Revenue", y = "Revenue") +
  theme_business()

R Markdown/Quarto Report Automation

markdown
# Prompt for Claude Code:

"Create a Quarto report template for our monthly business review.
File: reports/monthly_review.qmd

YAML header:
- Title: 'Monthly Business Review'
- Format: html with table of contents, code folding
- Parameters: month (default: current month), department (default: 'all')

Sections:
1. Executive Summary (auto-generated key metrics vs targets)
2. Revenue & Pipeline (actuals vs forecast, pipeline health)
3. Operational Metrics (productivity, throughput, cycle time)
4. Team Performance (goal attainment, headcount, engagement)
5. Cost Analysis (budget vs actual, cost per unit trends)
6. Action Items (auto-flagged items needing attention)

Each section should:
- Pull data from data/clean/ directory
- Include at least one ggplot2 visualization
- Show key numbers in callout boxes
- Compare current month vs previous month and vs target"
Pro Tip

Use Quarto parameters (params$month) so the same report renders for any month. Then automate with: quarto render reports/monthly_review.qmd -P month:2026-02

Exercise: Build a Business Analytics Script

Hands-On Exercise

Write a prompt for Claude Code that generates a complete R analytics script. Your prompt should:

  1. Reference a specific CSV data source with column descriptions
  2. Include data cleaning steps (missing values, date parsing, validation)
  3. Calculate at least 3 business KPIs relevant to your domain
  4. Create at least 2 ggplot2 visualizations
  5. Export results to both CSV (for further analysis) and HTML (for sharing)
  6. Include a verification step (e.g., "row count should match input after cleaning")

Knowledge Check

What should you specify in CLAUDE.md about R pipe operators?

Explanation: Claude defaults to the base pipe |> in modern R. If your team uses magrittr's %>%, state it explicitly in CLAUDE.md. Consistency across a codebase matters.

Knowledge Check

When building a performance scorecard with Claude Code, what should you always specify?

Explanation: Every organization prioritizes metrics differently. Specifying weights (e.g., 30% win rate, 30% satisfaction, 20% revenue, 20% speed) ensures the scorecard reflects your business priorities.

Knowledge Check

What's the advantage of using Quarto parameters in recurring business reports?

Explanation: Quarto parameters let you build one template and render it for any time period or filter. Automate monthly reports by changing the parameter value: quarto render -P month:2026-03.
Module 6

Advanced Features Mastery

Advanced~30 min

Deep dive into permissions, MCP servers, hooks, skills, subagents, agent teams, and worktrees.

Permission Modes

Control how much autonomy Claude Code has. Cycle between modes with Shift+Tab:

ModeBehaviorBest For
defaultPrompts for each actionLearning, sensitive projects
acceptEditsAuto-accepts file edits, prompts for bashActive coding with oversight
dontAskAuto-denies prompts (only pre-approved tools work)Long-running unattended tasks
bypassPermissionsSkips all permission checksTrusted environments only
planRead-only exploration, no changesExploring before implementing

Pre-approve common safe commands with /permissions:

json
{
  "permissions": {
    "allow": [
      "Bash(Rscript *)",
      "Bash(quarto render *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Bash(npm run test)",
      "Read",
      "Edit"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push --force *)"
    ]
  }
}
Pro Tip (Boris Cherny)

Pre-approve safe commands via /permissions rather than using --dangerously-skip-permissions. Use wildcard patterns like "Bash(Rscript *)" for flexibility.

MCP Servers: Connecting External Tools

Model Context Protocol (MCP) lets Claude Code interact with databases, APIs, Slack, GitHub, Jira, and hundreds more:

bash
# Add an HTTP MCP server (recommended)
claude mcp add --transport http notion https://mcp.notion.com/mcp

# Add a local stdio MCP server
claude mcp add --transport stdio airtable \
  --env AIRTABLE_API_KEY=YOUR_KEY \
  -- npx -y airtable-mcp-server

# Add PostgreSQL for business database queries
claude mcp add --transport stdio postgres \
  -- npx -y @anthropic-ai/mcp-postgres \
  "postgresql://user:pass@localhost:5432/business_data"

# List active servers
claude mcp list

# Verify connections
/mcp

Business MCP use cases:

  • Database -- Query CRM data, financial records, operational metrics directly
  • Slack -- Search team channels, post automated reports and alerts
  • GitHub/Jira -- Create issues, track project tasks, automate workflows
  • Google Sheets -- Read from shared planning spreadsheets and budgets
Watch Out

Too many MCP servers eat context. Disconnect unused servers and use MCP Tool Search (auto-enables when tools exceed 10% of context) to dynamically load tools on demand.

Hooks System

Hooks run custom commands at specific points in Claude Code's lifecycle. There are 16 hook events and 4 hook types:

EventWhen It Fires
SessionStartSession begins or resumes
UserPromptSubmitBefore Claude processes your prompt
PreToolUseBefore a tool executes (can block it)
PostToolUseAfter a successful tool call
PostToolUseFailureAfter a tool call fails
PermissionRequestPermission dialog appears
StopClaude finishes responding
NotificationClaude needs your attention
ConfigChangeConfiguration file changes
SubagentStartA subagent is spawned
SubagentStopA subagent finishes
TeammateIdleAgent team member goes idle
TaskCompletedA task is marked complete
PreCompactBefore context compaction
SessionEndSession closes
InstructionsLoadedCLAUDE.md and rules finish loading

Hook types: command (shell command), prompt (single LLM call), agent (multi-turn subagent), HTTP (POST to endpoint).

json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit|Write",
      "hooks": [{
        "type": "command",
        "command": "Rscript -e 'styler::style_file(\"$TOOL_INPUT_FILE_PATH\")'"
      }]
    }],
    "Notification": [{
      "hooks": [{
        "type": "command",
        "command": "osascript -e 'display notification \"Claude needs input\" with title \"Claude Code\"'"
      }]
    }]
  }
}

Skills System

Skills are reusable, composable prompts you can invoke with a slash command. Create them in .claude/skills/ or ~/.claude/skills/:

markdown
# File: .claude/skills/sc-dashboard/SKILL.md
---
name: biz-dashboard
description: Creates a business KPI dashboard from CSV data
allowed-tools: Read, Write, Bash
argument-hint: <path-to-csv>
---

Create a self-contained HTML dashboard from the data at $ARGUMENTS.

Steps:
1. Read and analyze the CSV structure
2. Identify numeric columns suitable for KPIs
3. Create an interactive HTML dashboard with Chart.js
4. Include: summary cards, trend charts, comparison tables
5. Apply professional dark-sidebar theme
6. Save as dashboards/$(basename $ARGUMENTS .csv)-dashboard.html

Then invoke with: /biz-dashboard data/clean/quarterly_data.csv

Key frontmatter options: name, description, allowed-tools, model, context: fork (run in subagent), agent (which subagent), hooks (lifecycle hooks).

Subagents

Subagents are isolated Claude instances that run within your session with separate context windows:

  • Explore -- Fast, read-only. For searching code, finding patterns. Uses cheaper model.
  • Plan -- Research agent for designing implementation strategies.
  • General-purpose -- Full capabilities for complex multi-step work.

Create custom subagents in .claude/agents/:

markdown
# File: .claude/agents/data-validator.md
---
name: data-validator
description: Validates business data files for quality issues
tools: Read, Bash, Glob, Grep
model: sonnet
maxTurns: 10
---

You are a data quality validator for business data.
When given a file path, check for:
- Missing values in required columns
- Date format consistency
- Negative quantities or prices
- Duplicate records
- Values outside expected ranges
Report findings as a structured summary.

Agent Teams (Experimental)

Multiple Claude Code instances working together with shared task lists and direct messaging:

json
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

When to use teams:

  • Research with competing hypotheses (3 agents explore different forecasting approaches)
  • Parallel code review (security agent, performance agent, test coverage agent)
  • Cross-layer development (data pipeline agent + visualization agent + reporting agent)

Best practices: 3-5 teammates optimal. 5-6 tasks per teammate. Avoid multiple teammates editing the same file.

Worktrees for Parallel Work

Run isolated Claude Code sessions using git worktrees:

bash
# Start Claude in an isolated worktree
claude -w feature-arima-forecast

# This creates a separate copy of your repo
# Changes in the worktree don't affect your main branch
# Perfect for experiments, parallel features, or risky refactors
Pro Tip (Boris Cherny)

Boris runs 5 parallel sessions using separate git worktrees, with color-coded terminal tabs. Each session focuses on one task with its own clean context window.

Exercise: Configure an Advanced Feature

Hands-On Exercise

Choose one of these to configure for your analytics project:

  1. MCP Server: Connect a PostgreSQL or SQLite database with your business data
  2. Hook: Create a PostToolUse hook that auto-formats R files with styler after edits
  3. Skill: Create a /biz-report skill that generates a Quarto business report
  4. Custom Agent: Create a data-validator agent that checks CSV files for quality issues

Knowledge Check

Which permission mode should you use for long-running unattended tasks?

Explanation: dontAsk auto-denies unapproved prompts while allowing pre-approved tools to run. Combined with pre-approved permissions, it's the safe way to run unattended. Never use bypassPermissions unattended.

Knowledge Check

What happens when too many MCP servers are connected?

Explanation: MCP tool definitions consume context. Use MCP Tool Search (auto-enables at 10% context) to dynamically load tools on demand, and disconnect servers you're not using.

Knowledge Check

What is the optimal number of teammates in an agent team?

Explanation: 3-5 teammates is optimal. More agents means more tokens spent on coordination overhead. Give each teammate 5-6 tasks to keep everyone productive.

Knowledge Check

Why are subagents valuable for context management?

Explanation: Subagents explore in their own context window and return a concise summary. Your main context stays clean for implementation. This is one of the most powerful techniques for managing context.
Module 7

Expert Profiles & Techniques

Advanced~20 min

Learn from the best: Boris Cherny (Claude Code creator), Nate B. Jones, and other power users. Plus 30 actionable tips to track and adopt.

Boris Cherny -- Creator of Claude Code

BC
Boris Cherny
Creator of Claude Code at Anthropic
"Give Claude a way to verify its work. If Claude has that feedback loop, it will 2-3x the quality of the final result."
Key Techniques
  • 5 parallel sessions -- Runs 5 local instances + 5-10 web sessions on claude.ai/code simultaneously, with color-coded terminal tabs per task
  • Plan Mode first -- Starts complex PRs in Plan Mode (Shift+Tab), iterates on plans, then switches to auto-accept for implementation
  • Compounding Engineering -- Team updates CLAUDE.md multiple times per week with learnings from PR reviews using @.claude tags
  • Opus with thinking -- Uses the latest Opus model with thinking mode for everything: "It's the best coding model I've ever used. Less steering + better tool use = faster overall"
  • Verification as #1 priority -- Always gives Claude a way to verify: tests for code, browser checks for UI, simulators for logic
  • Voice dictation -- Uses macOS dictation (fn x2) for more detailed, natural prompts
  • Pre-approved permissions -- Uses /permissions with wildcard patterns rather than --dangerously-skip-permissions
  • PostToolUse hooks -- Auto-formatting after code generation catches edge cases
  • Custom status line -- Shows model, directory, context usage, and cost at a glance
  • Challenge prompts -- "Grill me on these changes and don't make a PR until I pass your test"

Nate B. Jones -- Claude Code for Non-Coders

NJ
Nate B. Jones
AI Workflow Author & Claude Code Evangelist
"Claude Code shouldn't be named Claude Code -- the name misleads non-technical people. It's a universal terminal for all knowledge work."
Key Techniques
  • Business-first framing -- Positions Claude Code as a general-purpose AI agent, not just a coding tool
  • Marketing automation -- Built complete marketing systems (writing analysis, content generation, scheduling) in hours for ~$0.10/week operational cost
  • Cross-functional workflows -- Uses Claude Code for legal, marketing, research, HR, finance, and product management tasks
  • Recruitment automation -- Paste interview transcripts, get structured analysis with Notion cards and next steps -- no coding needed
  • ROI focus -- Documents concrete case studies: companies reporting 23% SQL rate boost (Syncari), $1.2M pipeline recovery, and 65% faster support response times using Claude Code workflows
  • Early adopter advantage -- Emphasizes the competitive window before these workflows become common

Common Patterns Among Top 10% Users

After studying dozens of power users, these patterns emerge consistently:

  • Context hygiene -- They use /clear between every distinct task. No exceptions.
  • Verification-first -- Every prompt includes how to verify the output (tests, expected values, comparisons).
  • Parallelism -- They run multiple sessions, use subagents for research, and delegate aggressively.
  • Living CLAUDE.md -- Their project instructions evolve continuously, capturing team learnings.
  • Structured prompts -- Context + Objective + Constraints, every time.
  • Model awareness -- They choose Opus for complex reasoning, Sonnet for general work, Haiku for fast exploration.
  • Permission optimization -- Pre-approved safe patterns reduce interruptions without sacrificing safety.
  • Prompt decomposition -- Complex tasks are always broken into chains of focused prompts.

Top 30 Actionable Tips

Track which tips you already use and which you plan to adopt:

You already use 0/30 tips. You plan to adopt 0 more.

1
Use /clear between every distinct taskFresh context = better results. This is the single most impactful habit.
2
Give Claude verification criteria in every promptTests, expected outputs, comparisons -- let Claude self-check.
3
Use Plan Mode (Shift+Tab) before implementingExplore and plan first, implement second. Iterate on plans before writing code.
4
Reference files with @ instead of describing them@path/to/file.R is precise. "The forecast file" is ambiguous.
5
Structure prompts: Context + Objective + ConstraintsReduces exchanges needed by ~50%.
6
Run /compact proactively at ~70% contextDon't wait for auto-compaction. Stay ahead of the curve.
7
Delegate research to subagentsKeep your main context clean for implementation.
8
Maintain a living CLAUDE.md for every projectUpdate it with learnings from every session.
9
Pre-approve safe commands with /permissionsWildcard patterns like "Bash(Rscript *)" reduce interruptions safely.
10
Use voice dictation for complex promptsfn x2 on macOS. Speak naturally for more detailed, nuanced instructions.
11
After 2 failed corrections, /clear and start freshBetter prompt from scratch beats accumulated wrong context.
12
Chain prompts for complex tasksBreak into sequential focused steps. Each builds on the previous.
13
Use Opus for complex reasoning, Sonnet for general tasksMatch model capability to task complexity.
14
Run parallel sessions for independent tasks5 local + 5-10 web sessions is Boris Cherny's setup.
15
Use PostToolUse hooks for auto-formattingCatch style issues automatically after every edit.
16
Use .claude/rules/ for path-specific instructionsRules only load when working on matching files. Saves context.
17
Create custom skills for recurring workflowsBuild once, invoke with /skill-name forever.
18
Pipe data to Claude for quick analysiscat data.csv | claude "analyze this" -- instant insights.
19
Use /rewind when Claude makes unwanted changesFaster than manually reverting. Restores files AND conversation state.
20
Customize your status line to show context usageAlways know how full your context window is.
21
Use worktrees for risky experimentsIsolated branch copy. If it fails, just delete the worktree.
22
Disconnect unused MCP serversReduce context overhead from tool definitions.
23
Check .claude/settings.json into gitShare team configurations for consistent behavior.
24
Use /simplify after implementation for cleanupParallel code quality improvement on changed files.
25
Use /batch for large-scale migrationsParallel execution across many files with auto-PRs.
26
Use Notification hooks for macOS alertsGet notified when Claude needs input, even in another app.
27
Challenge Claude: "Grill me on these changes"Use Claude as a reviewer before committing.
28
"Scrap this and implement the elegant solution"When results are mediocre, ask Claude to start over with everything it's learned.
29
Use /doctor when things aren't workingDiagnoses configuration issues, MCP connections, and environment problems.
30
Describe symptoms, not diagnoses"Tests pass but output is wrong for dates before 2020" beats "Fix the date bug."
Module 8

Cost Optimization & Troubleshooting

Intermediate~15 min

Keep costs under control, diagnose issues fast, and troubleshoot common problems.

Token Usage & Cost Tracking

Use /cost to see your current session's token usage and estimated cost. Track spending patterns to optimize your workflow:

bash
# Check current session cost
/cost

# Run with verbose output to see token counts
claude --verbose

# Check context utilization
/context

Where tokens go:

  • System prompt -- CLAUDE.md, rules, MCP tool definitions (loaded every turn)
  • Conversation history -- Every message grows the context
  • Tool results -- File contents, command outputs, search results
  • Extended thinking -- Can consume 3-4x more tokens when enabled

Cost-Saving Strategies

These strategies are ordered by impact -- start from the top:

  1. Use /clear aggressively -- Fresh context between tasks. The biggest single cost saver.
  2. Choose the right model -- Haiku for Explore subagents (fast, cheap), Sonnet for general work, Opus only for complex reasoning.
  3. Use subagents for exploration -- They work in isolated context and return only a summary. Your main context stays small.
  4. Run /compact at 70% context -- Proactive compaction is cheaper than hitting the limit.
  5. Move instructions from CLAUDE.md to skills -- Skills load on-demand. CLAUDE.md loads every turn.
  6. Disconnect unused MCP servers -- Tool definitions consume context every turn.
  7. Use extended thinking only when needed -- It's powerful but expensive. Toggle with Cmd+T.
  8. Offload to hooks -- Auto-formatting, validation, and simple transforms via hooks are free (no LLM call).
Pro Tip

Track your weekly Claude Code cost and context usage. Many users find that aggressive /clear usage and subagent delegation significantly reduce costs while improving output quality.

Diagnostic Commands

CommandWhat It Checks
/doctorFull diagnostic: config, permissions, MCP, environment
/statusCurrent session info: model, mode, session ID
/memoryView CLAUDE.md and auto memory contents
/mcpVerify MCP server connections and tools
/hooksReview active hooks and their configurations
/configView and edit settings and preferences
/contextCheck context window utilization
/costToken usage and estimated cost
claude --debugFull debug output for troubleshooting

Common Issues & Solutions

  • Check with /memory that the file is actually loaded
  • Make instructions more specific and actionable (not "write good code" but "use snake_case for all variables")
  • Verify file is under 200 lines -- longer files get partially ignored
  • Check for contradictions between different CLAUDE.md levels
  • Use /clear more often between tasks
  • Delegate exploration to subagents instead of doing it in main context
  • Run /compact proactively at 70%
  • Move verbose instructions from CLAUDE.md to skills or .claude/rules/
  • Disconnect unused MCP servers
  • Run /mcp to verify server status
  • Check that required environment variables are set (API keys, credentials)
  • For stdio servers, verify the command runs manually: npx -y server-name
  • For HTTP servers, verify the URL is accessible
  • Run /doctor for comprehensive diagnostics
  • Matchers are case-sensitive: "Edit|Write" not "edit|write"
  • Verify hook appears in /hooks output
  • Check that the hook script is executable (chmod +x)
  • Test the hook command manually in terminal
  • Check settings file syntax (valid JSON in .claude/settings.json)
  • Check auto memory (/memory) for incorrect stored learnings
  • Add a specific rule to CLAUDE.md: "NEVER do X, ALWAYS do Y instead"
  • Use /clear and start fresh -- accumulated wrong context causes loops
  • Provide a concrete counter-example in your prompt
  • If persistent across sessions, update CLAUDE.md with the correction
  • Pre-approve common commands: /permissions then add patterns like "Bash(Rscript *)"
  • Use acceptEdits mode for active coding sessions
  • Check .claude/settings.json for overly restrictive deny rules
  • Use wildcards for flexibility: "Bash(git *)" approves all git commands

Knowledge Check

What is the single biggest cost-saving strategy in Claude Code?

Explanation: Fresh context between tasks prevents accumulation. Every message in your conversation adds to token usage on the next turn. /clear resets this to zero.

Knowledge Check

What should you do first when Claude keeps repeating the same mistake across sessions?

Explanation: Auto memory can store incorrect learnings that persist across sessions. Check /memory first, then update or remove the wrong entry. Also add a specific correction to CLAUDE.md.
Module 9

Putting It All Together

Advanced~30 min

End-to-end project walkthrough, real-world use cases, final assessment, and your certificate of completion.

End-to-End: Business Analytics Dashboard Project

Here's a complete walkthrough applying everything from this training to build a business dashboard from scratch:

1
Setup

CLAUDE.md + permissions + project structure

2
Explore

Understand data in Plan Mode

3
Pipeline

Clean and transform data with R

4
Analyze

Calculate KPIs and forecasts

5
Visualize

Build interactive dashboard

6
Deploy

Generate report and commit

bash
# Step 1: Setup (one-time)
claude /init
# Edit the generated CLAUDE.md with conventions, data locations, KPI definitions

# Step 2: Explore (Plan Mode -- Shift+Tab)
# "Read the CSV files in data/raw/ and describe schemas, date ranges,
#  data quality issues. Recommend a cleaning strategy."

# Step 3: Pipeline (/clear first!)
/clear
# "Create R/etl_pipeline.R that cleans and joins the raw data files.
#  Validate: no nulls in required columns, dates are valid, amounts > 0.
#  Output to data/clean/business_master.csv"

# Step 4: Analyze (/clear first!)
/clear
# "Using @data/clean/business_master.csv, create R/calculate_kpis.R:
#  - Revenue and margin by segment (last 6 months)
#  - Customer retention rate by cohort
#  - Revenue forecast (ETS) for top segments, 12-month horizon
#  - Goal attainment by team
#  Run the script and verify outputs."

# Step 5: Visualize (/clear first!)
/clear
# "Create a self-contained HTML dashboard from @data/output/kpi_summary.csv
#  and @data/output/forecasts.csv. Include: KPI cards, trend charts,
#  team scorecard table, forecast charts with prediction intervals.
#  Professional theme, responsive. Save as dashboards/biz-dashboard.html"

# Step 6: Deploy
/clear
# "Create a commit with all new files. Message should describe the
#  business analytics pipeline and dashboard."
Key Takeaway

Notice the pattern: /clear before every major step. Each step is a focused prompt with file references, verification criteria, and specific output expectations. This is how top 10% users work.

5 Real-World Business Use Cases

Problem: Monthly business reviews take 2 days to compile from multiple data sources.

Solution: Create a /biz-report skill that reads from your database (MCP), calculates revenue/margin/engagement metrics, generates ggplot2 charts, and renders a Quarto report. Run monthly with one command.

Result: 2 days reduced to 15 minutes. Reports are more consistent and include trend analysis.

Problem: Campaign ROI is calculated manually in spreadsheets with inconsistent methodology.

Solution: Use Claude Code to build an R pipeline that ingests campaign data from multiple channels, calculates attribution, compares CAC across channels, and forecasts optimal budget allocation using historical performance.

Result: Identified that 30% of budget was in underperforming channels. Reallocation improved overall CAC by 22%.

Problem: No early warning system for at-risk customer accounts.

Solution: Build an interactive HTML dashboard showing churn risk scores by account. Include engagement trends, usage patterns, and recommended retention actions. Updates weekly from automated data pipeline.

Result: Identified 45 at-risk accounts representing $3.2M ARR. Proactive outreach saved 78% of flagged accounts.

Problem: Finance team spends hours reconciling budget vs actual across departments.

Solution: Claude Code builds a variance analysis tool that reads budget and actual data, calculates variances by department and category, flags items exceeding 10% threshold, and generates drill-down reports.

Result: Monthly close process shortened by 3 days. Variance explanations auto-generated for 80% of line items.

Problem: No data-driven view of attrition risk, headcount planning, or compensation benchmarking.

Solution: Use Claude Code to analyze HRIS data: attrition by department and tenure, compensation band analysis, diversity metrics, and headcount forecasting. Build a Pareto analysis showing where 80% of attrition comes from 20% of causes.

Result: Identified key attrition drivers. Targeted retention programs reduced voluntary turnover by 18%.

Your Personal Claude Code Setup Checklist

Setup Checklist

Use this checklist to configure your environment for knowledge work:

  • Create project CLAUDE.md with R conventions and data pipeline instructions
  • Add .claude/rules/ for path-specific R and report rules
  • Configure /permissions to pre-approve Rscript, quarto, and git commands
  • Set up /statusline to show context usage and cost
  • Create at least one custom skill (e.g., /biz-dashboard or /biz-report)
  • Connect relevant MCP servers (database, Slack, or GitHub)
  • Create a data-validator custom agent in .claude/agents/
  • Set up Notification hook for macOS alerts
  • Set up PostToolUse hook for R code auto-formatting
  • Check .claude/settings.json into git for team sharing

Practice Exercises

Exercise 1: Build a Complete Analytics Pipeline

Using Claude Code, build an end-to-end analytics pipeline:

  1. Create a CLAUDE.md for an R-based analytics project
  2. Write an ETL script that cleans and validates CSV data
  3. Calculate 5 business KPIs from the cleaned data
  4. Create a ggplot2 visualization for each KPI
  5. Render a Quarto report with executive summary and charts

Exercise 2: Configure Advanced Features

Set up your Claude Code environment with:

  1. A custom skill that generates business dashboards from any CSV
  2. A PostToolUse hook for R file auto-formatting with styler
  3. A data-validator custom agent
  4. Pre-approved permission patterns for your R workflow

Exercise 3: Multi-Model Revenue Forecasting

Use prompt chaining to build a revenue forecasting system:

  1. Chain 1: Explore data quality and seasonality patterns
  2. Chain 2: Build and compare 3 forecasting models (ETS, ARIMA, Prophet)
  3. Chain 3: Select best model per segment and generate 12-month forecasts
  4. Chain 4: Calculate P10/P50/P90 scenarios for budget planning
  5. Chain 5: Create an interactive dashboard with forecast visualizations

Final Assessment

Answer all 10 questions to complete your training. Score 80% or higher to earn your certificate.

Question 1 of 10

What is the recommended maximum length for a project CLAUDE.md?

Keep CLAUDE.md under 200 lines. Move details to .claude/rules/ or skills.

Question 2 of 10

What does Boris Cherny say is the single most important thing you can do to improve Claude Code's output quality?

Verification is the #1 technique. Tests, expected outputs, screenshots -- any feedback loop 2-3x the quality.

Question 3 of 10

What are the four phases of the recommended Claude Code workflow?

Explore (Plan Mode) → Plan (iterate) → Implement (auto-accept) → Commit (PR).

Question 4 of 10

How do subagents help with context management?

Subagents explore in isolated context and return concise summaries, keeping your main context clean.

Question 5 of 10

What should you do after correcting Claude twice with no improvement?

After two failures, /clear and start fresh. A clean prompt outperforms accumulated wrong context.

Question 6 of 10

What permission mode is safest for long-running unattended tasks?

dontAsk auto-denies unapproved actions while letting pre-approved tools run. Safe and autonomous.

Question 7 of 10

Where should path-specific instructions (e.g., "R files must use tidyverse style") be stored?

.claude/rules/ files with path: globs load only when Claude works on matching files, keeping context lean.

Question 8 of 10

What three parts should every well-structured prompt include?

Context (what exists) + Objective (what you want) + Constraints (boundaries and verification) cuts exchanges by ~50%.

Question 9 of 10

What is the optimal number of teammates in an agent team?

3-5 teammates is optimal. More agents = more coordination overhead and token consumption.

Question 10 of 10

What is the single biggest cost-saving strategy in Claude Code?

Fresh context between tasks prevents token accumulation. This is the single most effective cost-saving habit.