Skip to content AI News: Nano Banana 2.1 is out: better edits and text, half the API price per image →

How to Use Claude Code: A Beginner's Guide From Install to First Commit

Claude Code is Anthropic's coding agent. Unlike a chatbot, it works inside your project: it reads your files, runs commands, edits code and commits it, while you watch, steer or step away. You talk to it in plain English, the way you'd brief a colleague.

This guide gets you from nothing to a first committed change, then covers the habits that separate a frustrating session from a good one. The commands come from Anthropic's Claude Code documentation as of October 2026.

What you need

  • An account. A paid Claude plan (Pro, Max, Team or Enterprise), a Claude Console account with API credits, or access through a cloud provider such as Amazon Bedrock. There's no free tier. Our Claude Code review covers the plans.
  • A project folder. Any code you're working on, ideally under git so you can undo anything.
  • A terminal, or one of the other places Claude Code runs: the VS Code and JetBrains extensions, the Claude desktop app's Code tab, or the browser at claude.ai/code. All of them use the same engine. This guide uses the terminal.

Step 1: Install it

On macOS, Linux or WSL:

curl -fsSL https://claude.ai/install.sh | bash

On Windows, in PowerShell:

irm https://claude.ai/install.ps1 | iex

Homebrew (brew install --cask claude-code) and WinGet (winget install Anthropic.ClaudeCode) work too, but they don't update themselves; the native installer does. Open a new terminal and check:

claude --version

If the shell says claude isn't found, the install folder isn't on your PATH yet. On native Windows, install Git for Windows as well so Claude Code can use Bash.

Step 2: Start it in your project and log in

cd path/to/your-project
claude

The first time, it opens your browser to log in. After that, you'll see a prompt with the version, the model and your folder. Type /help to see what's available, or just start talking.

Step 3: Ask about your code before changing it

You don't need to point it at files; it reads what it needs. Good first questions:

what does this project do?
where is the main entry point?
explain the folder structure
how does authentication work here?

This is also the fastest way to learn an unfamiliar codebase. Ask what you'd ask a senior engineer: why a function exists, which edge cases a module handles, how to add a new endpoint.

Step 4: Make a first change

there's a bug where users can submit an empty signup form. fix it and add a test.

Claude finds the code, makes the change and runs the tests if your project has them. Depending on your permission mode, it may ask before editing a file or running a command.

Permission modes decide how much it asks. Since version 2.1.283, interactive sessions start in auto mode: a separate model reviews each action and blocks risky ones, and routine edits go through without a prompt. Press Shift+Tab to cycle modes, including Manual, where you approve every edit and command yourself. Start in Manual if you want to watch what it does on your first few tasks.

Step 5: Commit it

what files have I changed?
commit my changes with a descriptive message

Git is conversational too: create branches, read history, resolve merge conflicts. With the gh command-line tool installed, it can open pull requests.

The workflow for anything bigger

For a change that touches several files, Anthropic recommends four phases:

  1. Explore. Switch to plan mode with Shift+Tab until the status bar says plan mode is on. Claude reads and answers but changes nothing. Ask it to read the relevant parts of the code.
  2. Plan. Ask for an implementation plan: which files change, in what order, how you'll know it works. Press Ctrl+G to edit the plan in your editor.
  3. Implement. Approve the plan and let it build, with tests.
  4. Commit. Ask for a commit and a pull request.

Skip the plan when you could describe the change in one sentence: a typo, a rename, one log line. Planning pays when you're unsure of the approach or don't know the code.

How to write requests that work

The biggest single improvement is giving Claude a way to check its own work: a test, a build, a screenshot to compare against. Without one, it stops when the code looks done, and you become the tester.

Instead ofWrite
fix the login bugusers report that login fails after a session timeout. check token refresh in src/auth/. write a failing test that reproduces it, then fix it
add tests for foo.pywrite a test for foo.py covering the case where the user is logged out. avoid mocks
the build is failingthe build fails with this error: [paste]. fix the cause, don't suppress the error, and confirm the build passes
add a calendar widgetlook at how the widgets on the home page are built and follow that pattern for a calendar widget. no new libraries

Use @ to point at a file (@src/auth/session.ts), paste screenshots straight into the prompt, and paste error messages whole. For a bigger feature, ask Claude to interview you first and write the answers into a spec, then start a fresh session to build it.

Ready-made requests for common jobs are in our Claude Code prompts.

Keep the context clean

Everything in a session (your messages, every file Claude reads, every command output) sits in one context window, and quality drops as it fills. Most good habits come from that:

  • /clear between unrelated tasks. A session that wanders across three jobs does all three worse.
  • After two failed corrections on the same problem, /clear and start again with a better prompt that includes what you learned.
  • /compact Focus on the API changes condenses a long session but keeps what you name.
  • /btw asks a side question whose answer doesn't stay in the context.
  • "Use subagents to investigate how token refresh works" sends the reading to a separate context and returns a summary.

Undo, stop and resume

  • Esc stops Claude mid-action without losing the conversation.
  • Esc twice, or /rewind, restores the code, the conversation or both to an earlier point. Every prompt creates a checkpoint. It only tracks Claude's own file edits, not changes made by commands, so keep using git.
  • claude -c continues your last session in this folder; claude -r picks one from a list. /rename gives a session a name you'll find later.

Teach it your project once

Run /init and Claude writes a CLAUDE.md file: your build and test commands and the conventions it found. It reads that file at the start of every session, so you stop repeating yourself. Keep it short and specific; our guide to writing a CLAUDE.md has a template and what to leave out.

From there you can add skills (instructions Claude loads when a task needs them), hooks (scripts that run at fixed moments, such as a linter after every edit) and MCP servers (connections to tools like your issue tracker or database). The Claude Code skills page lists the ones worth installing, with the command for each.

Mistakes beginners make

  • The kitchen-sink session. One task, then an unrelated question, then back. Use /clear.
  • Trusting without checking. Code that looks right can miss edge cases. Ask for tests, and ask Claude to show the test output instead of saying it passed.
  • Unscoped investigations. "Look into the performance problem" can read hundreds of files. Name the area, or use a subagent.
  • A CLAUDE.md that keeps growing. When Claude ignores a rule, the file is often too long, not too short.
  • No git. Rewind covers Claude's edits, not everything. Commit before big changes.

Questions people ask

Can I use Claude Code for free?

No. It needs a paid Claude plan, Console API credits or a cloud provider account. If you want to try a coding agent at no cost, our Claude Code vs Codex comparison covers the options.

Do I need to know how to code?

It helps a lot. Claude Code can build working apps from plain-English descriptions, but you still decide what's correct, read the changes and run them. Start small and read every diff on your first projects.

Is it better in the terminal or in VS Code?

Same engine either way. The VS Code extension shows changes as inline diffs, which many beginners find easier to review. The terminal has every feature first. The desktop app adds side-by-side sessions and a visual diff view.

Does Claude Code run commands on my computer?

Yes, that's how it tests and builds. Permission modes control how much it can do without asking, and you can stop it with Esc at any point. Work in a project under git so anything can be undone.

All the commands in one place: our Claude Code cheat sheet.

Sources

Weekly

New prompts in your inbox

One email a week: the best new prompts and one short guide. Unsubscribe any time. Privacy policy