What is Claude Code?

Claude Code is an AI coding assistant that works through conversation. Instead of writing code yourself or copying snippets, you describe what you want in plain English, and Claude reads your project, proposes changes, and implements themβ€”all while keeping you in control.

Why Claude Code is Special

🧠 Understands Your Entire Project

Claude doesn't just edit one fileβ€”it reads your whole codebase, understands relationships between files, and makes changes that fit your existing patterns.

πŸ’¬ Conversational, Not Automated

You have a back-and-forth dialogue. Claude proposes what it will do, you approve or modify, and changes only happen with your consent.

πŸ“‹ Respects Your Rules

Through a CLAUDE.md file, you tell Claude your project's conventions, and it follows them automaticallyβ€”using your preferred frameworks, style guides, and patterns.

πŸ”§ Handles Multiple Files

Add a feature that needs changes across 5 files? Claude coordinates all edits, maintains consistency, and even writes tests if you've told it to.

Claude Code vs. Other AI Tools

Tool How It Works Best For
GitHub Copilot Autocompletes code as you type Writing individual functions quickly
ChatGPT / Claude.ai Answers questions, explains code Learning concepts, getting explanations
Claude Code Edits your actual project files through conversation Building features, refactoring, multi-file changes

When to Use Claude Code

⚠️ What Claude Code is NOT:
  • A "build my entire app" button (it's collaborative, not magical)
  • Fully autonomous (you review and approve everything)
  • A replacement for learning to code (it's a teaching tool too!)

How It Works (High-Level)

The Simple Version:

  1. You: Open terminal in your project folder
  2. You: Type claude "what you want"
  3. Claude: Reads your files and proposes a plan
  4. You: Review and approve (or ask for changes)
  5. Claude: Makes the edits
  6. You: Test the changes
  7. Claude: Offers to commit to Git
  8. You: Approve or reject the commit
βœ“ The Result: You get working, tested code that follows your project's conventions, without writing it all yourself. You stay in control, learn from watching Claude work, and move faster than coding alone.

Real-World Example

~/my-website$ claude "add a dark mode toggle"
I'll help you add dark mode. I'll need to: 1. Create a ThemeContext.js for theme state 2. Add toggle button to Header.jsx 3. Update App.css with dark mode styles 4. Persist preference in localStorage Should I proceed? (yes/no/modify)
> yes
βœ“ Created: src/context/ThemeContext.js βœ“ Modified: src/components/Header.jsx βœ“ Modified: src/App.css βœ“ Added: Dark mode styles and toggle logic Changes complete! Test by clicking the theme toggle in the header. Commit these changes? (yes/no)

Ready to understand the workflow in detail? Click the "The Workflow" tab aboveβ€”that's the heart of everything!

The Claude Code Workflow

This is the core. Understanding this workflow is everything. Claude Code is NOT autonomousβ€”it's a conversation with decision points where YOU stay in control.

Interactive Workflow Diagram

Click on any step to learn what happens at that stage:

Claude Code Workflow Click on steps to learn more $ claude "fix bug" Developer Task Claude Reads Project Claude Proposes Plan User Reviews Approve? βœ— Reject βœ“ Approve Claude Edits Files Claude Proposes Git Commit User Reviews Changes OK? βœ— Changes βœ“ Commit βœ“ Complete

How the Workflow Works

This diagram shows the complete Claude Code workflow from start to finish.

Key points:

  • βœ“ Green arrows = You approved
  • βœ— Red arrows = You rejected/requested changes
  • β—† Yellow diamonds = Decision points (you decide)

πŸ‘ˆ Click any step in the diagram to see details

Step Title

⚠️ Critical Understanding:
Claude Code is NOT autonomous. At the yellow diamond decision points, YOU decide what happens next. Claude proposes, you approve or reject. You are always in control.

Workflow Language Matters

❌ Wrong (Implies Autonomy) βœ“ Correct (Shows Control)
"Claude commits changes" "Claude proposes a commit (you decide)"
"Claude opens a PR" "Claude offers to create a PR (you approve)"
"Claude edits your files" "Claude shows proposed edits (you review)"
"Automated coding" "Conversational coding assistant"

What Makes This Special

Unlike GitHub Copilot (which autocompletes) or ChatGPT (which just answers questions), Claude Code:

Deep Dive: Each Step Explained

Step 1: Developer Gives Task

You communicate in plain English, not code. The quality of your request affects the quality of the response.

❌ Vague Requests

claude "fix it"
claude "make it better"
claude "add stuff"

Too vague - Claude can't help effectively

βœ“ Specific Requests

claude "fix the form submission bug on login page"
claude "add input validation to contact form"
claude "refactor UserService to use async/await"

Clear, specific, actionable

Step 2 & 3: Claude Reads & Proposes

This is where Claude's intelligence shines. It doesn't just look at one fileβ€”it understands your entire project context.

πŸ’‘ What Claude Analyzes:
  • File structure and architecture patterns
  • Existing code style and conventions
  • Dependencies between files
  • Your CLAUDE.md rules (if present)
  • Recent changes and git history
  • Test files and documentation

Decision Points: The Heart of Control

The yellow diamonds are where you maintain control. Here's what happens at each:

Decision Point 1: Approve the Plan

What you're reviewing: The proposed approach, which files will change, what will be added/modified

Your options:

  • "yes" - Proceed as proposed
  • "actually, [different approach]" - Modify the plan
  • "no, let me think about this" - Stop and reconsider
  • "can you explain why you're doing X?" - Ask for clarification

Decision Point 2: Approve the Changes

What you're reviewing: The actual code changes, diffs, commit message

Best practice: Always test before committing!

  • Run the application locally
  • Check that new features work
  • Verify no old features broke
  • Review the code quality

The Power of CLAUDE.md

This is THE SECRET to getting consistent, high-quality results from Claude Code. Think of it as your project's constitutionβ€”rules Claude must follow.

Example CLAUDE.md for a Hospital Management System

# Hospital Management System

## Project Overview
HIPAA-compliant patient records system
Stack: React 18, Node.js 20, PostgreSQL, TypeScript

## Code Style Rules
- **Language**: TypeScript for ALL new code
- **Functions**: Must have JSDoc comments
- **Async**: Use async/await, NOT .then()
- **Logging**: NO console.log in production
- **Naming**: camelCase for functions, PascalCase for components

## File Structure
/src
  /components - React components (functional only)
  /hooks - Custom React hooks
  /api - API endpoint handlers
  /models - Database schemas (Prisma)
  /utils - Pure utility functions
  /tests - Test files (required for all features)

## Testing Requirements
- Every new feature MUST have tests
- Run `npm test` before committing
- Minimum 80% code coverage
- Use React Testing Library for components

## Security Rules
- All patient data encrypted at rest
- Never log PHI (Protected Health Information)
- All API calls require authentication
- Use environment variables for secrets

## Git Workflow
- Branch naming: `feature/description` or `fix/description`
- Commit messages: Imperative mood ("Add", not "Added")
- Create PRs from feature branches to `develop`
- Never commit directly to `main`

## API Conventions
- RESTful endpoints
- Use proper HTTP status codes
- Return errors in consistent format:
  ```json
  {
    "error": "Error message",
    "code": "ERROR_CODE"
  }
  ```

## Database
- Use Prisma migrations for schema changes
- Never do raw SQL queries
- All queries must use parameterization
- Add indexes for frequently queried fields

## Don't Do This
- Don't use `any` type in TypeScript
- Don't bypass authentication checks
- Don't store passwords in plain text
- Don't use inline styles in React
βœ“ With this CLAUDE.md, Claude will automatically:
  • Write in TypeScript, not JavaScript
  • Add JSDoc comments to every function
  • Create test files alongside features
  • Follow your naming conventions
  • Avoid security mistakes
  • Use your project's error format
  • Never use prohibited patterns

Conversational Flow: Real Examples

Claude Code is conversational, not transactional. Here's how real interactions unfold:

Example: Iterative Refinement

$ claude "add user profile pictures"
I can add profile picture support. Plan: 1. Upload component in ProfileSettings.jsx 2. API endpoint: POST /api/users/avatar 3. Update User model for avatar URLs 4. Use AWS S3 for storage (from your CLAUDE.md) Proceed? (yes/no/modify)
> use local storage instead of S3
Updated plan: 1. Upload component (same) 2. API endpoint saving to /uploads folder 3. Update User model (same) 4. Use multer for local file handling 5. Add .gitignore entry for /uploads Better? (yes/no)
> yes
βœ“ Created: src/components/AvatarUpload.jsx βœ“ Modified: src/pages/ProfileSettings.jsx βœ“ Created: server/routes/avatar.js βœ“ Modified: server/models/User.js βœ“ Created: server/middleware/upload.js βœ“ Updated: .gitignore Complete! Test at /profile/settings

Example: Debugging Together

$ claude "login form isn't working"
Let me investigate the login form... Found potential issues: 1. LoginForm.jsx line 23: Missing event.preventDefault() 2. auth.service.js line 45: Token not being saved 3. Login button has type="button" (should be "submit") Which would you like me to fix? (all/specific numbers/let me test first)
> fix all three
βœ“ Fixed: event.preventDefault() added βœ“ Fixed: Token now saved to localStorage βœ“ Fixed: Button type changed to "submit" Test the login now. If it still doesn't work, let me know what error you see.

Best Practices & Recommendations

βœ“ Do This

  • Create CLAUDE.md before starting
  • Be specific in your requests
  • Test changes before committing
  • Review diffs carefully
  • Ask Claude to explain changes
  • Iterate through conversation
  • Use Claude for understanding code

βœ— Avoid This

  • βœ— Vague requests like "make it better"
  • βœ— Committing without testing
  • βœ— Running in wrong directory
  • βœ— Expecting perfection first try
  • βœ— Not reviewing proposed changes
  • βœ— Blindly accepting all suggestions

Common Pitfalls & How to Avoid Them

Pitfall #1: "Claude broke my code!"

What happened: You approved changes without testing, or without understanding what changed.

Solution:

  • Always ask "can you show me a diff?" before committing
  • Test the changes locally first
  • Ask Claude to explain what changed and why
  • Use git to revert if needed: git reset --hard HEAD~1

Pitfall #2: "Claude isn't following my style"

What happened: You don't have a CLAUDE.md file, so Claude guesses.

Solution:

  • Create a CLAUDE.md in your project root
  • Document your conventions clearly
  • Be specific: "Use Prettier with 2-space tabs" not "use good formatting"

Pitfall #3: "Claude made changes I didn't ask for"

What happened: Claude made reasonable but unintended changes.

Solution:

  • Review the proposed plan carefully at Decision Point 1
  • Ask: "Why are you changing file X?"
  • Be explicit: "Only modify the login form, don't touch anything else"

Pitfall #4: "I don't understand what Claude did"

What happened: The changes are complex and you need clarification.

Solution:

  • Ask: claude "explain the changes you just made"
  • Ask: claude "why did you use approach X instead of Y?"
  • Claude is a teaching toolβ€”use it to learn!

Advanced Tips for Power Users

Tip 1: Chain Multiple Tasks

claude "add dark mode, then add a settings page where users can toggle it, then persist the preference in localStorage"

Claude will break this into steps and execute sequentially.

Tip 2: Ask for Alternatives

claude "what are three different ways to implement user authentication?"

Then choose the approach you prefer before implementing.

Tip 3: Use Claude for Code Review

claude "review the UserService.js file for potential bugs and suggest improvements"

Get AI-powered code review before merging.

Tip 4: Document as You Go

claude "add JSDoc comments to all functions in this file"

Keep your code documented automatically.

Measuring Success

You're using Claude Code effectively when:

⚠️ Red Flags:
  • You're approving everything without reading
  • You don't know what code is doing
  • You're committing untested changes
  • Claude keeps making the same style mistakes
  • You're treating Claude as "magic" instead of a tool
If you see these patterns, slow down and review your workflow!

Now that you understand the workflow deeply, let's see it in action! Continue to "Your First Run" to walk through a complete real-world example.

Terminal Basics

Quick prerequisite: Claude Code runs in the terminal. If you've never used a terminal before, this 5-minute crash course will teach you everything you need.

What is a Terminal?

A terminal is a text-based interface where you type commands instead of clicking. Think of it as having a conversation with your computer using precise instructions.

πŸ’‘ Why use a terminal?
Terminals are powerful for development because they allow you to automate tasks, access advanced features, and use tools like Claude Code.

How to Open a Terminal

πŸͺŸ Windows

Press Win + R, type cmd, press Enter

Or search "Command Prompt" in Start Menu

🍎 macOS

Press Cmd + Space, type terminal, press Enter

Or find "Terminal" in Applications β†’ Utilities

🐧 Linux

Press Ctrl + Alt + T

Or search "Terminal" in applications

Essential Commands (Only 3!)

1. Where am I?

$ pwd
/Users/yourname/projects

pwd = "print working directory" - shows your current location

2. What's in this folder?

$ ls
Documents Desktop my-project

ls (Mac/Linux) or dir (Windows) - lists files and folders

3. Move to a different folder

$ cd my-project
~/my-project$

cd = "change directory" - moves you into a folder

⚠️ Most Important Concept:
Commands run in your current location. Before running claude "...", use pwd to confirm you're in your project folder!

Quick Cheat Sheet

What You Want Command
See where you are pwd
List files here ls (Mac/Linux) or dir (Windows)
Go into a folder cd folder-name
Go up one level cd ..
Go to home folder cd ~
βœ“ That's it! You now know enough terminal basics to use Claude Code. Just remember: pwd to check location, cd to move around, ls to see what's there.

Folder Navigation

Why this matters: Claude Code works on files in your current directory. If you're in the wrong folder, it won't see your project files!

Understanding File Structure

πŸ“ Home
β”œβ”€β”€ πŸ“ Documents
β”‚   └── πŸ“ Projects
β”‚       β”œβ”€β”€ πŸ“ my-website  πŸ‘ˆ You want to be HERE
β”‚       β”‚   β”œβ”€β”€ πŸ“„ index.html
β”‚       β”‚   β”œβ”€β”€ πŸ“„ style.css
β”‚       β”‚   └── πŸ“„ script.js
β”‚       └── πŸ“ another-project
β”œβ”€β”€ πŸ“ Desktop
└── πŸ“ Downloads

Navigating to Your Project

Step-by-step:

~$ pwd
/Users/yourname
~$ cd Documents/Projects/my-website
~/Documents/Projects/my-website$ pwd
/Users/yourname/Documents/Projects/my-website
βœ“ Now you're ready to use Claude Code!
⚠️ Common Mistake:
Running claude from the wrong folder is the #1 beginner error. Always verify with pwd and ls before proceeding!

Shortcut: Open Terminal in Folder

Windows

  1. Open File Explorer
  2. Navigate to your project folder
  3. Click in the address bar
  4. Type cmd, press Enter

macOS

  1. Open Finder
  2. Navigate to project folder
  3. Right-click folder
  4. Select "New Terminal at Folder"

Your First Claude Code Experience

Let's walk through a complete real-world example: Adding a contact form to a simple website. You'll see every step of the workflow in action.

1Navigate to Your Project

Your project:

my-website/
β”œβ”€β”€ index.html
β”œβ”€β”€ about.html
β”œβ”€β”€ style.css
└── script.js
$ cd ~/projects/my-website
~/my-website$ ls
index.html about.html style.css script.js
βœ“ Confirmed! You're in the right place.

2Give Claude Your Task

~/my-website$ claude "add a contact form to the website"
I'll help you add a contact form. Let me analyze your project... I can add a contact form by: 1. Creating contact.html - new page with form 2. Updating index.html & about.html - add navigation links 3. Updating style.css - add form styling 4. Updating script.js - add validation & submission handling Should I proceed? (yes/no/modify)

3Modify the Plan (Optional)

> actually, add the form to about.html instead of a new page
Great idea! Updated plan: 1. Modify about.html - add contact form at bottom 2. Update style.css - add form styling 3. Update script.js - add validation Proceed with this? (yes/no)
> yes

4Claude Makes Changes

✏️ Modified: about.html + Added contact form (lines 45-67) ✏️ Modified: style.css + Added form styles (lines 89-125) ✏️ Modified: script.js + Added validateContactForm() + Added handleFormSubmit() βœ“ All changes complete! Would you like to see a diff? (yes/no)

5Test Before Committing

> wait, let me test first
Of course! Open about.html in your browser. I'll wait hereβ€”let me know if adjustments are needed!

You test in the browser... it works perfectly!

6Commit the Changes

> looks great! commit it
I'll commit with this message: "Add contact form to about page - Add form HTML with name, email, message fields - Style form with mobile-responsive CSS - Implement client-side validation - Handle submission with success message" Commit? (yes/no/edit message)
> yes
βœ“ Committed successfully! [main f8d3c21] Add contact form to about page 3 files changed, 87 insertions(+), 5 deletions(-) Anything else I can help with?
πŸŽ‰ Congratulations! You just completed your first Claude Code workflow. Notice how YOU:
  • Described what you wanted in plain English
  • Modified the plan to fit your needs
  • Tested before committing
  • Reviewed and approved the commit message
  • Stayed in control at every decision point

Common Follow-Up Commands

Make Adjustments

$ claude "form button too small on mobile"

Add Features

$ claude "add phone field to form"

Get Explanations

$ claude "explain the validation logic"

Tips for Success

πŸ’‘ Next Steps:
  • Try Claude Code on a real project
  • Create a CLAUDE.md file with your project rules
  • Experiment with different types of requests
  • Use Claude to explain unfamiliar code