This comprehensive course takes you from installing Claude Code to building production-ready applications with AI-assisted development. You'll learn to leverage Claude's autonomous capabilities for scaffolding projects, enforcing testing standards, conducting architectural reviews, and performing security audits—all while understanding when to trust AI and when to apply human oversight.
Getting Started: Installation and Your First Session
Claude Code isn't just another code completion tool—it's an npm application that transforms your terminal into an AI-powered development partner. Installation takes minutes: `npm install -g @anthropic-ai/claude-code`. But here's where it gets interesting. On Ubuntu EC2 instances, that standard command might throw permission errors, forcing you down a rabbit hole of chmod commands. The solution? Use the native installer: `curl -fsSL https://claude.ai/install.sh | bash`. This manual approach bypasses npm's permission dance entirely.
Your first session reveals Claude's thinking process through to-do lists. When you ask it to create a Python script that reads a CSV file, Claude doesn't just dump code—it plans: "analyze requirements, create virtual environment, write reader function, handle exceptions." Each step gets a checkbox. This transparency matters because it lets you interrupt bad assumptions early. If Claude decides to use pandas for a simple task, you can course-correct before it generates hundreds of lines.
The `/init` command creates a claude.md file—think of it as Claude's memory for your project. It analyzes your folder structure, identifies the tech stack, and documents setup instructions. This file becomes Claude's context anchor. Every time you start a new session, Claude reads this first, preventing the "what is this project again?" confusion that plagues other AI tools. For a Flask app, it might note: "This is a member data processor. Uses Python 3.12. Activate with `source venv/bin/activate`. Run with `python app.py`." Simple, but powerful when you return after a week away.
From Vibe Coding to Production: The METAR Weather Reader
The instructor demonstrates "vibe coding"—throwing a high-level idea at Claude and watching it scaffold an entire application. The prompt: "Create a Flask web application. This application will be a METAR reader. The user can type in an airport code and the application will fetch the METAR reading from that airport and decode it. METAR is a standardized weather report. It is somewhat cryptic. So I would like to convert it into plain English that people can understand."
Notice what's missing: no file structure specified, no libraries listed, no UI mockups. Yet Claude generates a complete app—routes, templates, static files, error handling. Within 10 minutes, you can enter KHIO and get back: "Clear skies, 81°F, wind from the north at 0 knots, 10+ miles visibility." The raw METAR string gets decoded from cryptic aviation shorthand into readable English.
But here's the critical lesson: the instructor immediately runs audits. The first quality check reveals the app scores 3 out of 10 for architectural design. Problems: business logic embedded in routes, no service layer, database queries (if added) would live in controllers. The code works, but it's not maintainable. This is the trap of vibe coding—functional software that becomes a maintenance nightmare after the first feature request.
The instructor then shows session management. After building core features, he types: "I would like to commit the initial creation of this application. Help me create a good commit message." Claude generates: `git commit -m "Add Flask METAR reader web application"`. Then: "I want to release this publicly. Please add comments to app.py using Python best practices. Create a readme for GitHub that explains the application and how to install it." Claude produces docstrings, a comprehensive README, and even suggests adding a LICENSE file (though it forgets to create it—human verification required).
Autonomous Building: The Express Authentication System
The instructor poses a challenge: can Claude build a complete production-ready authentication system from a single prompt? The test prompt includes everything: "Create a complete authentication system for a React application. Include user registration, login, password reset, JWT tokens, email verification. Use Express, MongoDB, modern security best practices."
Claud's to-do list appears: set up Express backend with MongoDB, create user model, implement registration endpoint with email verification, build login with JWT tokens, create React frontend with TypeScript, add protected routes, implement error handling. The list has 20+ items. The instructor says yes, then walks away for coffee.
Ten minutes later: a full-stack app exists. Backend folder with Express routes, MongoDB schemas, JWT utilities, bcrypt for passwords. Frontend folder with React components, authentication context, login/signup forms, protected dashboard. Claude even added features not explicitly requested—responsive UI, comprehensive error handling, password complexity requirements, account lockout after failed attempts.
The catch? When testing, the MongoDB connection fails because no database exists yet. Claude created the schema file but can't spin up MongoDB itself. And the email verification doesn't work because no SMTP credentials exist in the .env file. These are infrastructure limitations, not code problems. The generated code is production-grade—proper async/await, parameterized queries, consistent error responses. But "production-ready" doesn't mean "production-deployed." You still need to audit, test, and provision infrastructure.
The instructor's verdict: Claude excels at greenfield projects where you need a proof-of-concept fast. Show your boss a working auth system in 30 minutes, get sign-off, then refactor or rebuild properly. But never ship AI-generated code without human security review, especially for authentication.
Managing Long Sessions: Context Limits and Recovery Strategies
The image optimization demo reveals Claude's context ceiling. Starting with a simple Flask app that resizes images, the instructor keeps adding features across a single session: quality sliders, format conversion, sharpen/blur controls, metadata stripping. Each addition works initially, but after ~2 hours and 50+ prompts, Claude starts hallucinating.
Symptom one: contradicting earlier decisions. Claude suggests changing the app port to 50001 because "port 5000 is blocked," then later claims it fixed 5000. Symptom two: suggesting solutions that don't match the error. When image sharpening fails with "float object cannot be interpreted as integer," Claude proposes a connection pooling fix. Symptom three: broken features. Adjusting brightness no longer works—Claude forgot how the preview system was supposed to function.
The instructor explains: "Don't try to do an entire project in one session. When you notice degraded performance, don't keep iterating—you're burning money and going in circles." The fix? Session notes. Create a markdown file documenting: what was built, what patterns were used, what problems were solved. Then exit Claude and restart. The new session reads session_notes.md and continues with fresh context.
Proof: after compacting the conversation (a feature that summarizes history but frees up context), Claude immediately performs better. When asked about database choice, it correctly states: "The app was designed as a stateless tool without any database." Context restored.
The rule of thumb: break work into logical chunks. Use session notes to bridge sessions. Start fresh for major refactors. Never assume Claude remembers everything from hours ago. And if you leave a session open for days, don't expect it to maintain context when you return—it won't.
Effective Prompting: Context-Action-Details-Examples (CADE)
The instructor contrasts two prompts. Bad: "Make a login screen." Claude asks clarifying questions, assumes Express (from folder name), starts building, then realizes there's nothing in the folder. Good: "Create a POST /api/auth/login endpoint using ExpressJS with the following requirements: Input needs email and password (both required, valid formats). Validate input using express-validator. Check if user exists in PostgreSQL database. Compare password using bcrypt. Generate JWT token with 24-hour expiration. Response should be success (200 with token) or failure (401/400 with message). Include error handling for database failures and validation errors."
The difference? Specificity eliminates guesswork. The good prompt follows CADE: Context (Express, PostgreSQL), Action (create login endpoint), Details (validation rules, error codes), Examples (success/failure responses). Claude generates exactly what you need—no clarifying questions, no generic boilerplate.
The instructor shares a time investment rule: "Spend 1 minute writing a good prompt, save 10 minutes of revision." Vague prompts create work downstream. "Add validation" becomes 5 iterations of "no, I meant email uniqueness and OWASP password standards." Starting specific avoids that loop.
Another tip: use ChatGPT or Gemini as a prompt engineer. Paste your prompt and ask: "How can I make this better?" The LLM will identify ambiguities you missed and suggest examples to include. This meta-prompting approach turns every LLM into a tool for improving prompts for other LLMs.
Three C's of good prompts: Clear (no ambiguity), Complete (all requirements stated), Contextual (relevant background included). And remember the Goldilocks zone—too vague, Claude guesses; too verbose, Claude gets confused. Just right is structured with examples, like showing Claude an existing endpoint and saying: "Follow this pattern."
Multifile Project Navigation and Targeted Changes
The Express login demo has multiple files: server.js (entry point), auth_routes.js (endpoints), database.js (connection pool), schema.sql (table definitions). The instructor demonstrates Claude's ability to reason across this structure. Prompt: "List our project structure and tell me: What are the main components? How are routes connected to controllers? What database are we using?"
Claude responds: "Main components: server.js mounts routes at /api/auth. auth_routes.js handles login via router. database.js provides PostgreSQL connection pool. Database: PostgreSQL with pg library, connection pooling, single users table with email index." This proves Claude isn't just reading files in isolation—it's tracing data flow and understanding architecture.
Next test: "I would like to change the database to MariaDB. What files might be affected?" Claude lists: schema.sql (needs MariaDB syntax), database.js (swap pg for mysql2), package.json (update dependencies), .env (new connection string format). It doesn't make changes yet, just identifies blast radius. This is invaluable for impact analysis before refactoring.
The instructor shows file-level control: "Add X to database.js" or "Refactor auth_routes.js to use async/await." Claude targets specific files. You can also protect files: "Do not modify schema.sql when making changes." If Claude needs to touch it, it asks permission first.
One gotcha: Claude uses claude.md as a memory file. If you delete it, Claude loses project context. Re-running `/init` rebuilds it, but any custom instructions you added ("always use const over let" or "follow Airbnb style guide") disappear. Solution: commit claude.md to git, treat it as living documentation.
Verification technique: "Verify these files were refactored: database.js, auth_routes.js, error_handler.js." Claude checks each, confirms changes match requirements, and flags any that were missed. This closes the loop on batch refactoring, ensuring nothing slips through.
Software Quality Audits: Architecture, Design Patterns, SOLID Principles
The instructor runs a series of prompts stored at github.com/jeremymorgan/claudecode-reviewing-prompts. First: architecture analysis. Prompt asks: "Is there clear separation of concerns? Which architectural pattern is used? Are there god objects? Rate modularity 1-10." Claude generates a 2,500-word report scoring the Express login app 3/10. Problems: "Business logic embedded in route handlers. No service layer. Direct database access in controllers. Violates MVC."
Second audit: design patterns. Claude identifies a singleton (database connection pool, correctly implemented) and a facade (Express router, well-structured). But it finds missing patterns: no factory for JWT tokens, no repository layer for data access, no strategy pattern for authentication (can't swap in OAuth without rewriting routes). For each missing pattern, Claude suggests: "Implement this because: testability, extensibility, maintainability." Not just academic patterns—practical reasons.
Third audit: SOLID principles. Single Responsibility? Violated. The login function does validation, authentication, database queries, JWT generation, error handling—79 lines, 8+ decision points. Open/Closed? Violated. Adding OAuth requires modifying core logic. Liskov Substitution? Limited (JavaScript's duck typing helps). Interface Segregation? Partially violated—route handlers depend on entire Express request/response objects when they only need specific properties. Dependency Inversion? Major violation. Routes import database directly, tightly coupling to PostgreSQL. Switching to MariaDB means rewriting routes.
Each violation gets: severity (1-10), location (file and line), explanation, remediation code snippet, estimated effort (hours). The report ends with a refactoring priority list: "Critically, immediately—extract authentication service, implement repository pattern. High priority—create error handler, extract JWT service. Medium priority—support multiple auth strategies."
The instructor's takeaway: AI-generated code follows patterns it's seen online. If bad code dominates GitHub examples, Claude learns bad habits. These audits catch what Claude's training data normalized. They turn "it compiles, ship it" into "it's maintainable, ship it."
Error Handling and Resilience Audits: Finding Production Landmines
The error handling audit reveals the Express app scores 3.5/10. Critical issue: no centralized error handler. Errors get console.logged in one route, thrown in another, returned as JSON in a third. No consistency. Medium issue: basic HTTP status codes (400, 401, 500, 503) but missing 403 Forbidden, 404 Not Found, 429 Too Many Requests. When rate limiting is added later, errors get dumped into generic 500s.
Async handling? Failing. "No unhandled promise rejection protection. Missing async wrapper middleware. Manual try-catch blocks everywhere." The risk: an unhandled rejection crashes the Node process. In production, one bad request brings down the entire service for all users. Remediation: global handlers for `unhandledRejection` and `uncaughtException` events, plus middleware that wraps async routes in try-catch.
Retry mechanisms? None. "No circuit breaker pattern. Database failures cascade." Example: database goes down for 2 seconds (transient issue). All incoming requests hit the same error, queue up, exhaust connection pool. When database recovers, the pool is dead—server restart required. A retry with exponential backoff would've succeeded on attempt 2 or 3. A circuit breaker would've failed fast, returned cached data, and prevented cascade.
Logging issues: "Full error objects logged, including database details. Sensitive information disclosure." An attacker reviews logs and learns: PostgreSQL 14.2, database name `auth_db`, table `users`, column `password_hash`. Perfect reconnaissance. The fix: structured logging with sanitization—log error codes and safe metadata, never stack traces or connection strings in production.
The exception flow audit traces errors end-to-end. "Database connection failure: pool.query throws → try/catch in route → switch statement on error code → 503 response OR console.error and crash." Inconsistent. Sometimes errors get caught, sometimes they crash the app. System state? Also inconsistent. Failed login attempts aren't tracked (account lockout impossible). No circuit breaker (database stays open during failures). No timeouts (hanging queries block forever).
The instructor emphasizes: these aren't academic concerns. These are production landmines. The first time you hit 10,000 concurrent users, these gaps become outages.
Code Complexity and Duplication: Refactoring for Humans and Machines
The complexity audit calculates cyclomatic complexity (decision points), cognitive complexity (human readability), lines of code, coupling, and cohesion. The login handler scores poorly: cyclomatic complexity of 12 (high), cognitive load of "conditionals three levels deep," 79 lines (exceeds 50-line threshold), eight dependencies.
Why does this matter? Testing. To achieve 100% code coverage, you'd need 2^12 test cases to cover all branches. That's 4,096 tests for one function. The fix: extract into smaller functions with single responsibilities. Each becomes testable in isolation. Claude suggests: `validateLoginInput()`, `authenticateUser()`, `generateToken()`, `handleLoginError()`. Now you have four functions with complexity 2-3 each—16 total tests instead of 4,096.
Coupling metrics: "5 external modules (Express, bcrypt, jsonwebtoken, pg, express-validator). Reasonable for an auth module." But the database coupling is direct—routes import `pool` and run SQL queries inline. This means routes can't be tested without a live database. Mocking becomes impossible. The fix: repository pattern with dependency injection. Routes depend on `AuthRepository` interface, tests inject `MockAuthRepository`, production injects `PostgresAuthRepository`.
The duplication audit finds minimal exact duplicates (good) but several near duplicates: error response patterns repeated across routes. Instead of four functions creating `{ success: false, error: 'message' }`, extract `createErrorResponse(message)` utility. Structural duplicates: consistent Express router patterns. As the app grows, consider a base router class to avoid repeating setup code.
Magic numbers: HTTP status codes hardcoded everywhere (400, 401, 500, 503). Extract to constants: `HTTP_STATUS = { BAD_REQUEST: 400, UNAUTHORIZED: 401 }`. Why? Maintainability. If you later decide 401 should be 403 for a specific case, you change one constant, not 15 scattered numbers.
The naming and readability audit scores 9/10 for variables (consistent camelCase, descriptive), 8/10 for functions (action-oriented, clear intent), but flags one issue: an anonymous async function in auth_routes.js. "Could benefit from named function for debugging purposes." When a debugger pauses inside, it shows "anonymous" instead of "loginHandler." Small change, big impact on developer experience.
Security Reviews: The Final Gate Before Production
The instructor previews the next module on security audits, noting they've already spotted issues in earlier audits: SQL injection points, timing attacks, exposed secrets in logs. A dedicated security audit would check: input sanitization (XSS prevention), parameterized queries (SQL injection), JWT secret validation, password complexity, rate limiting, HTTPS enforcement, session management, CORS configuration.
One example surfaces early: `SELECT * FROM users WHERE email = '${email}'`. Direct string interpolation. An attacker sends `admin@example.com' OR '1'='1`. Query becomes: `SELECT * FROM users WHERE email = 'admin@example.com' OR '1'='1'`, which returns all users. The attacker logs in as the first admin account without knowing the password.
Another: timing attacks. The login route hashes the provided password and compares it to the stored hash using `bcrypt.compare()`. If the email doesn't exist, the route returns immediately (1ms). If it exists but password is wrong, bcrypt takes 250ms. An attacker learns which emails are registered by timing response latency. Defense: always run bcrypt.compare(), even for non-existent users, against a dummy hash. Constant-time response.
The instructor stresses: "Do not generate production code with AI and ship it blindly. Audit by hand. Audit with these prompts. Then audit again with a human security expert." Claude can catch 80% of common vulnerabilities (OWASP Top 10), but novel attack vectors or business-logic flaws require human judgment.
The test coverage audit (run on code with zero tests) scores 0/10 and generates a remediation plan: Phase 1 (set up Jest), Phase 2 (unit tests for authentication), Phase 3 (integration tests for database), Phase 4 (end-to-end tests for full login flow), Phase 5 (edge cases: SQL injection, empty payloads, malformed JSON). The plan is actionable—copy it back into Claude and say: "Build the test suite." Within 20 minutes, you have scaffolding for comprehensive testing. Not perfect, but a foundation to build on.
Keep these ideas with you.
- Context-Action-Details-Examples (CADE) Framework
The instructor reveals a secret: AI-generated code quality depends more on your prompt than the AI itself. CADE is the formula. Context: "I have an Express API with MongoDB." Action: "Create a login endpoint." Details: "Validate with express-validator, hash passwords with bcrypt, return JWT with 24-hour expiration, handle 400/401/500 errors." Examples: "Success returns `{ token: 'abc123' }`, failure returns `{ error: 'Invalid credentials' }`." This structure eliminates guesswork. Claude doesn't assume—it builds exactly what you specified. The time rule: spend 1 minute crafting the prompt, save 10 minutes fixing vague results.
- Session Notes as Memory Files
Claude has massive context, but it's not infinite. After 50+ prompts in one session, the instructor watches Claude start hallucinating—contradicting earlier decisions, suggesting solutions that don't match errors. The fix: session notes. After each milestone, ask Claude: "Help me create a session_notes.md for this project." It documents what was built, what patterns were used, what problems were solved. When context gets bloated, exit Claude, restart, and type: "Read in session_notes.md and continue." Fresh context, same knowledge. The rule: don't try to do an entire project in one session. Break work into logical chunks, bridge them with notes.
- Vibe Coding vs. Production Readiness
Vibe coding is throwing a high-level idea at Claude and watching it generate a full app in minutes. The METAR weather reader demo proves this works—type a city, get decoded aviation weather. But the architectural audit scores it 3/10. Why? Business logic in routes, no service layer, no separation of concerns. It works, but it's a maintenance nightmare. The lesson: vibe code to prove concepts, get stakeholder buy-in, or scaffold greenfield projects. Then audit, refactor, and fortify. Never ship vibe-coded apps without human review, especially for authentication or anything handling sensitive data.
- The Circuit Breaker Pattern for Cascading Failures
Here's a production disaster scenario: your database hiccups for 2 seconds. Without circuit breakers, every incoming request hits the error, queues up, exhausts the connection pool. When the database recovers, your pool is dead—full restart required. A circuit breaker pattern stops this cascade. After 5 failures in 10 seconds, the breaker "opens"—requests fail immediately with cached data or a friendly error. After 30 seconds, it "half-opens" to test if the database is back. If successful, it "closes" and resumes normal operation. The audit found zero circuit breakers in the Express app. That's a production landmine.
- Magic Numbers Kill Maintainability
The duplication audit flags a subtle killer: magic numbers. HTTP status codes (400, 401, 500, 503) scattered across routes as raw integers. The problem? Six months later, you decide 401 should be 403 for a specific error case. You grep for "401" and find 15 occurrences—which ones need changing? Extract to constants: `HTTP_STATUS = { BAD_REQUEST: 400, UNAUTHORIZED: 401 }`. Now you change one line. Same with password length requirements (hardcoded 8), port numbers (hardcoded 3000), timeout values (hardcoded 5000ms). Magic numbers hide intent and multiply maintenance. One constant, infinite reuse.
- Cyclomatic Complexity and the 4,096 Test Problem
The login handler has cyclomatic complexity of 12—that's 12 decision points (if/else, switch cases). To achieve 100% test coverage, you'd need 2^12 test cases to cover all possible paths through the code. That's 4,096 tests for one function. Impossible to maintain. The fix: extract into smaller functions with single responsibilities. `validateLoginInput()`, `authenticateUser()`, `generateToken()`, `handleLoginError()`. Now you have four functions with complexity 2-3 each—16 total tests. Same functionality, 99.6% fewer tests. This is why the complexity audit matters: high complexity isn't just hard for humans to read, it's mathematically prohibitive to test.
- Timing Attacks and Constant-Time Responses
A subtle security hole: the login route returns immediately (1ms) if the email doesn't exist, but takes 250ms if it exists (bcrypt hashing time). An attacker sends 1,000 email attempts and measures response times. Fast responses (1ms) = invalid emails. Slow responses (250ms) = registered users. Now they know which accounts exist and can focus brute-force attacks. The defense: always run bcrypt.compare(), even for non-existent users, against a dummy hash. Every response takes ~250ms. Constant-time responses eliminate timing side-channels. The security audit would catch this—if you run it before shipping.
Turn the ideas into action.
For Managing AI Code Generation
Run architectural and SOLID audits immediately after Claude generates code, before writing a single new feature. The Express login app scored 3/10 on architecture and violated all five SOLID principles despite working perfectly in demos. These gaps become maintenance debt that compounds with every feature addition. Use the prompts at github.com/jeremymorgan/claudecode-reviewing-prompts to get actionable remediation plans with code snippets and effort estimates.
For Preventing Context Collapse
Implement session notes after every major milestone and restart Claude sessions every 2 hours or 40+ prompts, whichever comes first. The instructor demonstrates Claude hallucinating solutions after extended sessions—suggesting port changes for unrelated errors, contradicting earlier architecture decisions. Exit, save a session_notes.md documenting what was built and why, restart Claude, then type: 'Read in session_notes.md and continue.' Fresh context prevents circular debugging.
For Writing Effective Prompts
Structure every non-trivial prompt using CADE: Context (tech stack, existing code), Action (specific task with clear verb), Details (requirements, constraints, error codes), Examples (show desired output format). Before submitting, paste your prompt into ChatGPT and ask: 'How can I make this better?' The meta-LLM will identify ambiguities you missed. One minute of prompt refinement saves ten minutes of revision iterations.
For Production Readiness
Never ship AI-generated authentication, payment processing, or sensitive data handling without running security, error handling, and test coverage audits—then having a human review the results. The course reveals SQL injection points, timing attack vulnerabilities, and zero error handling in working code. Use the comprehensive audit prompts (architecture, SOLID, error handling, security) to get a multi-dimensional view of code quality before exposing it to real users.
For Refactoring Systematically
Prioritize refactoring based on severity scores from audits: critically address 9-10/10 issues (SQL injection, no error handlers, circular dependencies) before any feature work, tackle 7-8/10 issues (missing service layer, tight coupling) before the next sprint, and batch 4-6/10 issues (magic numbers, naming consistency) into dedicated refactoring sprints. Copy the remediation section from audit reports into Claude and say: 'Implement solution number four as suggested.'
The complete summary: 10 chapters, 7 takeaways and 5 actionable insights.
Summarised with AI by Bite, an AI YouTube video summarizer and podcast summarizer. Timestamps keep the source close; check important details against the original.
Original video on YouTube




