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
- Adding new features: "Add user authentication with password reset"
- Debugging: "The form isn't submittingβcan you find and fix the issue?"
- Refactoring: "Convert this class component to a functional component with hooks"
- Understanding code: "Explain how the payment processing works in this project"
- Writing tests: "Add unit tests for the UserService class"
- 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:
- You: Open terminal in your project folder
- You: Type
claude "what you want"
- Claude: Reads your files and proposes a plan
- You: Review and approve (or ask for changes)
- Claude: Makes the edits
- You: Test the changes
- Claude: Offers to commit to Git
- You: Approve or reject the commit
Real-World Example
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:
Step Title
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:
- Works on your actual project files
- Coordinates changes across multiple files
- Shows you what it will do before doing it
- Lets you modify the plan mid-conversation
- Maintains your code style and follows your CLAUDE.md rules
- Helps you understand what changed and why
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
Too vague - Claude can't help effectively
β Specific Requests
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.
- 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
- 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
Example: Debugging Together
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 will break this into steps and execute sequentially.
Tip 2: Ask for Alternatives
Then choose the approach you prefer before implementing.
Tip 3: Use Claude for Code Review
Get AI-powered code review before merging.
Tip 4: Document as You Go
Keep your code documented automatically.
Measuring Success
You're using Claude Code effectively when:
- You understand every change before it's committed
- Your commit history is clean and meaningful
- Claude follows your project conventions consistently
- You're learning from Claude's implementations
- You're moving faster than coding alone, but not blindly
- You catch issues during review, not after deployment
- 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
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.
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
= "print working directory" - shows your current location
2. What's in this folder?
ls
(Mac/Linux) or dir
(Windows) - lists files and folders
3. Move to a different folder
cd
= "change directory" - moves you into a folder
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 ~ |
pwd
to check location, cd
to move around, ls
to see what's there.
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
2Give Claude Your Task
3Modify the Plan (Optional)
4Claude Makes Changes
5Test Before Committing
You test in the browser... it works perfectly!
6Commit the Changes
- 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
Add Features
Get Explanations
Tips for Success
- Be specific: Good: "Add contact form with name, email, message" / Bad: "add a form"
- Test everything: Always verify changes work before committing
- Use CLAUDE.md: Document your project conventions so Claude follows them
- Ask questions: Claude can explain code, not just write it
- Iterate: Refine through conversationβperfection comes from dialogue
- 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