Chapter 3. Installing and Logging In
Required Read this to follow this stage.One-line summary: Paste the install command from the official documentation, then check it with
claude --versionin a new terminal window. Then runclaudein your practice folder and log in through your browser, and you are ready.
You only need to install it once. The command is just one line.
Before You Paste — Check the Source First
The install command is in the very next section. Before you paste it, check just one thing.
An install command runs a program downloaded from the internet on your computer right away. It is convenient, but if you paste a command from the wrong site, a harmful program could run with your permissions.
So do not paste an install command from an unfamiliar site as is. The same goes for the commands in this course. Open the official "Quickstart" documentation and check with your own eyes that it is the same command.
- Weak example: You paste an install command you found on a blog straight into the terminal.
- Better example: You open the official documentation, check that it is the same command, and then paste it.
For any command you paste into the terminal, look at the source first. The same habit will protect you when you install other programs too.
Quick check
You found an install command you have never seen on a blog. What should you do?
Install Commands by Operating System
Open the terminal, paste only one command that matches your computer, and press Enter. These are the commands from the official documentation.[1]
On Mac, Linux, and WSL (a feature for using Linux inside Windows), type this.
curl -fsSL https://claude.ai/install.sh | bashIn Windows PowerShell, type this.
irm https://claude.ai/install.ps1 | iexThe two commands do the same thing. The first part downloads the install file, and the part after | (vertical bar) runs what was downloaded. You can install it even if you do not understand every piece.
More details (click to expand)
|is a symbol that passes the result of the command before it to the command after it.- On Mac and Linux,
curldownloads andbashruns. - In PowerShell,
irmdownloads andiexruns.[2] -fsSLis four options written together that set how the download works. Their meanings are in the Command Reference.
There is no progress indicator while it downloads. Even if nothing seems to be happening, do not close the window. Wait. When it finishes, you will see the message Claude Code successfully installed!.[3]
If you put the command in the wrong window, you get an error. Nothing is broken. You just picked the wrong window.[4]
- You see
'irm' is not recognized: You are in CMD, not PowerShell. Open PowerShell and try again. - You get an error because of
-fsSL: You put the Mac and Linux command into PowerShell. Use the PowerShell command.
Depending on your screen language, errors may appear in Korean. The meaning is the same.
On Windows, you do not need to run it as an administrator.[5] In most cases, the single line above is enough.
More details (click to expand)
- Windows and Git: You can follow along as is even without Git (a tool that keeps a record of changes to files). Without it, Claude Code uses PowerShell instead.[6] You will install Git in Chapter 12.
- Other ways to install: You can also install it with a program manager such as Homebrew on Mac or WinGet on Windows.[7] If you do not already use one of those, use the single line above.
Quick check
You entered the install command, but nothing changes on the screen. What should you do?
Checking the Installation
When the installation finishes, open a new terminal window and type this command.[8]
claude --versionIf a number appears like this, it worked. Your number may be different. Check that (Claude Code) comes after it.

2.1.318 (Claude Code)Why a new window? A window that was already open keeps using its old settings.[9] So it may not work in the window where you finished installing, yet work in a new one.
Quick check
After the install is done, where should you type claude --version?
When You See command not found
Even in a new window, you may see a message like this. On Windows, you see the words not recognized. Depending on your screen language, it may appear in Korean. The meaning is the same.
zsh: command not found: claude
bash: claude: command not foundIt means the installation worked, but the terminal cannot find the program.[10]
The terminal looks for programs in a list of folders called PATH. Think of it as a phone book. Even if the program is there, the terminal cannot find it if it is not written in the list. The installer only tells you how to fix this. It does not change PATH itself.[11]
The program is at ~/.local/bin/claude on Mac and Linux, and at %USERPROFILE%\.local\bin\claude.exe on Windows.[12] You just need to add this folder to the list. Below are the commands from the official documentation. Use only the one that matches your computer.
For Zsh, the default shell (the program in the terminal that takes your commands) on a Mac, use this.
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcFor most Linux systems (Bash), use this.
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrcFor Windows PowerShell, use this.
$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
[Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')Here is what each piece of the command means.
- The
echoline: Saves the setting to a file.>>is a symbol that adds to the end of a file. So the existing contents of the settings file are not erased. - The
sourceline: Applies the saved setting to the window you are in now. - Type it only once: If you type it twice, the same line goes in twice.
- Windows: After typing the two lines, you need to restart the terminal.[13]
Then type claude --version again. If a number appears, it is fixed.
If it still does not work, see the official "Troubleshoot installation and login" documentation. If claude runs at all, you can check the installation status with claude doctor. It shows only a diagnosis without opening a session.[14]
Quick check
The install finished, but you get command not found: claude. What does that mean?
Logging In
In a new window, move to the practice folder from Chapter 2 and type claude. On Mac and Linux, type this.
cd ~/hello-ai-practice/terminal
claudeIn Windows PowerShell, type this.
cd $HOME\hello-ai-practice\terminal
claudeThe first time you run it, you are asked to log in. Individual subscribers log in with their claude.ai account.[15] Here are the steps.[16]
- When the browser opens, log in.
- If the browser does not open, press
cin the terminal. The login address is copied, so paste it into your browser. - If the browser shows a code, paste it into the terminal where it says
Paste code here if prompted. - When
Login successfulappears, press Enter.
You only need to log in once. Your information is saved, so it will not ask again. If you want to switch accounts, type /login while it is running.[17]
More first-time setup screens may appear before or after logging in. A window asking whether you trust the folder may also appear. You will look at this window together in Chapter 4. For now, you can leave with Esc.
Quick check
What do you do if the browser does not open by itself when you log in to claude?
Updating and Removing
Updating. If you installed it with the single line above, there is nothing extra to do. It downloads updates automatically in the background and applies them the next time you start Claude Code.[18] If you want to update right away, type claude update in the terminal. If it is already up to date, it tells you Claude Code is up to date.[19]
If you installed it with Homebrew or WinGet, it does not update automatically. You need to update it yourself with that tool from time to time.[20]
Removing. You do not need to know how to remove it right now, so it is folded away. Expand it later when you need it.
More details (click to expand)
If you installed it on Mac or Linux with the single line above, remove it with these two lines.[21]
rm -f ~/.local/bin/claude
rm -rf ~/.local/share/clauderm is a command that deletes right away without going through the trash. -r is an option to delete everything inside the folder, and -f is an option to delete without asking. Be sure to check the text before you type it. For Windows and other install methods, follow the Uninstall section of the official "Advanced setup" documentation.
Quick check
How does Claude Code get updated if you installed it with the one-line command from the official docs?
Try It Yourself
- Open the official documentation and check that the install command is the same as in this chapter.
- Paste the command for your operating system and wait until it finishes.
- Open a new window and type
claude --version. If you seecommand not found, follow the section above. - Run
claudein the practice folder and log in. If the trust window appears, leave withEsc. If you got as far as the input box, type/exit.
Ask yourself: Does claude --version show a number? If so, you can give it its first task in the next chapter.
Summary
- Check that the install command matches the official documentation before you paste it.
- On Mac and Linux, use the
curlline. On Windows, use theirmline in PowerShell. Wait even if there is no progress indicator. - Check it with
claude --versionin a new window. - If you see
command not found, first open a new window. If it still does not work, add the PATH line. - Log in only once, by running
claudein the practice folder and signing in through your browser. - The default installation updates automatically.
Glossary
| Term | One-line meaning |
|---|---|
| PATH | The list of folders where the terminal looks for programs |
| WSL | A feature for using Linux inside Windows |
curl | A command that fetches content from the internet |
irm | A command that fetches internet content in PowerShell |
rm | A command that deletes files |
Finished this chapter?
Progress is saved only in this browser. See your progress on the full table of contents.
Next chapter: Chapter 4. Your First Session
References (21)
This guide was run on a computer that was already installed and logged in, so the installation and login steps were not actually tried. The installation and login steps in this chapter come from the official documentation. Claude Code official docs, "Quickstart." "curl -fsSL claude.ai | bash" / "irm claude.ai | iex" code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Terminal guide for new users." "
irmfetches the file andiexruns it." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Quickstart." "The install command shows no progress while it downloads Claude Code." code.claude.com · "Terminal guide for new users." "When the installer finishes, you'll see "Claude Code successfully installed!"" code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Quickstart." "If you see
'irm' is not recognized as an internal or external command, you're in CMD, not PowerShell." code.claude.com · "Troubleshoot installation and login." "you ran the macOS/Linuxcurl -fsSL ... | bashinstaller in Windows PowerShell, wherecurlis an alias forInvoke-WebRequestand rejects the-fsSLflags" code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Advanced setup." "You do not need to run as Administrator." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Quickstart." "Git for Windows is recommended on native Windows so Claude Code can use the Bash tool." / "If Git for Windows is not installed, Claude Code uses PowerShell as the shell tool instead." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Quickstart." "brew install --cask claude-code" / "winget install Anthropic.ClaudeCode" code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Quickstart." "When the installer finishes, open a new terminal window and run
claude --version." / "The command prints a version number followed by(Claude Code)." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Troubleshoot installation and login." "a window that was already open keeps its old PATH, and a terminal inside an editor takes its PATH from the editor." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Troubleshoot installation and login." "If installation succeeded but you get a
command not foundornot recognizederror when runningclaude, the install directory isn't in your PATH." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Troubleshoot installation and login." "Your shell searches for programs in directories listed in PATH" / "It prints the fix with that note but doesn't change PATH itself." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Troubleshoot installation and login." "the installer places
claudeat~/.local/bin/claudeon macOS/Linux or%USERPROFILE%\.local\bin\claude.exeon Windows" code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Troubleshoot installation and login." "The
echocommand saves the setting for every new terminal, andsourceapplies it to the window you're in." / "Restart your terminal for the change to take effect." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Advanced setup." "prints read-only installation and settings diagnostics without starting a session" code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Quickstart." "Claude Code prompts you to log in on first use." code.claude.com · "Authentication." "Claude Pro, Max, or Ultra subscription: log in with your claude.ai account." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "Authentication." "If the browser doesn't open automatically, press
cto copy the login URL to your clipboard, then paste it into your browser." / "If your browser shows a login code instead of redirecting back after you sign in, paste it into the terminal at thePaste code here if promptedprompt." / "When login completes, the terminal showsLogin successfuland prompts you to pressEnterto continue." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Quickstart." "Once logged in, your credentials are stored and you won't need to log in again." / "To switch accounts later or re-authenticate, type
/logininside the running session." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Quickstart." "Native installations automatically update in the background to keep you on the latest version." code.claude.com · "Advanced setup." "Updates download and install in the background, then take effect the next time you start Claude Code." code.claude.com (checked on 2026-11-06) ↩︎
Claude Code official docs, "CLI reference." "Update to latest version" code.claude.com · "Advanced setup." "If you're already on the newest version, it reports
Claude Code is up to date (<version>)." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Quickstart." "Homebrew installations do not auto-update." / "Run
winget upgrade Anthropic.ClaudeCodeperiodically to get the latest features and security fixes." code.claude.com (checked on 2026-11-06) ↩︎Claude Code official docs, "Advanced setup." "rm -f ~/.local/bin/claude" code.claude.com (checked on 2026-11-06) ↩︎