Start here: install Claude Code and run your first task
Install Claude Code, sign in, make your first change, then set up CLAUDE.md with /init and learn when to use /clear.
This guide is for anyone who has never run Claude Code before. In about fifteen minutes you go from an empty terminal to a working install, a first code change in your own project, and a starter CLAUDE.md file. Every later guide on this site assumes you have done these steps.
What you will have at the end
- Claude Code installed and printing its version in your terminal
- A signed-in account that stays signed in between sessions
- One real change made by Claude in a project you own, reviewed by you
- A first CLAUDE.md generated with
/init - The habit of running
/clearbetween unrelated tasks
Before you start
- A computer that meets the system requirements: macOS 13.0 or newer, Windows 10 1809 or newer, or a recent Linux such as Ubuntu 20.04 or Debian 10, with at least 4 GB of RAM and an internet connection.
- An account to sign in with. The quickstart lists a Claude subscription (Pro, Max, Ultra, Team or Enterprise), a Claude Console account, or access through a supported cloud provider.
- A code project you can experiment on. A small side project with git is ideal, because you can undo anything.
- If you are on native Windows, the quickstart recommends installing Git for Windows so Claude Code can use its Bash tool. WSL does not need it.
Step 1: Install Claude Code
On macOS, Linux or WSL, run:
curl -fsSL https://claude.ai/install.sh | bashOn Windows PowerShell, run:
irm https://claude.ai/install.ps1 | iexThese are the native installers from the quickstart. The installer prints nothing while it downloads, so give it a minute. Native installs also keep themselves up to date in the background.
If you prefer a package manager, Homebrew and WinGet work too:
brew install --cask claude-codewinget install Anthropic.ClaudeCodeThe catch is that neither of those updates itself. You run brew upgrade claude-code or winget upgrade Anthropic.ClaudeCode yourself from time to time, as the quickstart notes.
When the install finishes, open a new terminal window and check it:
claude --versionYou should see a version number followed by (Claude Code). At the time of writing, the changelog shows 2.1.318 as the newest release.
Step 2: Start a session and sign in
Move into your project folder and start Claude Code:
cd /path/to/your/project
claudeThe first time, Claude Code asks you to log in and opens your browser to finish. After that your credentials are stored, so you will not be asked again on this machine. If you need to switch accounts later, type /login inside a session (quickstart).
Once you are in, the prompt shows your version, the current model and the folder you are working in. Type /help to see the commands available to you.
Step 3: Ask about the project first
Before you change anything, let Claude read. Type a plain question:
what does this project do?Claude reads your files as it needs them. You do not have to paste code or point it at anything. Follow up with something narrower, such as where is the main entry point? or explain the folder structure. These prompts come straight from the quickstart, and they are a good way to check that Claude understands the codebase before you trust it with an edit.
Step 4: Make your first change
Now ask for something small and easy to review:
add a hello world function to the main fileClaude finds the right file and shows you the change. If it asks for approval, choose Yes.
Whether Claude asks first depends on the permission mode. New terminal sessions now start in auto mode, where a background classifier reviews risky actions before they run, according to the best practices page. Press Shift+Tab to cycle through the modes. The status bar tells you which one is on, and manual mode on means Claude asks before anything beyond reading (permission modes). For your very first session, manual mode is a good way to see every step.
Then ask Claude to commit it:
commit my changes with a descriptive messageGit works through plain language too: what files have I changed? or show me the last 5 commits both work.
Step 5: Generate a CLAUDE.md with /init
Type:
/initThe commands reference describes /init as the way to initialize a project with a CLAUDE.md guide. Claude studies your codebase and writes a file with the build commands, test instructions and conventions it finds. If a CLAUDE.md already exists, it suggests improvements instead of overwriting it (memory docs).
Claude reads CLAUDE.md at the start of every session, so this file is how you stop repeating yourself. Open it and cut anything Claude could work out by reading the code. The best practices page says that after /init, "the work is mostly removing lines." Our guide on writing a CLAUDE.md that helps goes deeper.
Step 6: Use /clear between tasks
When you finish one task and start something unrelated, type:
/clearThis starts a new conversation with empty context. The best practices page explains why it matters: the next task does not keep paying for the history of the last one, and a focused context gives better answers. You can still get back to the old conversation with /resume (commands).
A second use for /clear: if you have corrected Claude twice on the same thing and it is still wrong, clear and write one better prompt that includes what you learned. That beats a third correction.
Check it worked
Run these and compare:
claude --versionin a fresh terminal prints a version number and(Claude Code).- Starting
claudeagain in the same folder does not ask you to log in. git log -1shows the commit Claude made in step 4.- A
CLAUDE.mdfile exists in the project root. Inside a session,/context alllists it under Memory files (memory docs).
Common problems
command not found: claude after installing. The install folder is not on your PATH yet. Open a new terminal first. If it still fails, follow the PATH fix in the install troubleshooting page.
PowerShell says The token '&&' is not a valid statement separator. You ran the CMD command in PowerShell. Use the irm command above instead. The reverse error, 'irm' is not recognized, means you are in CMD (quickstart).
The install command fails with syntax error near unexpected token '<'. The download returned a web page instead of the script. Causes include regional availability, network issues or a temporary outage, so retrying after a few minutes often works. The troubleshooting page has fixes and other install methods.
Login fails and you are not sure why. Run /logout, close Claude Code, start claude again and sign in fresh. If the browser does not open, press c to copy the login URL and paste it into a browser yourself (troubleshooting).
Something else feels off. Run claude doctor in your shell. It prints read-only diagnostics about your install and settings without starting a session (setup).
Next
- The master setup prompt: one prompt that configures models, agents and skills for you.
- From idea to launched product in a weekend: a paid walkthrough that takes this setup all the way to a shipped app.
Sources
- https://code.claude.com/docs/en/quickstart
- https://code.claude.com/docs/en/setup
- https://code.claude.com/docs/en/troubleshoot-install
- https://code.claude.com/docs/en/commands
- https://code.claude.com/docs/en/memory
- https://code.claude.com/docs/en/best-practices
- https://code.claude.com/docs/en/permission-modes
- https://code.claude.com/docs/en/changelog
Last checked: 2026-11-06