How to Use Claude Code: A Developer's Guide [2026]
Learn how to use Claude Code in 2026: install it, run the explore-plan-code-commit loop, write a CLAUDE.md, set permission modes, and connect MCP servers.
Claude Code is Anthropic's agentic coding tool. You install it, open a project, and describe a task in plain language. It reads your files, edits code, runs commands, and checks its own work in a loop until the task is finished or you stop it.
That last part is the whole story. Autocomplete guessed the end of your line. An agent takes the whole task, and your job shifts from typing to two harder things: describing work precisely enough for a machine to execute, and reading the result closely enough to trust it.
Plenty of developers have heard of Claude Code. Far fewer have finished a real task with it and understood why it went well or badly. This guide runs from installation to a checked result, and says when an agent is the wrong tool.
What Is Claude Code?
Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools from the terminal.
That definition comes from Anthropic's own documentation, and every word is load-bearing. Claude Code is not a chat window that hands back a snippet. It has hands.
Underneath, it runs what Anthropic calls the agentic loop.
When you give Claude a task, it works through three phases: gather context, take action, and verify results. (Claude Code documentation)
The tools inside that loop fall into five groups: file operations, search, execution (shell commands, tests, git), web access, and code intelligence. Ask it to fix failing tests and it runs the suite, reads the output, finds the source files, edits them, and reruns. If the category is new to you, our guide to agentic coding covers the concept.
How Do You Install Claude Code?
Install Claude Code with a one-line native installer, a package manager, or WinGet, then verify with claude --version and log in on first run.
- Native install (recommended). On macOS, Linux, or WSL:
curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell:irm https://claude.ai/install.ps1 | iex. - Homebrew.
brew install --cask claude-code. - WinGet.
winget install Anthropic.ClaudeCode. - Verify. Run
claude --version. It prints a version number and(Claude Code). - Start and sign in.
cdinto a project, runclaude, and follow the login prompt.
One detail matters before you pick: native installs update themselves in the background, while Homebrew and WinGet installs do not (Anthropic).
You also need an account. Claude Code ships with the Pro, Max, Team, and Enterprise plans, or a Claude Console account with prepaid credits. Pro is $17 per month billed annually, $20 monthly, and the free plan does not include it (Anthropic pricing).
Four shell commands cover most days: claude opens a session, claude -p "query" answers once and exits, claude -c continues the last conversation, claude -r picks an older one.
One thing changed over the summer, and it shapes your first session. On Pro, Max, and Team plans a terminal session now starts in auto mode by default, where a classifier reviews each action instead of you, so Claude edits files and runs commands without stopping to ask. On other plans it starts in Manual mode and asks first (Anthropic, checked 8 September 2026). In July the same page still called Manual the mode you land in. Press Shift+Tab before your first prompt if you would rather approve everything yourself.
The Core Workflow Loop: Explore, Plan, Code, Commit
Anthropic's recommended workflow has four phases, and jumping straight to phase three is how new users get bad results.
- Explore. Enter plan mode and let Claude read. Something like "read
src/authand explain how sessions and login work." No edits happen yet. - Plan. Ask for a written implementation plan: "I want to add Google OAuth. What files change? What is the session flow?" Press
Ctrl+Gto open that plan in your editor and correct it before anything runs. - Implement. Leave plan mode and let it build against the plan you approved.
- Commit. "Commit with a descriptive message and open a PR."
Plan mode is reached with Shift+Tab or a /plan prefix. It is useful, and it is also overhead. Anthropic's guidance on skipping it is blunt: if you could describe the diff in one sentence, skip the plan (best practices).
An agent stops when the work looks done, so step four is not finished until you have checked it. That has its own section below.
How Does CLAUDE.md Project Memory Work?
CLAUDE.md is a markdown file Claude Code reads at the start of every session, holding the build commands, conventions, and rules it cannot infer from your code.
Every session starts with an empty context window, so CLAUDE.md is how knowledge survives. Files load broadest scope first:
| Location | Scope | Shared with |
|---|---|---|
~/.claude/CLAUDE.md |
Your preferences, every project | Just you |
./CLAUDE.md or ./.claude/CLAUDE.md |
This project | Your team, via version control |
./CLAUDE.local.md |
This project, personal | Just you (add to .gitignore) |
Run /init to generate a starter file, /context to confirm it loaded, and /memory to edit it later (Anthropic).
The rule that catches everyone is size. Anthropic recommends staying under 200 lines, because the file loads into context every session and a bloated one makes Claude ignore half of it. A test for each line: would removing this cause a mistake? If not, cut it. Write down what a new teammate would have to be told, like the build command, the test runner, and conventions that differ from language defaults.
Two extras are worth knowing. You can pull in other files with @path/to/file syntax, and larger projects can split instructions into .claude/rules/, where a paths field scopes a rule to matching files. Claude Code also reads CLAUDE.md, not AGENTS.md. If your repo has an AGENTS.md, make @AGENTS.md the first line of a CLAUDE.md so both tools read the same instructions.
Slash Commands, Permission Modes, and MCP
The slash commands worth memorizing
These earn their keep:
/clearstarts a fresh conversation with empty context./compactsummarizes the conversation to free space, and takes a focus argument./contextshows what is consuming your context window./rewindrolls code and conversation back to a checkpoint./model,/permissions, and/doctorcover models, approval rules, and a broken setup.
Permission modes decide how often Claude stops to ask
Shift+Tab changes mode mid-session. From auto, the first press drops you into Manual, and the cycle then runs Manual, acceptEdits, plan, and back to Manual (Anthropic). The status bar names the live mode.
| Mode | Runs without asking | Best for |
|---|---|---|
Manual (default) |
Reads only | Reviewing every action yourself, sensitive work |
acceptEdits |
Reads, file edits, common filesystem commands | Iterating on code you are reviewing |
plan |
Reads, no source edits, plus classifier-approved commands where auto is available |
Exploring before you change anything |
auto |
Everything, with background safety checks | Long tasks, and where Pro, Max, and Team sessions start |
bypassPermissions |
Everything | Isolated containers and VMs only |
auto mode runs a classifier over each action before it executes, blocking things like curl | bash, force pushes, and production deploys (Anthropic). bypassPermissions does not, and Anthropic's warning is explicit: use it only in containers or VMs. It is a lab tool, not a productivity setting. In every other mode, writes to protected paths like .git and .claude are never auto-approved.
Connecting your tools with MCP
The Model Context Protocol is an open standard for wiring AI tools to external systems. Connect a server when you catch yourself pasting data into the terminal from a ticket tracker or a dashboard.
One command adds a server: claude mcp add --transport http notion https://mcp.notion.com/mcp. Servers install at three scopes: local (default, private to you), project (written to .mcp.json, shared through git), and user (all your projects). Run /mcp to check status and handle OAuth, or start with our roundup of MCP tutorials and courses.
One optional walkthrough lives here. Scrimba Explain, listed in the ChatGPT plugin directory as Explain Video Generator, also runs as an MCP server, so a connected agent can explore your codebase and hand back a narrated explainer. Like any server, it does nothing until you add it: claude mcp add --transport http scrimba-explain https://scrimba.com/explain/mcp.
A Worked Example: Fixing a Real Bug
A signup form on a React app accepts empty submissions, and a junk record lands in the database every time. The instinct is to type "fix the signup bug." Resist it. Compare it with what works:
Users can submit the signup form with empty fields and it creates a
record. The form lives in src/components/SignupForm.tsx and the handler
is in src/api/signup.ts. Write a failing test that reproduces it first,
then fix it. Address the root cause, do not just disable the button.
Four things changed. The symptom is described, the likely location is named, the definition of fixed is stated, and a verification step is built into the prompt.
A realistic sequence from there:
- Start in plan mode with
Shift+Taband ask Claude to read both files and explain the current validation path. - Read the plan it produces. This is the cheapest place to catch a wrong assumption.
- Leave plan mode and send the prompt above. Claude writes the failing test, runs it, edits the validation, and reruns.
- Check the result, using the three questions in the next section.
- Finish with "commit with a descriptive message and open a PR."
If step three goes sideways, press Esc to stop it mid-action, or Esc twice with the prompt box empty to open the rewind menu. With text in the box, a double Esc clears the box instead.
How Do You Check What Claude Code Did?
Claude Code will tell you it is done. That is a claim, not a result.
Give Claude a check it can run: tests, a build, a screenshot to compare. It's the difference between a session you watch and one you walk away from. (Anthropic)
Three questions cover most sessions.
Did it change what you asked it to change? Run /diff, or read git diff yourself. A fix that touches six files when you expected two is worth a look before the tests even run.
Did a check pass, and did you see it pass? "Run the tests and show me the output" is a different instruction from "make sure the tests pass," and only the first hands you something to read. /verify goes further and builds the project, runs the app, and observes the result instead of trusting the type checker. To hold a check across a whole session, set it as a /goal condition and an evaluator re-checks it every turn (best practices, checked 8 September 2026).
Would a fresh reader find the bug? /code-review re-reads the diff for correctness in a separate context, so the model grading the work is not the one that wrote it.
Rewinding restores edits Claude made with its file-editing tools, but not files a shell command changed (Anthropic). Git is still what saves you.
Patterns That Work, and Mistakes That Cost You
Three habits separate good sessions from frustrating ones:
- Point at existing code. "Look at how
HotDogWidgetis implemented and follow that pattern" beats abstract description. - Use
@to reference files instead of describing where code lives. - Delegate research to subagents. They explore in their own context window and report back a summary, so a big investigation never floods yours.
The failure patterns Anthropic names come down to context hygiene:
- The kitchen sink session. Unrelated tasks in one conversation. Fix:
/clearbetween them. - Correcting over and over. After two failed corrections,
/clearand rewrite the prompt. - The infinite exploration. An unscoped "investigate this" that reads hundreds of files.
The trust-then-verify gap sits underneath all of them, and it is not hypothetical. In the 2025 Stack Overflow Developer Survey, the biggest frustration developers reported with AI tools was "AI solutions that are almost right, but not quite," cited by 66% of respondents, with 45.2% adding that debugging AI-generated code costs them more time. Almost-right output is the default failure mode of every coding agent, and the three questions above are the only defense.
When Claude Code Is the Wrong Tool
For the head-to-head with the two tools most developers weigh it against, see Claude Code vs Codex vs Cursor. Our guide to using OpenAI Codex is the direct counterpart to this one.
Reach for something else when the task is a one-line change you could make faster yourself, when you cannot review the output competently, or when the work touches production systems no checkpoint can roll back.
What You Need to Know to Direct an Agent Well
Every skill in this guide sits on top of one it cannot replace: reading a diff and knowing whether it is correct. An agent will hand you a confident fix for a bug it misdiagnosed, and the only thing between that and production is you.
If you are still building those foundations, Scrimba's Learn to Code with AI is a free 4.5-hour course with Guil Hernandez that teaches HTML, CSS, and JavaScript from zero while using AI assistance. It is not a Claude Code course and does not cover agentic tools.
For which tutorials and courses are worth starting with, see our roundup of Claude Code tutorials and courses.
Frequently Asked Questions
Is Claude Code free?
No. Claude Code requires a paid Claude plan (Pro, Max, Team, or Enterprise), a Claude Console account with prepaid credits, or access through a supported cloud provider. Pro starts at $17 per month billed annually. The free Claude plan does not include Claude Code.
Do I need to know how to code to use Claude Code?
You can run it without coding knowledge, but you should not ship its output without it. Claude Code produces plausible code that is sometimes subtly wrong. Reviewing a diff and judging whether a fix addresses the root cause both require real programming ability.
What is the difference between Claude Code and the Claude app?
The Claude app is a chat interface that returns text. Claude Code is an agent with tools: it reads your files, edits them, runs shell commands, uses git, and verifies its own work inside your project directory. Both run on the same Claude models.
How do I stop Claude Code from making a change I do not want?
Press Esc to stop it mid-action while preserving context. Press Esc twice, or run the rewind command, to restore conversation and code to an earlier checkpoint. You can also stay in Manual or plan mode so nothing is edited without your approval.
Where should I put project instructions for Claude Code?
Put team-shared instructions in CLAUDE.md at the project root and commit them. Put personal preferences that apply everywhere in the CLAUDE.md inside your home .claude directory, and project-specific notes in CLAUDE.local.md, which should be gitignored.
Key Takeaways
- Claude Code is an agentic coding tool that reads, edits, runs, and verifies inside your project, not a chat window that returns snippets.
- The four-phase loop is explore, plan, implement, commit. Skip planning when you could describe the diff in one sentence.
- CLAUDE.md loads every session, so keep it under 200 lines or Claude starts ignoring it.
- Pro, Max, and Team sessions now start in auto mode.
Shift+Tabchanges that, andbypassPermissionsbelongs only in isolated containers or VMs. - Give the agent a check it can run, then read the evidence:
/difffor what changed,/verifyagainst the running app. - 66% of developers name "almost right, but not quite" as their top AI frustration, exactly the error class verification catches.
Sources
Anthropic, Claude Code documentation, re-checked 8 September 2026:
- Overview: https://code.claude.com/docs/en/overview
- Quickstart: https://code.claude.com/docs/en/quickstart
- How Claude Code works: https://code.claude.com/docs/en/how-claude-code-works
- Memory and CLAUDE.md: https://code.claude.com/docs/en/memory
- Permission modes: https://code.claude.com/docs/en/permission-modes
- Best practices: https://code.claude.com/docs/en/best-practices
- Checkpointing: https://code.claude.com/docs/en/checkpointing
- MCP: https://code.claude.com/docs/en/mcp
- Anthropic. "Pricing." Re-checked 8 September 2026. https://claude.com/pricing
- Stack Overflow. "2025 Developer Survey: AI." 2025. https://survey.stackoverflow.co/2025/ai/