Build
How to Use Claude Code, Start to First Commit
Checked 2026-10-31
Loading poll...
By the end of this guide you will have Claude Code installed, signed in, and one small change in your own project reviewed and committed. The shortest path is five commands and three prompts: install, cd into a repo, run claude, ask what the project does, ask for one small change, approve it, and ask for a commit. Allow about twenty minutes. Facts checked 31 October 2026.
What you will have at the end
- Claude Code running in your terminal, on a plan you chose on purpose
- A first session where it explained a codebase and made one change
- A git commit you read before it was made
- A short list of commands to steer, stop and undo a session
- A clear idea of what it costs and what leaves your machine
This guide is the first-run guide. If you want to build a whole small app with it, go to the Claude Code tutorial. If you already use it daily and want rules for a team, read Claude Code best practices.
Prerequisites
You need three things.
- A terminal. On macOS that is Terminal or iTerm. On Windows, PowerShell works. On Linux, any shell. The docs link a terminal guide if you have never opened one.
- A project with git. Pick a real repo, but one where a bad edit would not hurt. A side project is ideal. Run
git statusfirst and make sure the working tree is clean, so the diff you see later is only Claude's. - A way to pay. Claude Code accepts a Claude subscription (Pro, Max, Ultra, Team or Enterprise), a Claude Console account with pre-paid credits, or access through Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry. See Cost below before you pick.
On native Windows the docs recommend installing Git for Windows, so Claude Code can use the Bash tool. Without it, Claude Code uses PowerShell as its shell tool. WSL setups do not need it.
Step 1: Install
The native installer is the recommended route. It also keeps itself up to date in the background.
# macOS, Linux, WSL
curl -fsSL https://claude.ai/install.sh | bash# Windows PowerShell
irm https://claude.ai/install.ps1 | iex:: Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmdThe installer shows no progress while it downloads, so do not assume it hung. Two other routes exist if you prefer a package manager:
# Homebrew (stable channel, about a week behind latest)
brew install --cask claude-code
# WinGet
winget install Anthropic.ClaudeCodeHomebrew and WinGet installs do not update themselves. You run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode when you want a new version. There is also a claude-code@latest Homebrew cask that gets releases as soon as they ship. Debian, Fedora, RHEL and Alpine users can use apt, dnf or apk packages, listed on the setup page.
Open a new terminal window and check:
claude --versionA working install prints a version number followed by (Claude Code). If your shell says the command is not found, the install folder is not on your PATH yet. The docs have a "Fix your PATH" section for it.
Step 2: Start a session and sign in
Go to your project and start Claude Code.
cd /path/to/your/project
claudeOn first use it asks you to log in, and finishes the sign-in in your browser. If you have ANTHROPIC_API_KEY set and you approve the key when asked, it skips the login prompt and bills your Console account instead. To switch accounts later, type /login inside the session.
You will see the version, the current model and the working directory above the prompt. Two commands to remember straight away:
/helplists the commands./resumecontinues an earlier conversation.
Step 3: Ask questions before you ask for changes
Do not start with a change. Let it read first. Claude Code opens the files it needs on its own, so you do not paste anything.
what does this project do?where is the main entry point?explain the folder structureThis does two jobs. It shows you whether Claude Code understood the repo, and it warms up the session with the right context. If an answer is wrong, you have learned something cheap: the repo is confusing, or the question was vague.
You can point at a specific file with @ and a path, which includes the file's contents in your message. You can also paste a screenshot of an error, or pipe output in from your shell:
cat error.log | claude -p "what is going on here"The -p flag runs one prompt and exits. It is how you use Claude Code in scripts.
Step 4: Make one small change
Pick something you could do yourself in five minutes. A good first change has a clear finish line.
add input validation to the signup form so an empty email shows an error. Follow the pattern used by the other forms.Compare that with "improve the forms". The first names the symptom, the place and the style to follow. The second makes Claude guess. The best-practices page puts it this way: give it information it cannot get from reading the repo, and the specific prompt saves you a round of corrections.
Claude Code shows you the proposed edit. In the default mode it asks before it writes. Read the diff and choose Yes only when you would accept the same change from a colleague.
What the permission modes do
Press Shift+Tab at any time to cycle through modes. These are the ones in the permissions docs:
Mode | What it does |
|---|---|
| Asks the first time it uses each kind of tool |
| Accepts file edits and common file commands like |
| Reads and explores, makes no edits to your source until you approve a plan |
| Runs without routine prompts while a classifier checks risky actions |
| Denies anything that would have prompted |
| Skips prompts, so use it only in a disposable container |
The best-practices page says new terminal and VS Code sessions start in auto mode. If you would rather see every step on day one, start in Manual:
claude --permission-mode manualFor a bigger change, try plan mode first. Claude reads files and proposes a plan, and nothing is written until you approve it.
claude --permission-mode planStep 5: Run the checks
A change is not done when Claude says it is done. Give it something that returns pass or fail. If your project has tests, say so:
run the tests for the signup form and keep going until they passIf you have a linter or a type check, name that too. The docs make the same point from the other direction: when Claude has nothing to run, "looks done" is all it has to go on, and you become the test suite. Ask for evidence, meaning the command it ran and its output, not just "all tests pass".
Step 6: Review and commit
Ask what changed, then look yourself.
what files have I changed?git diffThen let Claude write the commit:
commit my changes with a descriptive messageClaude Code handles branches too: create a new branch called feature/signup-validation, show me the last 5 commits, and help me resolve merge conflicts all work as plain requests. Check the message with git log -1 before you push anything. If your team has a rule about commit trailers or attribution, say it in the prompt or in a CLAUDE.md file, because Claude Code has its own defaults for commit text.
Step 7: Steer, stop and undo
These controls matter more than any prompt trick.
Escstops Claude mid-action and keeps what it did so far.Esctwice on an empty prompt, or/rewind, opens a menu to roll back code, conversation or both./clearstarts a fresh conversation. After two failed corrections, the docs advise/clearand one better prompt instead of a third correction./compactsummarizes a long session. Add a focus, such as/compact keep the API changes and the test commands.claude -ccontinues the most recent conversation in the current folder.claude -rlets you pick an older one.
Rewind does not cover everything. Checkpoints track files Claude edited with its own file tools. A file changed only by a shell command is not restored. Git is the real safety net, which is why we asked for a clean tree in the prerequisites.
Step 8: Teach it your project once
You will soon notice you repeat yourself: how to run the tests, which folder holds what. Put that in a file called CLAUDE.md at the project root. Run /init and Claude writes a first version from your code. The memory docs suggest staying under 200 lines and writing instructions you can verify, such as "Run npm test before committing" rather than "test your changes".
Your own preferences go in CLAUDE.local.md, which you add to .gitignore. For the deeper version of this, with permissions, hooks and subagents, see Claude Code best practices and our CLAUDE.md guide.
Where to use it other than the terminal
The engine is the same in every place, so settings carry over. The docs list the web (claude.ai/code), a desktop app, VS Code, JetBrains IDEs, Slack, and CI through GitHub Actions and GitLab. A terminal is the best place to learn it, because you see every step. After that, our Claude Code overview covers each surface.
What can go wrong
These come from the install, permissions and costs docs, not from our own testing.
Problem | What the docs say | What to do |
|---|---|---|
| The install directory is not on your PATH | Open a new terminal, then use the PATH fix in the troubleshooting page |
| You ran the CMD command in PowerShell | Use the PowerShell command instead |
| You ran the PowerShell command in CMD | Use the CMD command instead |
Install fails with | A network or download issue | Follow the "Troubleshoot installation" page for your error |
Version never changes | Homebrew and WinGet do not auto-update | Run the upgrade command yourself |
Edits you did not want | A wide permission mode was on | Start in Manual or Plan mode for unfamiliar repos |
It "finished" but the feature is broken | It had no check to run | Name a test, build or lint command in the prompt |
A very long session gets slow or costly | Every request re-sends the conversation |
|
Shell access is the real risk. Claude Code can run commands, so treat a session like a contractor with your keyboard. Keep unfamiliar code in Manual mode, never run bypassPermissions on a machine you care about, and read the permissions docs before you add allow rules.
What it costs
Claude Code is not sold alone. It comes with a Claude plan, with API billing, or through a cloud provider. The consumer plans from the pricing page, checked 31 October 2026:
Plan | Price | Claude Code |
|---|---|---|
Free | $0 | Not in the feature list |
Pro | $17 a month billed annually ($200 up front), $20 billed monthly | Included |
Max | $100 a month | Included, with 5x Pro usage |
Ultra | $200 a month | Included, with 10x Pro usage weekly |
Plans are subject to change at Anthropic's discretion, and prices exclude tax. Usage limits reset on a five-hour window plus a weekly cap, and how fast you reach them depends on the model, the length of your chats and the size of your files.
If you pay by API token instead, the costs page says enterprise deployments average about $13 per developer per active day, or $150 to $250 per developer per month, with costs under $30 per active day for 90% of users. Treat that as a planning figure for teams, not a quote for you. Run /usage in a session to see where your own usage goes. For more on plans, see Claude pricing and Claude Code pricing.
Two habits cut cost without cutting quality: /clear between unrelated tasks, and a smaller model for routine edits. Switch with /model, and adjust thinking with /effort.
Privacy and data
Claude Code runs on your machine, but the model does not. Your prompts and the file contents it reads are sent to Anthropic over TLS. What happens next depends on your account:
- Free, Pro, Max and Ultra: training on your data only if you allow it in privacy settings. Retention is five years if allowed and 30 days if not.
- Team, Enterprise, API and third-party platforms: Anthropic says it does not train on code or prompts sent to Claude Code under commercial terms, unless the customer opts in. Standard retention is 30 days.
Session transcripts are stored in plain text under ~/.claude/projects/ on your machine for 30 days by default. If a repo holds secrets, add deny rules for files like .env, and see the best-practices page for the exact syntax. Do not point Claude Code at client code until you have read your contract and the data-usage page.
Checklist
- Installed with the native installer, and
claude --versionprints a version - Signed in with a plan or key you chose on purpose
- Working tree was clean before the first prompt
- Asked two or three read-only questions first
- Made one small change and read the diff before approving
- Named a test, lint or build command for Claude to run
- Know
Esc,/rewind,/clearandShift+Tab - Ran
/initand trimmedCLAUDE.mdto what Claude cannot see in the code - Checked your data-use setting for your account type
- Looked at
/usageafter the first long session
Next steps
You now know the loop: ask, read, change, check, commit. To practice it on a real build, follow the Claude Code tutorial. To make it behave across a team, read Claude Code best practices. To wire it to outside tools, see how to install an MCP server in Claude Code. If you are still choosing an agent, start at AI coding agents.
What this guide uses
Item | Type | Page |
|---|---|---|
Claude Code | Agent | |
Anthropic (plans and API) | Provider | |
Claude models | Models | |
Claude pricing | Pricing | |
Skills (for repeat tasks) | Add-on | |
Claude Code MCP servers | Add-on list |
Questions
Do I need to know how to code to use Claude Code?
You need a project folder and some comfort with a terminal. The official quickstart links a terminal guide for people who have never opened one. You do not need to write code yourself, but you should be able to read a diff before you approve it.
Is Claude Code free?
The tool has no separate fee, but it needs a paid Claude plan, a Claude Console account with credits, or a supported cloud provider. The Free chat plan does not list Claude Code.
How do I stop Claude Code from changing files without asking?
Start it in Manual mode with claude --permission-mode manual, or press Shift+Tab inside a session to cycle modes. Manual asks before file edits and most shell commands.
How do I undo what Claude Code just did?
Press Esc twice on an empty prompt, or type /rewind, to roll back code, conversation or both. Checkpoints cover files edited with Claude's own file tools, not files a shell command changed, so keep git as your real safety net.
Loading poll...