Claude Code ยท Lesson Reference
How Claude Code Actually Works
The essential files, commands, memory system, and agentic loop โ€” everything a non-technical builder needs to understand.
โ— Live Reference
Essential Files & Folder Structure
๐ŸŽฏ
What to show: Open a real project folder in your terminal. Run ls -la and point out these files as they appear.
your-project/ โ€” What Claude Code sees when it opens your project
your-project/
๐Ÿ“„ CLAUDE.md โ† Claude's brain for THIS project
๐Ÿ“„ CLAUDE.local.md โ† YOUR personal overrides (gitignored)
๐Ÿ“ .claude/ โ† Claude Code config folder
โš™๏ธ settings.json โ† permissions, MCP, tools
๐Ÿ“„ settings.local.json โ† your local settings override
๐Ÿ“ src/
๐Ÿ“„ package.json
๐Ÿ“„ README.md

~/.claude/ โ† global, across ALL your projects
๐Ÿ“„ CLAUDE.md โ† your personal preferences, always loaded
๐Ÿ“ memory/ โ† Claude's auto-saved notes
โš™๏ธ settings.json โ† global defaults
CLAUDE.md โ€” Starter Template MARKDOWN
# My Project Name ## What This Project Is A dashboard for tracking client KPIs. Built for non-technical users. ## Stack - HTML, CSS, vanilla JavaScript - No frameworks (keep it simple) - Data: paste from Google Sheets ## Rules Claude Must Follow - Never use jargon in comments - Always add mobile-responsive CSS - Keep components under 100 lines - Use semantic HTML (no div soup) ## Current Status - โœ… Hero section done - ๐Ÿ”„ KPI cards in progress - โฌœ Chart component todo
.claude/settings.json โ€” Permissions JSON
{ "permissions": { "allow": [ "Bash(npm run *)", "Bash(git *)", "Read(**)", "Write(src/**)" ], "deny": [ "Bash(rm -rf *)", "Write(.env)" ] }, "mcpServers": { "notion": { "command": "npx", "args": ["notion-mcp"] } } }
๐Ÿ’ก
Teaching moment: The settings file is where you control what Claude Code is allowed to do. It's like giving an assistant a job description with clear boundaries โ€” they can write to your src/ folder but can never delete files or touch your secrets.
The 4-Layer Memory System
๐Ÿง 
Key insight to convey: Claude Code has NO memory between sessions by default โ€” but CLAUDE.md is how you give it permanent memory. Click each layer to expand.
๐ŸŒ
Layer 1 โ€” Global
~/.claude/CLAUDE.md
All projects
Always loaded, every project. Put things here that are true about YOU as a builder โ€” your preferred stack, communication style, naming conventions you always use.

Example contents: "Always write comments in plain English. I prefer dark-themed UI. I'm a non-technical founder so explain decisions in simple terms."
๐Ÿ“
Layer 2 โ€” Project
CLAUDE.md (project root)
This project only
The most important file. Lives at the root of your project. Loaded every session. Contains: what the project does, the tech stack, rules Claude must follow, current status, and any context a new "team member" would need.

Critical behavior: This file survives /compact โ€” even when Claude forgets the conversation, it re-reads this file from disk.
๐Ÿ“‚
Layer 3 โ€” Directory
src/api/CLAUDE.md
That folder only
Scoped rules for specific folders. Only loads when Claude works in that subdirectory. Use this for different rules in different parts of your app โ€” e.g. strict validation rules for your API folder, looser rules for prototypes.

Advanced use: override project-level rules for a specific component or module.
๐Ÿค–
Layer 4 โ€” Auto Memory
~/.claude/memory/ (auto-generated)
Claude writes this
Claude takes its own notes. Requires v2.1.59+. Claude decides what's worth saving โ€” build commands, debugging insights, your preferences, architecture decisions. Organized into 4 categories: user preferences, your feedback/corrections, project context, and reference pointers.

Run /memory to browse what Claude has saved. Everything is plain Markdown you can read, edit, or delete.
Best-Practice CLAUDE.md for Non-Technical Builders MARKDOWN
# Project: [Name] # This file tells Claude everything it needs to know. Update it as the project evolves. ## Project Overview [2 sentences: what this does and who it's for] ## My Technical Level Non-technical founder. Explain decisions in plain English. No jargon. If code must be complex, add a comment explaining why. ## Stack (Keep Simple) - HTML + CSS + vanilla JS only (no React, no frameworks) - No external dependencies unless absolutely necessary - Single-file components preferred ## Non-Negotiable Rules - Mobile responsive on EVERY component - Accessibility: always use semantic HTML - Never delete files โ€” move to /archive instead - Always ask before touching anything in /data ## Current Sprint (update weekly) Building: [feature name] Blocked on: [anything] Done this week: [list] ## Key Decisions Made - Chose vanilla JS over React: simpler to maintain without a dev - Using CSV for data: easier for client to update in Google Sheets - No backend yet: launching with static site first
โš ๏ธ
Common mistake: People treat CLAUDE.md like a chat message โ€” too long, too conversational. Keep it under 200 lines. Use bullet points. Think of it as a README written for Claude, not for humans. Files over 200 lines reduce how well Claude follows the instructions.
The Build Workflow โ€” Session to Session
๐ŸŽฌ
Demo this live: Open a fresh folder in your terminal. Walk through steps 1โ€“4 in real time. The audience sees Claude Code go from blank folder to working product.
01
Install & Launch
One-time setup. Requires Node.js 18+. After install, just type claude from any folder to start a session.
$ npm install -g @anthropic-ai/claude-code

$ claude
๐Ÿ’ก
Claude Code runs in your terminal โ€” it can see your files, run commands, and write code directly to your disk. This is what makes it different from the web chat.
02
Initialize the Project Memory
Run /init inside an existing project folder. Claude reads your codebase and auto-generates a CLAUDE.md โ€” then you edit it to match your rules.
claude> /init


Claude will generate:
โœ… CLAUDE.md with project overview
โœ… Build commands it detected
โœ… Architecture notes from your files

โ†’ Your job: review and edit it to add your rules
03
Build in Plain English
Describe what you want. Claude reads your files, writes code, runs commands, and shows you results. You review and approve or redirect.
Example session
You: Build a pricing page with 3 tiers. Monthly/annual toggle. Dark mode. Claude: Reading CLAUDE.md... โœ“ Creating pricing.html... โœ“ Adding toggle JS logic... โœ“ Done. Open index.html to preview. You: Make the Pro plan glow and add a "Most Popular" badge. Claude: Updating pricing.html... โœ“
04
Use Plan Mode for Big Changes
For major features, switch to Plan Mode first. Claude shows you exactly what it will do โ€” no files are changed. You approve, then it executes.
$ claude --plan
๐ŸŽฏ
Teaching moment: Plan Mode = show, don't touch. It's like asking a contractor to give you the project plan before they start demolition. Always use it before building something large or touching existing code.
05
Compact When Context Gets Long
After a long session, Claude's context window fills up. /compact summarizes the conversation but CLAUDE.md is preserved โ€” so nothing important is lost.
claude> /compact
โœ…
This is why CLAUDE.md matters so much โ€” it's the thing that survives compaction. Anything important that's only in the chat conversation gets lost. Write it in CLAUDE.md.
06
Update CLAUDE.md as You Build
After each session, update CLAUDE.md with decisions made, status changes, and new rules. Think of it as a living project log that Claude reads on every future session.
## After Session 3 โ€” Update log:
+ Added: pricing.html with 3 tiers
+ Decision: no backend, using Stripe links
+ Next: auth flow, user dashboard
- Bug: mobile toggle breaks below 320px
Essential Slash Commands
โŒจ๏ธ
Show these live: Open Claude Code and type / โ€” the autocomplete menu appears. Walk through the most important ones.
/init
Scans your project and auto-generates a CLAUDE.md file. Run this first in any new project.
๐Ÿ’ก Start every new project with this
/plan
Shows what Claude will do before it does it. No files are modified. Review and approve the plan first.
๐Ÿ’ก Use before any large or risky change
/compact
Summarizes the conversation to free up context window space. CLAUDE.md survives; chat history is summarized.
๐Ÿ’ก Use when sessions run long (1hr+)
/clear
Clears the conversation entirely and starts fresh. CLAUDE.md is still re-loaded. Good for starting a new task.
๐Ÿ’ก Between different features/tasks
/review
Ask Claude to review the code it just wrote โ€” catch bugs, accessibility issues, performance problems before shipping.
๐Ÿ’ก Always run before sending to a client
/status
Shows what's currently in context โ€” which files are loaded, what Claude knows about the session so far.
๐Ÿ’ก Use when Claude seems confused
/memory
Opens the memory management panel. Browse, edit, or delete what Claude has auto-saved. Toggle auto-memory on/off.
๐Ÿ’ก Check this after a few sessions
# [instruction]
Prefix with # to give Claude a rule for the current conversation only. Claude will suggest adding it to CLAUDE.md permanently.
๐Ÿ’ก "# Always explain what you changed"
@path/to/file.md
Import another file's contents directly into CLAUDE.md using @ syntax. Reference docs, specs, or style guides without copy-pasting.
๐Ÿ’ก Keep CLAUDE.md lean, import detail
/config
Open configuration settings โ€” model, theme, keybindings, auto-approval preferences, and more.
/mcp
Manage connected MCP servers โ€” see what's connected, add new connections, troubleshoot issues.
/doctor
Diagnoses common issues โ€” checks Node version, API key, permissions, and MCP server connectivity.
๐Ÿ’ก First thing to run if something breaks
claude --version
Check which version of Claude Code you're running. Auto-memory requires v2.1.59+.
The Agentic Loop โ€” What's Actually Happening
๐Ÿ”„
The big insight: Claude Code isn't just chatting โ€” it's running a loop of read โ†’ think โ†’ act โ†’ verify โ†’ report. You're the manager approving each cycle.
You
๐Ÿ’ฌ Plain English
"Build a login page"
โ†’
Claude
๐Ÿง  Reads + Plans
CLAUDE.md + your files
โ†’
Tools
๐Ÿ”ง Takes Action
Writes files, runs code
โ†’
Output
โœ… Shows Result
You review & redirect
โ†ฉ
What Claude Code can DO
๐Ÿ“„
Read files โ€” browses your entire codebase
โœ๏ธ
Write files โ€” creates and edits code directly
โšก
Run commands โ€” npm install, git commit, tests
๐ŸŒ
Fetch URLs โ€” reads docs and APIs
๐Ÿ”Œ
Use MCP tools โ€” Notion, GitHub, Slack, etc.
Your role as the builder
๐ŸŽฏ
Define the goal โ€” in plain English, be specific
โœ…
Approve actions โ€” Claude asks before risky moves
๐Ÿ”€
Redirect โ€” "not quite, make it darker, add X"
๐Ÿ“
Update CLAUDE.md โ€” lock in decisions
๐Ÿšข
Ship it โ€” you decide when it's done
๐ŸŽฏ
Analogy that works for non-technical audiences: Claude Code is like a very talented contractor who works in your house. They're skilled, but they need your approval before knocking down walls. The CLAUDE.md is the brief you hand them on day one. Your job is direction, not construction.
MCP Connectors โ€” Giving Claude Superpowers
๐Ÿ”Œ
The unlock: MCP (Model Context Protocol) lets Claude Code talk to external tools. Instead of copying data between apps, Claude accesses them directly.
How MCP changes the workflow
Without MCP: You: "Here's the Notion doc I copied... [pastes 800 words] Now build a dashboard from this" With MCP (Notion connected): You: "Read my Notion project tracker and build a status dashboard from it" Claude: Connecting to Notion... reading tracker... Building dashboard... โœ“
๐Ÿ““
Notion
Read/write databases, pages, tasks directly from Claude Code
๐Ÿ™
GitHub
Create PRs, read issues, manage repos without leaving terminal
๐Ÿ’ฌ
Slack
Read channel history, send messages, summarize threads
๐Ÿ“Š
Google Sheets
Pull live data, update cells, trigger Claude from sheet changes
๐Ÿ“ฎ
Linear
Create tickets, update status, query sprint data
๐Ÿ—„๏ธ
Postgres / SQLite
Query your database in natural language, no SQL needed
๐ŸŒ
Browser (Puppeteer)
Scrape pages, automate forms, take screenshots
๐Ÿ“ง
Gmail / Calendar
Draft emails, schedule meetings, read inbox context
Add an MCP server to .claude/settings.json JSON
"mcpServers": { "notion": { "command": "npx", "args": ["-y", "@notionhq/notion-mcp-server"], "env": { "NOTION_API_KEY": "your-key-here" } }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token" } } }
๐ŸŽฏ
For your audience: MCP is the difference between Claude Code being a code writer vs. a full AI coworker. Once connected to Notion + GitHub + Slack, you can say: "Look at what's in my Linear sprint, write the code for the top task, and post a Slack update when it's done."