Master
Claude Code
Everything in the official docs — turned into hands-on practical knowledge with real commands, real examples, and zero fluff. Made for students and junior devs starting from scratch.
Installation & Setup
You need a Claude.ai or Anthropic Console account. Then pick your OS below. The entire process takes under 5 minutes.
Sign up at claude.ai (recommended for individuals) or console.anthropic.com (for API/teams). You'll log in on first run — credentials are stored automatically after that.
Recommended. Auto-updates in the background. Works on any Mac or Linux terminal.
Requires Git for Windows — download it first from git-scm.com/downloads/win
Requires Node.js 18 or newer. Check with node --version
Prefer a GUI? Install the VS Code extension — no terminal needed to get started.
Open Extensions Panel
Press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux)
Search "Claude Code"
Find the extension by Anthropic. Click Install. Also works in Cursor IDE.
Open Claude Code
Press Cmd+Shift+P, type "Claude Code", select "Open in New Tab".
Zero install. Open your browser and go. Great for quick tasks or working on repos you don't have locally.
Go to claude.ai/code in any desktop browser or the Claude iOS app. Requires a paid Claude.ai subscription. Start async tasks and come back when done.
Your First Session
Once Claude Code is installed, here are the first 8 things to try. These cover 90% of daily use.
Start Claude Code in any project
Navigate to any project folder and type claude. You'll see a welcome screen with recent conversations and updates.
Ask what the project does
Claude reads your files as needed — you don't need to paste anything manually.
Make your first code change
Claude always shows proposed changes and asks for approval before editing any files.
Use Git with Claude
Claude Code works conversationally with git — no need to remember commands.
Fix bugs with error messages
Paste any error or describe the symptom. Claude traces through your code to find the root cause.
Write tests
Refactor code
Key keyboard shortcuts
? — show shortcutsTab — command completion↑ — command history/ — see slash commandsShift+Tab — cycle permission modesCtrl+C — exit / cancelCommon Workflows
Real step-by-step workflows from the official docs. Each includes the exact prompts to type and what to expect back.
🔍 Understand New Codebases
Just joined a new team? First day on a project? Use this to get up to speed in minutes.
Start with broad questions, then narrow down. Ask for a glossary of project-specific terms. Use domain language from the project for better results.
🐛 Fix Bugs Efficiently
Paste the error. Let Claude trace it. Ask "why" not just "fix it" — that's how you grow.
Tell Claude the exact command to reproduce the issue. Mention if the error is intermittent or consistent. Include the full stack trace — not just the error message.
🧪 Write Tests
From "find uncovered code" to "run and fix" — all in one conversation.
♻️ Refactor Code
Always request that changes maintain backward compatibility when needed. Do refactoring in small, testable increments. Ask Claude to explain the benefits of the modern approach.
🔀 Git & Pull Requests
🖼️ Work With Images
Drag in a screenshot, mockup, or diagram and Claude can analyze it and generate code from it.
Memory & CLAUDE.md
Claude Code can remember your preferences across sessions — coding styles, common commands, team rules. You control what it remembers and where it's stored.
4 Memory Types — Understand the Hierarchy
| Type | File Location | Shared With | Use For |
|---|---|---|---|
| Enterprise Policy | /Library/Application Support/ClaudeCode/CLAUDE.md (macOS) /etc/claude-code/CLAUDE.md (Linux) | All users in org | Company-wide coding standards, security policies |
| Project Memory | ./CLAUDE.md or ./.claude/CLAUDE.md | Team (via git) | Project architecture, team conventions, workflows |
| User Memory | ~/.claude/CLAUDE.md | Just you (all projects) | Personal style preferences, shortcuts |
| Local Project | ./CLAUDE.local.md | Just you (this project) | Your sandbox URLs, test data, local paths |
CLAUDE.local.md is automatically added to .gitignore — perfect for personal preferences that shouldn't be committed to the repo.
Working with Memory
Example CLAUDE.md File
Slash Commands
Type / in any session to see all available commands. Here are the most useful ones.
| Command | What It Does | When To Use |
|---|---|---|
| /help | Show all commands and keyboard shortcuts | First thing to try anytime |
| /clear | Clear conversation history (free up context) | Starting a new unrelated task |
| /init | Bootstrap a CLAUDE.md for this project | First time using in a project |
| /memory | Open memory files in your editor | Update preferences and project rules |
| /resume | Pick a previous conversation to continue | Coming back to unfinished work |
| /login | Log in or switch accounts | Switching between work/personal accounts |
| /mcp | Show and manage MCP server connections | Connecting to GitHub, Sentry, databases |
| /agents | View, create, and manage subagents | Setting up specialized AI assistants |
Create Your Own Slash Commands
Create repeatable workflows as Markdown files. They become slash commands automatically.
Plan Mode
Plan Mode lets Claude analyze your codebase with read-only operations — no files get changed. Perfect before making big changes or learning a new codebase.
Add to .claude/settings.json: {"permissions": {"defaultMode": "plan"}} — useful for teams that want to review all changes before they happen.
MCP — Connect External Tools
Model Context Protocol (MCP) is an open standard that lets Claude Code connect to hundreds of external tools — GitHub, Sentry, databases, Slack, Figma, Jira, and more.
What You Can Do With MCP
Installing MCP Servers
HTTP is recommended for cloud-based services. Most popular MCP servers use this transport.
stdio servers run locally on your machine — great for tools needing direct system access.
Use third-party MCP servers at your own risk — Anthropic has not verified all of them. Be especially careful with servers that could fetch untrusted content (prompt injection risk). Only install MCP servers you trust.
Subagents — AI Specialists
Subagents are specialized AI personalities Claude Code can delegate tasks to. Each has its own context window, tools, and expertise — like a team of specialists.
Built-In Subagents
Used automatically when Claude needs to search your codebase without making changes. Strictly read-only — uses Glob, Grep, Read, and limited Bash commands. Multiple thoroughness levels: Quick → Medium → Very Thorough.
For complex multi-step tasks requiring both exploration and file modification. Has access to all tools. Used when tasks involve multiple steps that depend on each other.
Used automatically in Plan Mode to research your codebase before presenting a plan. Can explore files but cannot execute changes.
Create Your Own Subagents
Add "Use PROACTIVELY" or "MUST BE USED" in your agent's description field to encourage Claude to delegate automatically without being asked explicitly.
Hooks — Auto-Trigger Actions
Hooks let you run shell commands automatically before or after Claude Code performs certain actions. Think of them as event listeners for your coding workflow.
Example Hooks Config
Headless Mode & Scripting
Claude Code is composable and scriptable. Pipe data in, pipe results out. Integrate into CI/CD. Chain with other Unix tools.
GitHub Actions Integration
Tag @claude in any PR or issue comment — Claude will analyze, implement, fix bugs, and open PRs automatically. All without leaving GitHub.
What Claude Can Do in GitHub
Quick Setup
Basic Workflow File
How to Use in Comments
⚡ Git Worktrees — Parallel Sessions
Need to work on a bugfix AND a feature at the same time? Git worktrees give each Claude session its own isolated code copy.
Full Cheatsheet
Every command, flag, and prompt you'll need. Save this page or bookmark it.
CLI Commands
| Command | What It Does | Example |
|---|---|---|
| claude | Start interactive mode | cd my-project && claude |
| claude "task" | Run one-time task | claude "fix the build error" |
| claude -p "query" | One-off query, then exit | claude -p "explain this function" |
| claude -c | Continue most recent conversation | claude -c |
| claude -r | Resume a conversation (picker) | claude -r |
| claude commit | Create a git commit | claude commit |
| claude --permission-mode plan | Start in Plan Mode (read-only) | claude --permission-mode plan |
| claude mcp add | Add an MCP server | claude mcp add --transport http github https://... |
| claude mcp list | List connected MCP servers | claude mcp list |
High-Value Prompts by Category
give me an overview of this codebaseOnboarding magic. Works on any project. Gets you up to speed in minutes.
find the files that handle [feature]Code discovery. "find the files that handle user authentication" — then drill down.
trace [process] from front-end to databaseEnd-to-end understanding. Trace the login process. Trace the checkout flow.
explain the logic in @src/utils/auth.jsFile-specific explanation. The @ symbol inlines the file content automatically.
fix the bug and explain what caused itLearn while fixing. Don't just fix — understand why it broke. This is how you improve.
suggest a few ways to fix [issue]Options before committing. See multiple approaches before Claude edits anything.
add [feature] following the existing code styleStyle-consistent features. Claude reads your patterns and matches them exactly.
find functions without tests and write themInstant coverage. Claude finds uncovered code AND writes the tests in one go.
run the tests and fix any failuresSelf-healing tests. Claude runs, reads the errors, and fixes them autonomously.
review my git diff for bugs and security issuesPre-push safety check. Catches what you'd miss. Run before every commit.
commit my changes with a good messagePerfect git commits. Stages files and writes conventional commit messages automatically.
create a pr with a full descriptionAuto PR writing. Branch, commit, push, and open a complete PR with context.
refactor [file] — don't change behaviorClean up safely. Improves readability while preserving the same functionality.
think hard about [complex problem]Extended thinking. "think" = basic, "think hard" = deep, "think a lot" = maximum depth.
# always use 2-space indentationQuick memory save. Start with # to instantly save a preference to CLAUDE.md.
Common Mistakes
These are the exact mistakes every junior dev makes in their first weeks with Claude Code. Learn them now.
Too vague. Claude doesn't know what's broken, where, or what "fixed" looks like.
Specific file, line, symptom, and expected behavior. Claude nails it first try.
Too broad. Claude does better with focused, clear scope per request.
Small, focused scope + reference existing patterns = high-quality output.
You're responsible for code in your repo. Blindly accepting leads to issues at review time.
Understanding changes makes you a better developer AND protects you at code review.
Claude is good but not perfect. Always verify changes work in your actual environment.
Ask Claude to test too — it can run your test suite and fix failures automatically.
Each new session loses context. Claude doesn't know your project anymore.
A long session where Claude knows your whole project is 10x more powerful.
30-Day Roadmap
Follow this plan and in one month you'll go from "just installed it" to power user level.
Week 1 — Install, Explore, Understand
Get Claude Code running. Spend the whole week just asking it to explain codebases — yours, open source projects, tutorials. Use /init on one project. Get comfortable with the conversation flow. Don't worry about making changes yet.
Week 2 — Debug & Fix Bugs
Find a bug in something you're working on — or create one intentionally — and use Claude to trace and fix it. Always ask "explain what caused it" to learn. Try pasting error messages. Try the Plan Mode exploration approach first.
Week 3 — Build Features & PRs
Use Claude to implement a real feature from your backlog. Practice the plan-then-build workflow. Always run Claude's code review before pushing. Get your first Claude-assisted PR merged.
Week 4 — Tests, Memory & Automation
Write tests for a module that has poor coverage. Set up a CLAUDE.md for your project. Try connecting one MCP server (GitHub or Sentry). Set up a GitHub Action. Create one custom subagent.
Day 30 — Power User Status
You now use Claude Code without thinking about it. You ship features faster, write better code, have better test coverage, and understand new codebases in minutes. You're using memory, agents, and MCP. You look like a senior dev.