Guide: Claude Code in PowerShell (Stretch)

Claude Code is Claude living in your terminal instead of a window.
The command-line surface gives developers a fast, scriptable way to work with Claude. It's a stretch move for non-developers — useful, but read the cautions first.
The terminal is power with sharper edges. Reach for it when a window is in your way, not before.
Stretch Guide: Claude Code in PowerShell
Claude Code CLI · Windows terminal
⚠️ This is not where most people should start. Claude Code in the terminal gives Claude direct access to your shell, file system, and command execution — with fewer confirmation steps than Cowork’s desktop interface. If you’re not comfortable with the idea of Claude running shell commands on your machine, or if you haven’t worked through standard Cowork recipes yet, this guide isn’t for you today. Come back when you are.
What This Is
Claude Code is a command-line tool that runs Claude directly in your terminal — PowerShell, CMD, or Bash. Instead of a visual interface, you type prompts and Claude responds in the terminal, with the ability to read files, run commands, edit code, and interact with your file system.
The Cowork desktop app is built on the same underlying architecture. The difference is interface and control: the desktop gives you a GUI with visible progress steps and confirmation prompts. The terminal gives you speed and directness, with fewer guardrails in between.
Who this is actually for: Developers who want to use Claude alongside their coding workflow — running it in the same terminal where they build and test. It’s also useful for power users who want to script or automate Claude interactions at a level the desktop UI doesn’t expose.
If you’re a business owner who found this guide from a standard recipe, the desktop app almost certainly does everything you need. The CLI adds power and complexity in equal measure.
Prerequisites
- [ ] You’re comfortable with PowerShell or a terminal and know how to navigate to a folder, run a command, and read an error message
- [ ] You have a Pro, Max, Team, or Enterprise plan (free plan does not include Claude Code)
- [ ] You’ve run standard Cowork recipes and understand what Claude can do with file access
- [ ] Your computer meets the requirements: Windows 10 (build 1809) or later, 4GB+ RAM
Step 1 — Open PowerShell
- Press Windows + X and select Windows PowerShell or Terminal.
- You’ll know you’re in PowerShell when the prompt starts with
PS C:\. - If you see just
C:\without thePS, you’re in CMD. That works too, but the install command is different — see the note at the end of Step 2.
Step 2 — Install Claude Code
Run this command in PowerShell:
irm https://claude.ai/install.ps1 | iex
This downloads and runs the installer. It doesn’t require Administrator. When it finishes:
- Close PowerShell completely and reopen it. This refreshes your PATH so the
claudecommand is recognized. - Verify the installation worked:
claude --version
If you see a version number, you’re installed. If you see command not found or a similar error, see the troubleshooting note at the bottom of this guide.
If you’re in CMD instead of PowerShell, use this command instead:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Step 3 — Authenticate
- Run
claudein PowerShell. On first launch, Claude Code will prompt you to authenticate. - A browser window will open. Log in with the same Claude account you use for Cowork.
- Approve the authentication request. The terminal will confirm you’re logged in.
Step 4 — Verify Everything Works
Run a quick health check:
claude doctor
This checks your installation, authentication, and configuration. If everything shows green, you’re ready. If something is flagged, the output will tell you what to fix.
Step 5 — Start a Session
Navigate to a folder you want to work in, then launch Claude:
cd "C:\Users\YourName\Documents\MyProject"
claude
Claude Code starts an interactive session in that folder. It can read and write files in that location. Type your task as a prompt and Claude will respond, ask clarifying questions, or start working.
For your first session, keep it low-stakes: ask Claude to summarize the files in the folder, or draft a document. Get comfortable with how it operates in the terminal before asking it to modify existing files or run commands.
To exit a session, type /exit or press Ctrl+C.
What Can Go Wrong
Claude runs a shell command you didn’t expect. Unlike the Cowork desktop interface, Claude Code in the terminal can execute PowerShell commands more directly. If you ask Claude to “clean up” a folder, it might run delete commands. Be explicit about what you want — and what you don’t.
PATH issues after install. If claude isn’t recognized after installation, you didn’t reopen PowerShell after installing. Close it entirely and reopen — don’t just open a new tab.
You’re in CMD instead of PowerShell. The install command is different. The tell: PowerShell prompts start with PS C:\, CMD prompts start with C:\. Use the CMD command listed in Step 2 if needed.
Claude modifies files outside your intended scope. Claude Code operates in the folder you launched it from, but it can navigate elsewhere. If you’re working with important files, launch Claude from a specific project folder — not from your Desktop or Documents root.
Permission errors during install. Do not use sudo or run as Administrator. If you get permission errors, see the troubleshooting guide.
When the CLI Is Better Than Cowork
You’re a developer and want Claude in your existing terminal workflow — same window where you compile, test, and commit.
You want to script Claude interactions — the CLI supports non-interactive modes that let you pipe input and output, which the desktop UI doesn’t.
You want faster iteration — no GUI overhead, just a prompt and a response.
You’re comfortable reading and verifying output without visual progress steps.
For everything else — recurring business workflows, scheduled tasks, Projects with folder connections — the Cowork desktop interface is the better tool. Don’t use the CLI just because it feels more advanced.
Keeping Claude Code Updated
Native installations update automatically in the background. To update manually:
claude update
To check your current version and update status:
claude doctor
Further Reading
- Claude Code setup docs — full official documentation
- Claude Code cheatsheet — quick command reference
- Troubleshoot installation — if something went wrong
