Claude Code for Beginners: The Complete 2026 Guide
Learn Claude Code from scratch β installation, CLAUDE.md setup, Plan Mode, context management, custom commands, hooks, pricing, and 6 power-user tips that make you dangerous with AI-assisted engineering.
Claude Code β Agentic AI for Engineers
Launched February 2025. Reached $1 billion in annualized revenue by mid-2025. Not autocomplete β a reasoning partner that reads your entire codebase and executes multi-step changes.
What Is Claude Code?
Claude Code is Anthropic's terminal-native agentic coding assistant. Unlike GitHub Copilot (which autocompletes your next line), Claude Code reasons about your entire project, plans an approach, executes multi-file changes, runs your tests, and iterates β all from your terminal.
It has a 200,000-token context window β large enough to hold 50+ files simultaneously. When you ask it to "add JWT auth to the API", it doesn't guess. It reads your project structure, finds the relevant files, understands your conventions, then makes all the changes correctly.
Claude Code vs The Competition
| Feature | Claude Code | GitHub Copilot | Cursor | ChatGPT | |---|---|---|---|---| | Context window | 200k tokens | ~8k tokens | ~10k tokens | 128k tokens | | Approach | Agentic reasoning | Autocomplete | Multi-file edit | Conversational | | Reads full codebase | β Yes | β No | β οΈ Partial | β No | | Runs shell commands | β Yes | β No | β No | β No | | Executes tests | β Yes | β No | β No | β No | | Best for | Architecture & debugging | Quick completions | Refactoring | Brainstorming | | Needs IDE plugin | β Terminal only | β VS Code, JetBrains | β VS Code fork | β Browser |
The right mental model: Use Claude Code for complex reasoning and architecture. Use Copilot for fast boilerplate. Use ChatGPT for exploration. They're not competitors β they're different tools for different jobs.
Installation
Windows
# Step 1 β Install Node.js (LTS) from nodejs.org, then verify:
node -v
# v22.x.x
# Step 2 β Install Claude Code globally
npm install -g @anthropic-ai/claude-code
# Step 3 β Launch
claudeOn first launch you'll be asked to:
- Choose a colour theme (dark/light/auto)
- Sign in with your Anthropic account
- Trust the current directory (say yes for your project)
macOS / Linux
# Option A β Homebrew (macOS)
brew install --cask claude-code
# Option B β Official installer (macOS/Linux)
curl -fsSL https://claude.ai/install.sh | bashThree Ways to Access
π» CLI (Recommended)
Run claude in your terminal. Fastest, lowest overhead. Best for deep coding sessions.
π₯οΈ Desktop App
Separate window alongside your editor. More memory use but good for multi-window setups.
βοΈ Cloud / Mobile
Browser at claude.ai or Android app. Useful for reviewing code remotely, not for full sessions.
CLAUDE.md β How You Onboard Claude to Your Project
CLAUDE.md is the most impactful thing you can do. It loads automatically at the start of every session, survives context compaction, and eliminates the need to re-explain your project every time.
Create this file at the root of your project:
# Project: Clinic Appointment System
## What
- .NET 9 Web API + EF Core 9 + PostgreSQL
- React 19 frontend (TypeScript, TanStack Query)
- Kafka for event-driven communication
- JWT auth (JJWT 0.12) β stored in httpOnly cookies only
## Project structure
src/
βββ Api/ β Controllers, middleware, DI registration
βββ Application/ β CQRS handlers (MediatR), DTOs, validators
βββ Domain/ β Entities, domain events, value objects
βββ Infrastructure/β EF Core, Kafka, email, external services
βββ Tests/ β Unit + integration (Testcontainers)
## Build & run
dotnet build # build all
dotnet test # run tests (requires Docker for DB)
npm run dev # start frontend
## Coding standards
- Package by feature, never by layer
- Use primary constructors (.NET 9+)
- All public methods need XML doc comments
- No magic strings β use constants or enums
- Cancellation tokens on all async methods
- FluentValidation for all commands
## Hard rules
- Never use var β always explicit types
- Never push to main directly β always branch + PR
- Never commit commented-out code
- Never use Console.WriteLine β use ILoggerWhat to include in CLAUDE.md
| Section | What to put | |---|---| | What | Tech stack, key libraries, auth approach | | Structure | Folder layout with 1-line descriptions | | Commands | Build, test, run, migrate commands | | Standards | Naming, patterns, things to always/never do | | Rules | Git workflow, testing requirements, forbidden patterns |
Keep it under 200 lines. Longer files cause instruction adherence to drop as the context fills up.
Plan Mode β Think Before You Code
Plan Mode is Claude Code's most underused feature. It restricts Claude to reading only β no writes, no edits, no shell commands β just analysis, questions, and a written plan.
# Activate Plan Mode
Press: Shift + Tab (twice)
Windows alternative: Alt + MIn Plan Mode Claude can:
- β Read files and grep code
- β Browse documentation
- β Ask clarifying questions
- β Write a detailed implementation plan
- β Create or modify files
- β Run shell commands
When to use Plan Mode
ποΈ New feature across multiple files
Get the plan first. Know which files will change before any change happens.
π Unfamiliar codebase
Let Claude explore and explain before touching anything.
ποΈ Architectural changes
Migrations, refactors, adding new layers β plan it out first.
π€ Not sure of approach
Ask Claude to propose three approaches and trade-offs before picking one.
Context Management
Claude's 200k window is large, but long sessions accumulate noise β old questions, discarded approaches, irrelevant context. Here's how to stay sharp:
/clear # reset conversation history, CLAUDE.md is reloaded automaticallyRules of thumb:
- Start a fresh session for a new feature β don't carry baggage from the last task
- For very large codebases, load files on-demand with
@filenameinstead of asking Claude to read everything upfront - Use subagents for isolated tasks (e.g. "use the Explore agent to find all places we handle auth") β they run in separate context windows and report back
- Keep
CLAUDE.mdunder 200 lines β link to external docs rather than pasting them inline
Custom Slash Commands
Store reusable prompts as .md files in .claude/commands/ and call them with /project:name:
.claude/
βββ commands/
βββ review.md β /project:review
βββ pr.md β /project:pr
βββ test.md β /project:test
βββ migrate.md β /project:migrateExample β PR generator:
# .claude/commands/pr.md
Generate a pull request description for the current branch.
Staged changes:
!`git diff --cached`
Commits since main:
!`git log main...HEAD --oneline`
Write:
1. A concise title (under 70 chars)
2. Summary bullet points (what changed and why)
3. A test plan checklist
4. Any breaking changes or migration notesInvoke it: /project:pr
Example β Code review:
# .claude/commands/review.md
Review the following changes as a senior engineer.
Diff:
!`git diff main...HEAD`
Check for:
- Logic bugs and edge cases
- Missing error handling
- Security issues (SQL injection, auth bypass, hardcoded secrets)
- Missing tests
- Non-idiomatic patterns for this codebase
Label each finding: β
Good / β οΈ Warning / β BlockerHooks β Automate at Every Step
Hooks run shell commands automatically at specific Claude Code lifecycle events. Configure them with /hooks or by editing .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "dotnet build --no-restore 2>&1 | tail -5"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "echo 'β
Claude finished. Review changes with: git diff'"
}
]
}
]
}
}| Hook event | When it fires | Example use |
|---|---|---|
| PreToolUse | Before Claude uses a tool | Validate, log, gate |
| PostToolUse | After a tool completes | Run linter, build, format |
| Stop | When Claude finishes a task | Send notification, run tests |
Pricing
| Plan | Cost | Claude Code | Messages per 5h window | |---|---|---|---| | Free | $0 | β No | β | | Pro | $20/mo | β Yes | ~45 messages | | Max 5x | $100/mo | β Yes | ~225 messages | | Max 20x | $200/mo | β Yes | ~900 messages |
Rate limits use a 5-hour rolling window β no overage fees, just a wait until the window resets. For daily professional use, Pro ($20) is enough. For intensive architecture sessions or team use, Max 5x is the sweet spot.
6 Power-User Tips
1. Be specific like a senior engineer
β "Add auth" β β
"Add JWT authentication using JJWT 0.12. Tokens go in httpOnly cookies, not localStorage. Refresh token rotation. Add a /api/auth/login, /api/auth/refresh, and /api/auth/logout endpoint. Follow the existing controller pattern in AppointmentController."
2. Commit after every Claude change
Treat each completed Claude task like a save point. If the next request introduces a regression, git reset --hard HEAD gets you back immediately. No commit = no safety net.
3. Review every line Claude writes
Claude may add packages you didn't ask for, create helper utilities that already exist, or write valid-but-non-idiomatic patterns. You own the code. Read the diff before committing.
4. Plan before you execute
For any change touching more than 2 files β use Plan Mode first. A 2-minute planning phase prevents a 20-minute revert.
5. Invest in your CLAUDE.md
Every pattern you document once means you never have to re-explain it. Add things to CLAUDE.md the moment you correct Claude β if you had to say it once, it belongs in the file.
6. Push back assertively
If Claude proposes an approach you don't like β say so directly. "Don't use that pattern. Use the repository pattern instead, consistent with how AppointmentRepository works." Claude responds well to clear direction.
Common Problems & Fixes
npm permission error on install
# Configure a global npm dir that doesn't need sudo
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g @anthropic-ai/claude-codeClaude doesn't understand the project
# 1. Create CLAUDE.md (see above)
# 2. Explicitly ask Claude to explore first:
"Before we start, read the project structure and summarise
what this codebase does, the key files, and the patterns it uses."Claude keeps refactoring things you didn't ask it to touch
Add to CLAUDE.md:
## Hard rules
- Only modify files directly related to the requested task
- Do not refactor, rename, or reformat code outside the scope of the request
- Do not add new dependencies unless explicitly askedSession getting confused after a long task
/clear # resets conversation, CLAUDE.md reloads freshFor very long tasks, start a new session and paste in a 3-sentence summary of where you left off.
Privacy & data
Claude Pro and Max: your code is sent to Anthropic's servers but not used to train models. Enterprise Teams option available for stricter data handling requirements. Claude Code does not work offline.
What to Learn Next
π .claude/ Folder
Master every file β rules, skills, agents, docs, worktrees. Read the guide β
π€ Skills & Agents
Build reusable workflows and isolated subagents for specialised tasks.
π MCP Integration
Connect Claude Code to databases, APIs, and external tools via Model Context Protocol.
πͺ Hook Automation
Auto-lint, auto-build, auto-notify β wire up actions to every Claude event.
The Big Shift
Claude Code isn't autocomplete with a bigger context window. It's a reasoning partner that understands your architecture, respects your conventions, and executes multi-step changes the way a senior teammate would. The developers getting the most out of it aren't the ones who give it the biggest prompts β they're the ones who've invested in a tight CLAUDE.md, use Plan Mode before complex changes, and commit frequently. Start there.
Enjoyed this article?
Explore the Cloud & DevOps learning path for more.
Found this helpful?
Leave a comment
Have a question, correction, or just found this helpful? Leave a note below.