# Claude Code - Beginner's Guide
*Easy-to-understand notes from Claude 301 Training*

## What is Claude Code?

Claude Code is an AI assistant that helps you write, understand, and improve computer code. Think of it as a smart coding partner that can work alongside you 24/7.

---

## Key Capabilities

### What Claude Code Can Do:
- **Understand large projects** - Read and explain how your code works
- **Write code automatically** - Create new features based on your description
- **Fix bugs** - Find and repair problems in your code
- **Run tests** - Check if code works correctly
- **Work independently** - Complete tasks on its own for long periods

### Beyond Just Coding:
- Data analysis and engineering
- System maintenance (Site Reliability Engineering)
- Helping with data science tasks

---

## Getting Started

### 1. Claude.md File - Your Personal Instructions
Think of this as a instruction manual you write for Claude about your project.

**What to include:**
- How your team likes to work
- Coding rules and best practices
- Business-specific terms that Claude might not know
- High-level overview of your project structure

**Pro Tips:**
- Save these files in your project folders
- Create multiple files for different parts of your project
- Use `/init` command to have Claude create a starter file
- Keep it concise - don't overload with too much detail

---

## Important Features

### Plan Mode vs. Auto Mode
**Plan Mode** (Shift + Tab to toggle):
- Claude thinks through the problem first
- Creates a to-do list
- Asks for your approval before starting work
- **Best for:** Complex tasks where you want oversight

**Auto Mode:**
- Claude works independently and makes changes automatically
- **Best for:** Simple, repetitive tasks

### Extended Thinking (Tab to toggle)
- Gives Claude extra time to "think" before acting
- Use keywords like "think carefully," "consider all options"
- **Best used with Plan Mode for complex problems**

### Checkpoints (Press Escape twice)
- Like an "undo" button for Claude's work
- Automatically saves your code state before changes
- Roll back if Claude goes down the wrong path
- No need to manually save - it's automatic!

---

## Advanced Features (Made Simple)

### 1. Subagents
**What they are:** Specialized helpers for specific jobs

**Think of it like this:**
- Main Claude = General contractor
- Subagents = Specialized workers (electrician, plumber, etc.)

**Examples:**
- Build Validator: Checks if code builds correctly
- Test Runner: Runs all your tests
- Code Architect: Plans complex features

**When to use:** When you have specialized tasks that need focused attention

### 2. Hooks
**What they are:** Automatic actions triggered at specific times

**Think of it like this:** Setting automatic reminders or actions

**Examples:**
- Auto-format code after Claude makes changes
- Get notified when a task completes
- Run safety checks before Claude does certain actions

### 3. Custom Slash Commands
**What they are:** Shortcuts for tasks you do frequently

**Think of it like this:** Keyboard shortcuts on your phone

**Example:** Instead of typing "Please review this code for bugs and suggest improvements," you create `/review`

### 4. Plugins
**What they are:** Bundles of settings you can share with your team

**Think of it like this:** Recipe kits that include all ingredients and instructions

Share your subagents, hooks, and custom commands with teammates in one package.

---

## Best Practices for Success

### Phase 1: Understanding Your Code (Discovery)
✅ Ask Claude to explain how features work
✅ Use it to learn unfamiliar parts of a project
✅ Great for onboarding new team members

### Phase 2: Planning (Design)
✅ Write good design documents first (still important!)
✅ Let Claude help brainstorm edge cases
✅ Use Plan Mode + Extended Thinking for complex features

### Phase 3: Building (Implementation)
✅ **Test-Driven Development is KEY:** Write tests first, then code
  - Without tests: Claude might miss edge cases
  - With tests: Dramatically better success rate (up to 100%!)
✅ Give Claude validation criteria to check its own work

### Phase 4: Managing Context
**Why it matters:** Like a person, Claude performs better with focused, relevant information

**How to manage:**
- Use `/compaction` to summarize and compress conversations
- Use subagents for specialized tasks (keeps context clean)
- Don't ask Claude to read every file - be selective
- Let Claude create its own memory files for complex plans

---

## Common Problems & Solutions

### Problem 1: Claude Being Too Agreeable
**Issue:** Claude says "you're absolutely right" even when you're wrong
**Solution:**
- Add instruction in Claude.md to challenge your assumptions
- Ask it to act like a "difficult code reviewer"
- This is being improved in future versions

### Problem 2: Incomplete Understanding
**Issue:** Claude proceeds without fully understanding the task
**Solution:**
- Spend time in Plan Mode refining the approach
- Give it business context it might not know
- Provide design documents for complex features

### Problem 3: Creating Too Many Files
**Issue:** Claude creates duplicate or unnecessary files
**Solution:**
- Prompt it to stop when you notice this happening
- This is being improved in newer versions

### Problem 4: "Reward Hacking"
**Issue:** Claude gives up and comments out failing tests instead of fixing them
**Solution:**
- Use Ultra Think mode
- Nudge it to not be lazy
- Provide encouragement to solve the problem properly

---

## Helpful Commands

| Command | What It Does |
|---------|-------------|
| `/init` | Creates a starter Claude.md file |
| `/compaction` | Compresses conversation to save space |
| Shift + Tab | Toggle Plan Mode on/off |
| Tab | Toggle Extended Thinking on/off |
| Escape (twice) | Rewind/undo Claude's recent work |
| `/agents` | Configure specialized subagents |
| `/memory` | Add important info to remember |

---

## Integration Options

### Where You Can Use Claude Code:
1. **Terminal** - Command line interface (original way)
2. **VS Code** - Sidebar panel in your code editor (newest!)
3. **JetBrains IDEs** - Works with IntelliJ, PyCharm, etc.
4. **GitHub Actions** - Tag Claude for PR reviews
5. **Custom Apps** - Use Claude Agents SDK to embed in your tools

---

## Latest Updates

### Claude 4.5 Sonnet (Latest Model - October 2024)
- Best coding model available
- Better at reasoning and understanding context
- Improved at long-running autonomous tasks
- Better debugging capabilities

### Recent Features:
- **Checkpoints** - Rollback functionality
- **Plugins** - Share configurations easily
- **VS Code Native Integration** - Smoother IDE experience

---

## Tips for Non-Technical People

### How to Talk to Claude:
- Be clear and specific about what you want
- Don't worry about using perfect technical terms
- Ask Claude to explain things if confused
- It's okay to say "I don't understand, explain simpler"

### When to Use Claude:
- Understanding what existing code does
- Creating new features from descriptions
- Finding and fixing bugs
- Learning how a project works

### When to Be Careful:
- Always review Claude's work (it's an assistant, not a replacement)
- Use Plan Mode for important tasks
- Double-check before deploying to production
- Ask questions if something doesn't look right

---

## Resources for Learning More

**Official Documentation:**
- https://docs.anthropic.com/en/docs/claude-code/overview
- https://docs.anthropic.com/en/docs/claude-code/common-workflows

**Stay Updated:**
- Check GitHub changelog
- Follow Anthropic team on social media (Cat, Boris, Alex Albert, Tharik)
- Release notes on documentation site

**Getting Help:**
- Use `/help` command in Claude Code
- Submit feedback/issues on GitHub

---

## Remember:

🎯 **Start Simple:** Begin with basic tasks and gradually work up to complex ones

🧪 **Use Tests:** Writing tests first dramatically improves Claude's success rate

📝 **Plan First:** Use Plan Mode for anything complex - review before letting Claude proceed

💾 **Save Checkpoints:** Don't worry about breaking things - you can always rewind

🤝 **It's a Partnership:** Claude is a powerful assistant, but you're still the developer in charge

---

*These notes are based on the Claude 301 Training webinar by Rashheel from Anthropic's Applied AI team*
