11Use Claude in the Terminal (optional)
Start
-
Lesson 11 · 15 min · 13 steps
Install the Claude Code CLI and use it in the terminal
What you get Claude answering you in a plain typing window, signed in and working in your folder
Before you start
- The Claude desktop app working on a paid plan (Pro or higher).
- The folder you picked in lesson 2.
- 15 minutes and an internet connection.
Steps in this lesson
- Press Cmd+Space, type
Terminal, press Enter.Press Win+X and choose Windows PowerShell (or Terminal). - Copy the line below, paste it here, and press Enter.
- When you see
Claude Code successfully installed!, close this window. - Type
claude --versionand press Enter. - Only if you got an error: paste this and press Enter.
- Go to your folder: paste the line and press Enter.Go to your folder: paste the line and press Enter.
- Type
claude, press Enter, then sign in when your browser opens. - Look at the bottom line. Not auto mode? Press Shift+Tab.
- Type this prompt and press Enter.
- Type
/help, press Enter, then press Esc to close it. - Type
exitand press Enter to leave. - Type
claude doctorand press Enter to check your setup. - Optional: type
git --versionto see if Git is installed.Optional: typegit --versionto see if Git is installed.
Step 1 of 13
Press Cmd+Space, type
Terminal, press Enter.Press Win+X and choose Windows PowerShell (or Terminal).
The line should start with
PS C:\.Step 2 of 13
Copy the line below, paste it here, and press Enter.
Nothing moves on screen while it downloads. Just wait.
Install on Maccurl -fsSL https://claude.ai/install.sh | bash
Install in PowerShellirm https://claude.ai/install.ps1 | iex
Step 3 of 13
When you see
Claude Code successfully installed!, close this window.Then open a new one, like at the start. Only a new window can find Claude.
Step 4 of 13
Type
claude --versionand press Enter.You should see a version number followed by
(Claude Code).Run thisclaude --version
- 1Terminal
- 2claude --version
- 3Version number
After claude --version you see a version number, then (Claude Code). This is the Code tab's terminal panel; a Terminal window shows the same line. Step 5 of 13
Only if you got an error: paste this and press Enter.
The error says
command not found: claudeor'claude' is not recognized. Then open a new window and try again.Fix on Macecho 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc
Fix in PowerShell$currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User') [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')Step 6 of 13
Go to your folder: paste the line and press Enter.
If your folder is in Google Drive, select it in Finder and press Option+Cmd+C, then type
cd ", paste, type", and press Enter.Go to your folder: paste the line and press Enter.
If your folder is in Google Drive, use
cd "G:\My Drive\claude-practice"instead (Drive is usually G:).Run thiscd ~/Documents/claude-practice
Run thiscd $env:USERPROFILE\Documents\claude-practice
Step 7 of 13
Type
claude, press Enter, then sign in when your browser opens.Asked for a look first? Press Enter. Pick your Claude account, then press Enter at
Login successful.Run thisclaude
- 1Prompt line
Claude Code started in the terminal panel, waiting at the prompt line. Step 8 of 13
Look at the bottom line. Not auto mode? Press Shift+Tab.
Each press moves to the next mode. New sessions usually start in auto.
Step 9 of 13
Type this prompt and press Enter.
Want Claude to only read? Start with "Read only:". Claude keeps that, even in auto.
Type this into the sessionList the files in this folder and tell me in one line what each one is.
Step 10 of 13
Type
/help, press Enter, then press Esc to close it.Run this/help
Step 11 of 13
Type
exitand press Enter to leave.The chat is saved:
claude --continuein this folder brings it back.Run thisexit
Step 12 of 13
Type
claude doctorand press Enter to check your setup.Look at the
Auto-updatesline: it shows whether Claude keeps itself up to date.Run thisclaude doctor
Step 13 of 13
Optional: type
git --versionto see if Git is installed.Most Macs have Git. Your Mac offers to install command line tools? Click Install, or skip.
Optional: type
git --versionto see if Git is installed.Not recognized? That's fine: Claude uses PowerShell instead. Nothing else to do.
Run thisgit --version
-
You did it
Claude answering you in a plain typing window, signed in and working in your folder
Take this to any task
- Let the tool check its own setupMany tools have a built-in check, like claude doctor here; run it after setup or when something seems off, and read what it says to fix.
- Reopen the window after installing somethingA tool you just installed is often found only by windows opened after it, so when a fresh install says not found, close and reopen first.
- The exact error words point to the fixMessages like 'command not found' or 'irm is not recognized' say what's missing or which window you're in; match those words to the fix.
- A quiet screen often means it is workingDownloads can show nothing for a while, and password boxes in the terminal show no dots as you type; give it a moment before you decide it's stuck.
Check yourself
1. Which window runs
irm https://claude.ai/install.ps1 | iex?2. Why open a new terminal window after the install?
3. Which key moves Claude through the modes in the terminal?
All three right. Mark the lesson as done.