Get Started with Claude Code

A practical guide for developers who just installed Claude Code — built from the real source material, not a summary of summaries.

~20 min read · beginner to advanced
01

What is Claude Code?

Claude Code might feel like it changes too much too fast, or that you don't understand what it's doing. That's completely normal. Here's the truth before anything else:

You are always in control. Claude Code never changes a file without showing you what it plans to do and asking for your approval first. You can ask it to explain anything. If Claude writes code you don't understand, just ask: "explain what you just did" — it will walk you through it.

Claude Code is an AI coding assistant that runs in your terminal. Unlike a chatbot where you ask questions and get text back, Claude Code can actually read your project files, write and edit code, run commands, and work across multiple files at once.

The key difference from other AI tools: it understands your entire codebase. You don't have to paste code into a chat window and explain the context every time. Claude already knows how your project is structured, what files exist, and how they connect.

Think of it as a very capable colleague sitting next to you who has read every file in your project. You describe what you want in plain English. It works out how to do it, shows you the plan, and only makes changes when you say yes.

The mental shift

Stop thinking of Claude Code as autocomplete or a search engine. Think of it as someone you're delegating work to. The better you describe what you want and why, the better the result. Git is your safety net — as long as you commit your work, every change Claude makes can be undone.

02

Getting Started

Installation

Claude Code has a native installer. Open your terminal and run the appropriate command for your system:

# macOS / Linux
curl -fsSL https://claude.ai/install.sh | sh

# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex

# Verify it worked
claude --version

If the version command gives an error, close and reopen your terminal first — that fixes most installation issues. You'll need a Claude.ai subscription (Pro, Max, Teams, or Enterprise) or an Anthropic API account. The first time you run claude, it opens a browser window to log you in.

Starting your first session

Navigate to your project folder in the terminal, then start Claude:

cd my-project
claude

You'll see a welcome screen. Claude has already read your project files. Try asking it what the project does:

what does this project do?

Claude will read your files and give you a summary of the codebase. This is a good way to verify it's working and to get oriented in an unfamiliar project.

You're safe

Claude scans your files but doesn't upload them anywhere. Everything happens on your machine. Your code stays private.

The permission system

Claude Code never silently edits your files. Before making any change, it shows you what it plans to do and waits for your approval. When Claude wants to edit a file, you'll see a diff — lines in red are being removed, lines in green are being added. You have three options:

  • Yes — approve this specific change and continue
  • No — skip this change; Claude will try a different approach
  • Ask Claude to explain — type your question before approving

For larger tasks, use Plan Mode. Claude maps out everything it intends to do across all files, shows you the full list, and waits for a single approval before touching anything:

/plan
Refactor the authentication module to use JWT instead of sessions.
Identify every file that will change and describe what you'll do to each.

Plan Mode is the single best tool for reducing anxiety about Claude making unexpected changes. Use it for anything bigger than a one-file edit.

Daily working rhythm

The cleanest workflow: do one meaningful task per session. When the task is done, commit the work, close the session, and start fresh for the next task. This keeps context tight and results consistent.

# Starting a session
cd my-project
claude
# Tell Claude what you're working on:
# "I'm adding user profile editing. Start with @src/profile/"

# Before a big task — set a safety net
git add . && git commit -m "checkpoint: before adding rate limiting"
/plan [describe task]
# Review the plan. Ask questions. Only then approve.

# Ending a session cleanly
# Ask: "summarise what we did and what the next step is"
# Paste answer into CLAUDE.md
git add . && git commit -m "feat: add rate limiting"
/clear  # or close terminal
The one-task rule

Use /clear between unrelated tasks in the same sitting. It resets the conversation while keeping your files and CLAUDE.md intact. Ten seconds to clear beats twenty minutes debugging a confused session.

03

How It Works

You don't need to understand the internals to use Claude Code effectively. But knowing the basics changes how you use it — and explains why it behaves the way it does.

The simple picture: sophisticated autocomplete

Forget the word "AI" for a moment. Start with this: a language model is an extremely sophisticated autocomplete. You give it some text, it tells you what word is most likely to come next. That's the whole job.

Your phone's keyboard does autocomplete too — you type "Happy birth" and it suggests "day." A language model does the same thing, just vastly more powerfully. The difference is scale and training data, not a fundamentally different idea. When Claude "writes code," it is completing a sequence. Every single thing these systems do reduces to: given what came before, what comes next?

Tokens — what Claude actually reads

Computers don't natively understand words — they understand numbers. So the first thing any language model must do is convert text into numbers using a process called tokenization. Text gets chopped into chunks of roughly 3–4 characters each, and every possible chunk gets a number from a big lookup table.

  • The word "function" might become the number 12453
  • "import numpy as np" might become four tokens: four separate numbers
  • About 750 words = roughly 1,000 tokens (a useful rule of thumb)

From this point on, the model never sees text — it only sees a list of numbers. This matters for you because API pricing is per-token: every word you write in a prompt, every line of code Claude reads, every response it generates costs tokens.

The context window — Claude's working memory

Every Claude Code session has a context window — a fixed amount of information it can hold at once. Think of it like working memory. At the start of a session it's empty and sharp. As you chat, every message, every file Claude reads, every response it gives fills that window up.

The three things that fill up context:

  • Conversation history — every message you and Claude exchange stays in context until you /clear
  • File reads — every time Claude reads a file, that file's contents go into context
  • Command output — when Claude runs tests or shell commands, the output is added to context

When context fills up, older content gets pushed out or compressed. Sessions that accumulate thirty messages, dozens of file reads, and multiple test runs behave very differently from fresh ones. This is why quality degrades in long sessions — and why /clear is your most important maintenance habit.

Signs your session needs a reset

Claude is contradicting things it said earlier. It keeps making the same mistake even after you correct it. It seems to have "forgotten" a file or rule. Responses are getting slower. Fix: run /clear and give a fresh briefing with one sentence of context.

Temperature — why Claude isn't deterministic

At the end of each generation step, the model has a probability score for every possible next token. "return" might be 78% likely, "pass" at 12%, everything else splits the remainder. Temperature controls whether you always pick the most probable option or allow lower-ranked options to occasionally win.

Low temperature (near 0): always the most likely token — deterministic, best for code. High temperature (near 1): samples proportionally from many options — natural variation, useful for creative tasks. Claude Code uses lower temperature for code generation by default, which is why the same prompt tends to produce similar code on repeat runs.

How knowledge gets into Claude

The model was trained on essentially everything ever published on the internet — web pages, books, GitHub, academic papers, Stack Overflow. Nobody programmed "how to write Python" into it. It learned Python because predicting code text accurately requires understanding code deeply. The knowledge is implicit — spread across hundreds of billions of parameters, not stored in any one place.

This also means Claude's knowledge has a cutoff date. For current library documentation, use @URL to give Claude the live docs:

Implement S3 file uploads using the official SDK.
Reference the current docs at @https://docs.aws.amazon.com/sdk-for-javascript/
Don't rely on your training data for this — read the actual docs.
04

Prompting Effectively

The most important skill with Claude Code isn't knowing commands — it's learning how to describe what you want clearly. Claude is very good at inferring intent, but it's even better when you give it context and explain your reasoning.

The golden rule

Imagine handing your prompt to a smart new team member who has never seen your codebase and has no memory of your last conversation. Would they know exactly what to do? If not, add more context.

Most prompts that produce poor results are missing one or more of these four things:

PartWhat it isExample
GoalWhat you're trying to achieveUsers need to reset their password via email
ContextWhy, and what constraints applyDon't change the session management. We use SendGrid.
ScopeWhat to touch and what to leave aloneOnly change auth/password.js — don't refactor anything else
FormatHow you want the outputShow me a plan first before making changes

Weak vs strong prompts

The difference is context and constraints:

# Too vague — Claude will guess at your intent
fix the login bug

# Complete — Claude knows exactly what to do
The login form is throwing a 401 error when the password contains special
characters. Fix it without changing the session management logic.
The relevant files are @src/auth/login.js and @src/middleware/session.js.
# Too vague
add a forgot password feature

# Complete
Add a forgot password flow. Users enter their email on /auth/forgot, receive
a link via SendGrid (already configured), and the link opens /auth/reset?token=xxx
where they set a new password. Use the existing User model. Don't touch the
login page. Show me the plan first.

Prompt techniques that consistently work

1. Ask it to plan before it acts. For anything that touches more than one file, ask Claude to show you its plan before making a single change. This is the single highest-value habit.

/plan
Refactor the authentication module to use JWT instead of sessions.
Identify every file that will change and describe what you'll do to each one.

2. Tell it what not to do. Claude is thorough and might refactor surrounding code, rename variables for consistency, or clean up things you didn't ask about. If you want surgical changes, be explicit:

Fix the email validation in the signup form.
Only change the validateEmail function. Do not touch anything else in this file.
Do not rename any variables or reformat the code.

3. Use examples to show what you want. One good example is worth ten adjectives:

Write a new API endpoint for orders. Follow the same pattern as the existing
products endpoint in @src/api/products.js — same error handling, same response
shape, same middleware order.

4. Break large tasks into steps. Giving Claude five tasks at once produces messier results than five clean sequential tasks. After each step, review and commit before giving the next one.

5. Give Claude permission to say it doesn't know. Claude will sometimes fill gaps with plausible-but-wrong answers. Add this line to prompts where accuracy matters:

If you're not sure about any part of this, tell me rather than guessing.
I'd rather know what you're uncertain about than get confident-sounding wrong code.

6. Use interview mode for complex features. For large features where you're not sure what's needed, ask Claude to interview you before writing anything:

I want to build a team invitation system. Before writing any code, interview me about the requirements — ask about edge cases, technical constraints, UX decisions, and anything I might not have thought about. Keep asking until you have enough to write a complete spec. Then write the spec to SPEC.md. We'll implement it in a separate session.

Referencing specific files

You can point Claude directly at a file using the @ symbol. This keeps context lean and focuses Claude on exactly what matters:

look at @src/auth/login.js and explain what the token refresh logic does

The bug is in the checkout flow. The relevant files are:
@src/api/checkout.js
@src/models/Cart.js
@src/utils/pricing.js
Don't read anything else unless you need to.

Front-load your constraints

Start your prompt with the most important context. Claude reads prompts top-to-bottom, and constraints buried at the bottom carry less weight:

# Wrong — constraint buried at the end Add OAuth login for Google and GitHub. Handle callback routes, store tokens, create the user if they don't exist, redirect to dashboard on success. Oh and don't touch the existing email login. # Right — constraint stated first Do not touch the existing email login — it must keep working exactly as is. Now add OAuth login for Google and GitHub: handle callbacks, store tokens, create users if new, redirect to dashboard.
Ask Claude to explain before it acts

For anything large or unfamiliar, ask Claude to explain its approach first: "explain how you'd approach this before making any changes." Review the explanation, then tell it to proceed. If the explanation looks wrong, correct it now — it's just text. Correcting a plan costs almost nothing. Correcting 15 changed files costs a lot.

05

CLAUDE.md — Your Project's System Prompt

Every time you start a new Claude Code session, Claude starts fresh — it re-reads your files but has no memory of your past conversations, preferences, or the decisions you've made. CLAUDE.md solves this.

CLAUDE.md is a plain text file that lives at the root of your project. Claude reads it automatically at the start of every session. Think of it as a one-page onboarding document for a new developer who joins your project — except this developer reads it perfectly every single time.

In AI terms, CLAUDE.md is your "system prompt" — the persistent set of instructions that shape how Claude behaves throughout the session, before you've typed a single word. Getting this right is one of the highest-leverage things you can do.

The rule

Every instruction you find yourself repeating across sessions belongs in CLAUDE.md. If you've typed the same thing twice, move it there.

How to create it

Claude Code can generate a starter version for you by analyzing your project:

/init

Claude analyzes your build system, test framework, file structure, and common patterns, then writes a draft. Read it, trim anything obvious, add your own rules.

The template that works

Keep it short — under 60 lines if possible. When it gets too long, Claude starts to skim it. Important rules get missed. Every line should be something Claude would NOT know just by reading your code:

# Project: [name] ## What this project does [One or two sentences. What does the app do? Who uses it?] ## How to run it - Build: npm run build - Test: npm test - Dev: npm run dev ## Key files and folders - src/api/ — all API routes - src/components/ — React components - src/models/ — database models ## Coding conventions - TypeScript strict mode. No any types. - Tests live next to the files they test (Component.test.tsx) - API responses always use the shape: { data, error, meta } - Use async/await, not .then() chains ## Do not touch without asking - src/legacy/ — old code kept for migration, don't change - package-lock.json — never edit manually ## Decisions already made (don't suggest alternatives) - We use Prisma for ORM. Don't suggest Sequelize or TypeORM. - Auth is JWT-based. Don't suggest sessions. ## Current work in progress [Update this section at the end of each session] - Working on: user profile editing - Next step: wire up the avatar upload to S3

The session handoff routine

This habit makes resuming work feel seamless. At the end of every work session, before you close Claude Code:

# Step 1: Ask Claude to summarise summarise what we did today and what the next step is # Step 2: Paste the summary into CLAUDE.md under "Current work in progress" # Step 3: Commit everything together git add . && git commit -m "checkpoint: end of day"

Next session, Claude reads CLAUDE.md first thing and knows exactly where you left off. Your opening prompt can be as simple as: "Continue where we left off. The current state is in CLAUDE.md."

What kills a CLAUDE.md

  • Too long: Once CLAUDE.md exceeds 60–80 lines, Claude starts to skim it. Delete the obvious things Claude can already infer from your code.
  • Too vague: Instructions like "write clean code" do nothing. Claude already tries to do that. Every line should be something Claude would NOT know without being told.
  • Never updated: A stale CLAUDE.md with outdated commands or wrong file paths actively misleads Claude. Update it whenever something significant changes.
  • Old handoff notes: Delete the "Current work in progress" section once the task is fully done and merged. Don't let CLAUDE.md become a graveyard of old notes.
Tip — Prefex saves you money here

Your CLAUDE.md gets sent to the API on every single request. Prefex caches it so you're only charged for it once per day, not hundreds of times. A 500-token CLAUDE.md across 200 daily requests saves real money automatically. Install Prefex →

06

Working with Git

Git feels scary because you're worried about breaking the team's code, or creating a mess someone else has to clean up. That fear is completely normal. Here's the truth: you always work on your own branch, your code is completely separate from everyone else's until you deliberately merge it, and git saves everything — there is almost no action in git that cannot be undone.

The mental model

Think of git as a very detailed "track changes" for your entire project. Every time you tell git to save (a "commit"), it takes a snapshot of everything. You can go back to any snapshot at any time.

Git thinks about files in three zones:

ZoneWhat it means
UnstagedYou changed the file. Git sees it but won't save it yet.
StagedYou ran git add. Git has queued it for the next save.
CommittedYou ran git commit. It's saved in history forever.

Run git status constantly — it tells you which zone everything is in and what to do next. Think of it as "look at the map before you walk."

The daily save loop

Git does not automatically save your changes — you have to tell it to. Think of it like sending a package: stage = put items in the box, commit = seal and label it, push = send it to GitHub.

git add . # stage all changed files git commit -m "what I did" # save a snapshot git push # send to GitHub

Write commit messages as if finishing the sentence "This commit will…" — "add user login form," "fix broken header on mobile." Avoid vague messages like "stuff," "changes," "fix," "wip."

Always work on a branch

Never work directly on main. Always create a branch for your work:

# The golden flow git checkout main # go to main git pull # get the latest code git checkout -b feature/my-thing # create your branch # ... do your work ... git add . git commit -m "add user profile page" git push -u origin feature/my-thing # first push (just git push after that)

Good branch names: feature/signup-page, fix/broken-button, update/homepage-text. Avoid: test, my-branch, changes, stuff.

Git is your safety net for Claude

The rule: commit before you give Claude a large task. If Claude's changes aren't what you wanted, you can always reset to your last commit. Without a commit, undoing changes is much harder.

# Before giving Claude a big task git add . && git commit -m "checkpoint: before refactoring auth" # If Claude's changes went wrong (and you haven't committed yet) git restore . # throws away all uncommitted changes # If you already committed Claude's changes but regret them git revert HEAD # creates a new commit that undoes the last one — safe

Merge conflicts — what they actually are

Merge conflicts sound frightening but are just git asking a question: "two people changed the same line — whose version do you want?" That's all they are. When you see conflict markers:

<<<<<<< HEAD your version here ======= their version here >>>>>>> feature/other-branch

Between <<<<<<< and ======= is your version. Between ======= and >>>>>>> is their version. Delete the markers and keep the version you want (or blend both). Then: git add . followed by git commit.

You can ask Claude to help with merge conflicts: "there's a conflict in auth.js — help me resolve it." Claude reads both versions, understands the intent, and suggests a sensible merge. You still approve the result.

Stash — switching tasks without losing work

You're mid-feature and suddenly need to switch branches. Stash is a temporary drawer for your work:

git stash # freeze your work-in-progress git checkout other-branch # go do the other thing git checkout - # come back (dash = previous branch) git stash pop # restore your work exactly as it was
07

Skills & MCP Servers

A language model, by itself, is completely isolated from the world. It cannot look at a clock. It cannot read a file you haven't pasted in. It cannot check whether the code it just wrote actually runs. It cannot search the web. Tools and MCP servers are what break these limitations — one at a time, explicitly, under your control.

How tools actually work

Here's the exact physical sequence when Claude "uses a tool": the model generates its response one token at a time and at some point produces a structured block saying "I want to call this function with these arguments." The API intercepts this, stops generating, returns to you. Your code actually executes the function. Then the result gets fed back to Claude as the next message, and it continues.

The critical insight: the model never calls anything. It outputs text that looks like a function call. Your code (or the Claude Code harness) reads that text, executes the real function, and feeds the result back. "Tool use" means the model is writing a note that says "please use this tool on my behalf," and you are the one who actually uses it.

Skills (slash commands)

A skill is a reusable instruction set that you activate with a slash command. Instead of typing the same long prompt every time you do a code review, you install a skill and type /code-review. Skills live in ~/.claude/skills/ as markdown files. You can write your own or install community ones.

# Run a code review /code-review # Write tests first (test-driven development) /tdd # Remove dead code /refactor-clean # Look up current library documentation /docs # See all installed skills /help

MCP Servers

MCP (Model Context Protocol) servers give Claude new capabilities by connecting it to external systems. Think of MCP as a standardized plug format — you connect a server once and Claude can use it like any other tool.

  • GitHub MCP — Claude can create PRs, read issues, and manage repos directly
  • Context7 — Claude gets live library docs injected into every prompt; no more hallucinated APIs
  • Playwright MCP — Claude can control a real browser, fill forms, take screenshots
  • Memory MCP — persistent knowledge graph across sessions; Claude remembers things between restarts
  • Filesystem — secure sandboxed file access beyond the current directory
# Install an MCP server (Context7 example) claude mcp add context7 npx @upstash/context7-mcp # Or use the Prefex marketplace to browse and install open https://prefex.dev/marketplace
Tip

Don't install every MCP server you find. Each one expands Claude's attack surface and adds token overhead (tool definitions consume context before Claude reads a single message). Start with Context7 (live docs) and GitHub MCP if you use GitHub. Add others only when you have a specific need. Browse the Prefex Marketplace →

Parallel tool calls

Modern Claude can output multiple tool calls in a single response when the results don't depend on each other. When you ask Claude to "compare auth.py with test_auth.py," it reads both files simultaneously rather than sequentially — cutting latency roughly in half. This happens automatically; you don't need to configure it.

08

Advanced Patterns

Intermediate–Advanced

Context engineering

For the first two years of AI tools, the dominant skill was prompt engineering: how to write the system prompt to get the behavior you want. This framing breaks for agents. An agent operating over many steps generates more and more data at each step — tool results, observations, error messages. By step 20 of a 40-step task, the model is reading thousands of tokens of accumulated history that may have nothing to do with what it needs to do right now.

Context engineering is the art of curating and maintaining the optimal set of tokens during inference — keeping the right information in the window at the right time.

Research shows models pay more attention to the beginning and end of long contexts than the middle. Information stuffed into the middle of a long context receives disproportionately low attention weight — even if it's important. This is not a bug — it's a structural property of how transformers compute attention. Adding more context does not reliably improve performance; beyond a point it actively degrades it.

The practical principle: just-in-time context. Instead of pre-loading everything that might be relevant, give Claude lightweight references — file paths, query specs, URL pointers — and let it load content on demand. Claude Code already works this way by default.

Multi-agent workflows

An "agent" is Claude with permission to take actions autonomously — reading and writing files, running commands, making decisions — without asking for approval on every step. Multi-agent workflows run several specialized agents in parallel or sequence to tackle complex tasks.

When Anthropic built a multi-agent research system, they found two consistent failure modes without the right infrastructure:

  • One-shotting: the agent tries to implement everything at once rather than working incrementally, runs out of context mid-implementation, and produces a half-finished system.
  • Premature completion: after implementing some features, the agent "looks around," sees partial progress, and declares the task complete.

Both failures have the same root cause: the agent had no external representation of "what needs to be done" and "what is actually done." The fix is explicit scaffolding:

# Parallel agents (two terminal windows simultaneously) # Terminal 1: backend work cd my-project && claude > Build the REST API for user management # Terminal 2: frontend work (at the same time) cd my-project && claude > Build the React components for the user dashboard

Key principles for safe agentic work:

  • Always work on a branch, never main, when running autonomous agents
  • Set a clear stopping condition — "stop when tests pass" or "stop after implementing feature X"
  • Maintain a feature list file so the agent knows what's done and what's next
  • Use /plan before execution for anything that touches more than five files
  • Review the diff before merging any agent-generated changes

The "think" tool and extended thinking

For hard problems that benefit from careful reasoning before acting, Claude has two modes:

  • Extended thinking — Claude generates private reasoning tokens before the visible response. The thinking is hidden from you but the model uses it to explore dead ends and verify reasoning before committing to an answer. Enable with Option+T (Mac) or Alt+T (Windows/Linux). Adds latency and cost — use for genuinely hard problems.
  • Chain-of-thought — you explicitly ask Claude to reason step by step before answering. The reasoning appears in the visible response. No extra cost or configuration: just add "think step by step" or "explain your reasoning before writing any code."
Warning

Agentic sessions can get expensive fast. A loop that reads many files, runs tests, and makes changes on every iteration can spend $5–10 in under an hour on a large codebase. Use the Prefex dashboard to monitor spend in real time.

Managing long-horizon tasks

For tasks spanning multiple sessions — large refactors, feature-complete implementations — the approach that works is treating git and progress files as the agent's memory:

# At the end of each milestone, write a progress note After completing each feature, update PROGRESS.md with: - What was done - Which files were changed - What tests are passing - What the next step is # Then commit git add . && git commit -m "feat: implement user authentication (auth-001)" # Next session starts by reading context Continue the implementation. Read PROGRESS.md and git log --oneline -10 to understand where we left off, then pick the next item in feature_list.json.

When conversation history is automatically compacted, specific details from early in the session are lost. If any piece of information is genuinely critical for the whole task, don't rely on it surviving compaction — write it to a file that can be re-read when needed.

09

Saving Money

Claude Code is powerful but not free. You pay for every token sent to and received from the Anthropic API. Understanding where the money goes is the first step to reducing costs.

The big cost drivers

  • Your system prompt (CLAUDE.md) — sent on every single request. A 500-token CLAUDE.md at 200 requests per day adds up fast.
  • Long conversations — the entire history is re-sent each turn. An hour-long session can have 50,000+ input tokens by the end.
  • Reading large files — Claude reading a 1,000-line file costs 10,000+ tokens.
  • Agent loops — many round trips, each with accumulated context.
  • Tool definitions — a large MCP server might contribute 50,000 tokens of tool definitions before Claude reads a single user message.

Free savings (habits)

  • Use /clear frequently — fresh context costs far less than accumulated context
  • Point Claude to specific files — "look at @src/auth.ts" costs less than "look at all my files"
  • Keep CLAUDE.md concise — every extra word costs money, multiplied by every request
  • Ask for plans, not implementations — text is cheap, code generation is expensive
  • Remove unused MCP servers — each one adds token overhead to every request

Prompt caching

Anthropic offers prompt caching — if you send the same prefix (your CLAUDE.md) repeatedly, they cache it server-side and charge you only 10% of the normal price for cached tokens. The catch: you have to opt in and send the right cache-control headers with every request. Claude Code doesn't do this automatically. Most users never set it up.

This is exactly what Prefex does

Prefex automatically injects the correct cache headers on every request — no configuration needed. Your CLAUDE.md, which is the same on every request, gets cached at Anthropic's servers. You pay 10¢ on the dollar for it instead of full price. Most users see 40–70% cost reduction from caching alone. Beyond caching, the Prefex dashboard shows you exactly which requests cost the most. Install Prefex in 30 seconds →

Model selection

Claude Sonnet is the default — it's the best at coding. But not every task needs it. Use smaller models for simple work:

  • Sonnet — complex code, architecture decisions, debugging hard problems
  • Haiku — simple questions, formatting, documentation, repetitive tasks (~10x cheaper)
/model haiku # switch to Haiku for simple tasks /model sonnet # switch back to Sonnet for complex work

Rough cost estimates

TaskApprox. cost
Quick question, small file$0.01–0.05
Typical coding task (30 min)$0.10–0.50
Full feature implementation$0.50–2.00
Agentic session (1 hour)$1.00–10.00
With Prefex caching40–70% of the above
10

Quick Reference

Slash commands

CommandWhat it does
/planShow the full plan before making any changes
/clearClear conversation history. Use between tasks.
/initGenerate a starter CLAUDE.md for this project
/compactSummarize conversation to save tokens
/model haikuSwitch to Haiku for cheap tasks
/model sonnetSwitch to Sonnet for complex work
/helpShow all available commands and installed skills

Keyboard shortcuts

ShortcutWhat it does
EscapeCancel current operation
Ctrl+CInterrupt a running command
Option+T / Alt+TToggle extended thinking mode
Ctrl+OToggle verbose mode (see thinking output)
↑ ↓Navigate prompt history
TabAutocomplete file names when using @

Prompting quick reference

GoalPrompt pattern
Understand code "Explain what @src/auth/login.js does in plain English."
Fix a bug "[Error message]. The bug is in @[file]. Fix it without changing the interface."
Add a feature "Show me the plan before writing code. Then implement [feature] in [file]."
Write tests "Write tests for [function] covering: [list of cases]. Don't mock the database layer."
Code review "Review the changes in my current branch. Look for bugs, edge cases, and CLAUDE.md violations."
Refactor "Refactor @[file] to [goal]. Don't change any behavior or public interfaces."
Understand change "Explain what you just did in plain English."
End of session "Summarise what we did today and what the next step is."

Git quick reference

CommandWhat it does
git statusYour compass — run this constantly
git add .Stage all changed files
git commit -m "..."Save a snapshot with a message
git pushUpload commits to GitHub
git checkout -b nameCreate and switch to a new branch
git stashFreeze work-in-progress temporarily
git stash popRestore stashed work
git restore .Discard all uncommitted changes (irreversible)
git revert HEADUndo last commit safely (creates a new commit)
git log --onelineCompact history (press Q to exit)
git reflogYour rescue rope — see every HEAD movement ever

Common frustrations and fixes

ProblemFix
"Claude changed more than I asked" Use /plan first to see scope. Add "only change X, don't modify anything else" to the prompt.
"Claude keeps making the same mistake" /clear and re-describe from scratch. If it's a recurring pattern, add the rule to CLAUDE.md.
"Session has lost track of context" /clear and give a short re-briefing. One task per session is the cleanest approach.
"Next session Claude has forgotten everything" Commit work, update CLAUDE.md with a "current work" note, start next session with one sentence of context.
"I don't know if Claude's code is correct" Run the tests, test the feature yourself, ask Claude to explain its logic. Treat output as a first draft.

File structure reference

PathWhat it is
./CLAUDE.mdProject-level config (Claude reads this first, every session)
~/.claude/settings.jsonGlobal settings (API keys, env vars, MCP servers)
~/.claude/skills/Installed slash command skills
~/.claude/agents/Installed agent definitions
~/.claude/mcp/MCP server configurations
Next steps

Browse the Prefex Marketplace for curated skills and MCP servers. Install Prefex to start saving on API costs today. Stuck or unsure? Ask Claude directly: "I'm not sure how to approach this — what do you recommend?" The best developers use every resource available to them.