Tag: Windows PowerShell

  • Install Claude Code on Windows: Commands, Setup & First Run (2026)

    Install Claude Code on Windows: Commands, Setup & First Run (2026)

    Quick answer: Open PowerShell and run irm https://claude.ai/install.ps1 | iex, then open a new terminal and run claude. No admin rights, no Node.js needed — Windows 10 1809+ or Windows Server 2019+. On Mac/Linux the equivalent is curl -fsSL https://claude.ai/install.sh | bash. You’ll need a Pro, Max, Team, Enterprise, or API account to sign in — the free Claude plan doesn’t include Claude Code.

    If you’ve spent time in the Claude Code subreddit or GitHub issues lately, you’ve seen the same Windows install problem cycle through every week: someone runs the install command, it prints “successfully installed,” and then claude --version returns “not recognized.” Then come the suggestions — switch to Git Bash, switch to WSL2, reinstall Node, blow away npm. Half of them are wrong for the current installer. This guide covers the install that actually works in 2026, plus what to do in your first session.

    What changed: the native installer is now the default

    Anthropic shipped a native installer that removed the Node.js dependency entirely, and as of 2026 it is the recommended path on every platform. The old npm install -g @anthropic-ai/claude-code route still works but is no longer the primary method Anthropic tests and updates.

    The native installer downloads a single binary, drops it in ~/.local/bin, registers it on your PATH, and auto-updates in the background. On Windows that means: no Node, no npm, no WSL2 unless you specifically want a Linux toolchain. PowerShell on Windows 10 or 11 (64-bit) is enough.

    The commands that actually work

    Open Windows PowerShell — not the x86 version, not Git Bash, not Command Prompt. The x86 entry runs as a 32-bit process and will fail on a 64-bit machine. Git Bash doesn’t support the TTY features Claude Code’s interactive CLI needs, so you’ll hit a “Raw mode is not supported” error before you finish authenticating.

    Then run:

    irm https://claude.ai/install.ps1 | iex

    irm is Invoke-RestMethod, iex is Invoke-Expression — the script handles the binary download, PATH update, and shell hooks. When it finishes, close the terminal and open a new PowerShell window. This is the step everyone skips: the PATH change applies to new shells only.

    In the new window:

    claude --version

    You should see a version string. Then run claude with no arguments from any project directory — the CLI opens your browser, asks you to sign in, and authorizes the local install. End to end: under five minutes on a clean machine.

    On macOS or Linux, the equivalent one-liner is:

    curl -fsSL https://claude.ai/install.sh | bash

    Prefer a package manager on Windows? winget install Anthropic.ClaudeCode works too, but winget installs don’t auto-update — run winget upgrade Anthropic.ClaudeCode periodically.

    No terminal? Use Claude Desktop’s Code tab

    If you’d rather skip the terminal entirely, Claude Desktop (macOS and Windows) includes Claude Code as a graphical Code tab — visual file diffs, a built-in preview panel, no command line required. Install the app, sign in with a paid account, click the Code tab, choose a project folder, and you’re in.

    Session type What it does Best for
    Local Runs on your machine, accesses your files directly Everyday development work
    Remote Runs on Anthropic’s cloud, keeps going if you close the app Long-running tasks, autonomous work
    SSH Connects to a remote machine over SSH Server or cloud VM development

    On Windows, Git must be installed for local sessions to work. The CLI and the Desktop Code tab share configuration files and can run simultaneously on the same project.

    You need a paid account — the free tier doesn’t include Claude Code

    This catches new users every week. The free Claude.ai plan gets you chat; it does not get you Claude Code. You need one of:

    • Pro — $20/month (or $17/month billed annually)
    • Max 5x — $100/month, or Max 20x — $200/month
    • Team Premium — $100/seat/month annual (minimum 2 seats, maximum 150). Note: Team Standard ($25/seat) does not include Claude Code
    • Enterprise, or API credits (billed per token)

    Pro and Max draw from the same usage pool as regular Claude chat. If you’re evaluating whether to upgrade, the Pro window will tell you within a week — you either hit the cap during real work or you don’t.

    First-run authentication: two options

    Option 1 — Claude subscription (Pro, Max, Team, Enterprise). Run claude, select “Login with Claude.ai,” and a browser window opens to authorize. Your subscription covers usage — no separate API billing.

    Option 2 — Anthropic API key. Set the key as an environment variable first:

    $env:ANTHROPIC_API_KEY = "sk-ant-..."  # PowerShell
    claude

    API usage is billed per token at standard rates. For heavy daily use, a Max subscription is usually more economical than API billing.

    The five errors you’ll hit, and what fixes them

    “claude is not recognized as the name of a cmdlet.” Your PATH wasn’t updated, or you didn’t open a new terminal. Close PowerShell and reopen. If it persists, add the install location to your user PATH:

    $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User')
    [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User')

    Then open a new terminal and run claude doctor for a full diagnostic.

    “Raw mode is not supported.” You’re in Git Bash. Switch to Windows PowerShell — Git Bash lacks the TTY interface the CLI needs.

    Microsoft Store popup interrupts installation. A “Get an app to open this ‘claude’ link” popup sometimes appears on Windows 11. Dismiss it and re-run the install command. If it persists, install Git for Windows first — it registers URL handlers that resolve the popup.

    Duplicate npm and native installs. If you installed via npm before and later ran the native installer, you have two binaries on PATH and version checks disagree. Remove the npm one: npm uninstall -g @anthropic-ai/claude-code, then verify with where.exe claude — only one path should come back.

    “Invalid code” during OAuth. The browser login generates a one-time code you paste back into the terminal. It expires fast — complete the browser flow and paste immediately; press Enter to retry if it lapses.

    Your first session: the commands that cover 90%

    Run claude from inside a real project directory — not an empty folder. Claude Code reads context from the surrounding repo (including CLAUDE.md if one exists); starting empty makes the first interaction feel useless.

    claude — starts the interactive session (REPL). Describe what you want: “add a rate limiter to the auth middleware.” Claude reads the files it needs, proposes changes, and asks approval before modifying anything.

    claude -p "prompt" — one-shot, non-interactive. Good for scripting and CI:

    claude -p "What are all the API endpoints in this codebase?"

    claude -c — resume your most recent conversation with full context. claude --model — override the model for a session. claude mcp add — connect external tools (MCP servers) like GitHub or web search:

    claude mcp add github -- npx -y @modelcontextprotocol/server-github

    Slash commands inside a session

    Command What it does
    /help Show all available commands
    /clear Reset context without leaving the session
    /compact Compress prior context to save tokens
    /cost Token usage and estimated cost for this session
    /model Switch the model mid-session
    /init Generate a CLAUDE.md with project context
    /review Multi-agent code review of the current branch

    CLAUDE.md — project-level context

    Drop a CLAUDE.md file in your project root and Claude Code reads it automatically at session start — architecture notes, test commands, deploy targets, house rules (“never modify migration files directly”). Generate a starter with /init.

    Permission modes

    By default Claude asks before running bash commands or modifying files. --dangerously-skip-permissions skips all confirmations — use only in isolated environments (Docker, CI), never on your primary machine. During a session you can also “Allow always” individual tools for the rest of that session.

    The setup isn’t the hard part

    Most Windows pain in the Claude Code ecosystem comes from following install guides written for the npm-era CLI, then layering WSL2-era troubleshooting on top. The current path is one PowerShell command, a new terminal, and a browser login. The next thing to figure out isn’t installation — it’s whether your Pro window survives a real week of work, and whether your team needs Premium seats. That math determines the actual cost of Claude Code on Windows, not whether the binary runs.

    FAQ

    Do I need Node.js to install Claude Code on Windows?
    No. The native installer ships a single binary with no Node.js dependency. The npm route still exists and needs Node.js 22+, but it’s no longer the recommended path.

    Does Claude Code work on the free Claude plan?
    No. Pro ($20/month) is the cheapest way in.

    Why does claude --version say “not recognized” right after installing?
    Your terminal still has the old PATH. Close and reopen the terminal first.

    Do I need Git for Windows?
    Optional but recommended. With it installed, Claude Code runs shell commands through Git Bash; without it, it falls back to PowerShell.

    Does Claude Code auto-update on Windows?
    Native installs auto-update in the background. Winget installs don’t — upgrade periodically.

    Does Claude Code work on Linux?
    The Desktop app doesn’t support Linux, but the CLI does — curl -fsSL https://claude.ai/install.sh | bash.

    What’s the difference between the Desktop Code tab and the CLI?
    The Code tab is graphical (visual diffs, preview panel, no terminal); the CLI runs in your terminal with the same core operations. They share config and can run simultaneously.

    Can Claude Code access the internet?
    Not by default. Its WebFetch tool fetches a specific URL you provide; for live search, add an MCP server like Brave Search.

    What does Claude Code do with my code?
    File contents needed for inference go to the Anthropic API. With an API key you can configure zero data retention; on a subscription, standard Anthropic retention applies.

    Last verified July 2026 against the official Claude Code setup docs. Related on Tygart Media: Claude pricing · Anthropic Console & API keys.

  • Claude Code v2.1.126: Gateway Model Picker & PowerShell

    Claude Code v2.1.126: Gateway Model Picker & PowerShell

    Last refreshed: May 15, 2026

    Claude Code shipped v2.1.126 today, May 1, 2026. This is the 9th release in April’s sprint and continues what has been a 2–3 releases per week cadence throughout the month. Here is the complete picture of what shipped this week across v2.1.120 through v2.1.126, with operational context for each feature that actually matters.

    v2.1.126 — Today’s Release

    Side-by-side cards defining what Claude Code is and is not
    v2.1.126 — today’s release.

    Gateway Model Picker

    The gateway model picker allows you to route different tasks within a single Claude Code session to different models. This is the first step toward Claude Code as a multi-model orchestration layer rather than a single-model coding assistant. Practical use: run Haiku 4.5 on file reading, search, and summarization tasks where speed matters; route Opus 4.7 at complex reasoning, architecture decisions, and code generation where quality is the priority. The cost reduction on high-volume workflows can be material — Haiku is roughly 30× cheaper per token than Opus.

    PowerShell as Primary Shell on Windows — Git Bash No Longer Required

    This is the most significant quality-of-life change in this release for enterprise Windows shops. Claude Code previously required Git Bash as its terminal environment on Windows, which meant every Windows developer needed a non-standard shell installation, created friction in corporate IT environments with software approval processes, and produced a different developer experience than Mac/Linux teammates.

    Starting with v2.1.126, PowerShell is the primary shell on Windows. Git Bash is no longer required. For enterprise teams where half the developer fleet runs Windows and software installation requires IT approval, this removes a significant deployment barrier. Claude Code is now a standard Windows application from an IT management perspective.

    OAuth Code Terminal Input for WSL2, SSH, and Containers

    Authentication in headless environments — WSL2 sessions, SSH remote development, Docker containers — previously required workarounds. v2.1.126 adds OAuth code terminal input: Claude Code displays the authorization code directly in the terminal, you paste it into your browser, and authentication completes without requiring a browser redirect to the headless environment. Eliminates the most common authentication friction point for remote and containerized development workflows.

    claude project purge

    New command that cleans up stale project data accumulated across sessions. For teams running Claude Code in CI/CD pipelines or long-running agent workflows, project data can accumulate and affect performance. claude project purge gives you explicit control over that cleanup rather than relying on automatic garbage collection.

    v2.1.120–122 — April 28 Stack

    Five stacked panels of daily Claude Code command habits
    v2.1.120–122 — April 28 stack.

    alwaysLoad MCP Option

    MCP servers can now be configured to always load regardless of context window state. Previously, Claude Code would make decisions about which MCP servers to initialize based on available context. alwaysLoad: true in your MCP server config guarantees that server is always available — critical for production deployments where MCP tools need to be reliably present, not conditionally loaded.

    claude ultrareview Subcommand

    claude ultrareview triggers a deep, multi-pass code review that goes beyond standard review. It applies multiple review personas in sequence — security researcher, performance engineer, maintainability analyst — and synthesizes findings into a prioritized report. For code that needs to meet high standards before production merge, ultrareview is the command. It consumes more tokens than standard review, so use it on pull requests that matter, not every commit.

    claude plugin prune

    Removes unused plugins from your Claude Code installation. As the plugin ecosystem has grown and plugin auto-update behavior has been refined in recent releases, teams accumulate plugins that are no longer active in their workflow. claude plugin prune audits your installed plugins against recent usage and removes those that have not been invoked within a configurable time window.

    Type-to-Filter Skills Search

    The skills picker now supports live type-to-filter — start typing a skill name and the list filters in real time. For teams with large skill libraries or plugin collections, this eliminates the scroll-and-hunt workflow that slowed skill invocation. Small UX change, large daily time savings at scale.

    ANTHROPIC_BEDROCK_SERVICE_TIER Environment Variable

    New environment variable that allows Claude Code running on Amazon Bedrock to specify service tier at the environment level rather than per-request. For teams using Claude Code through Bedrock as their primary deployment path — common in regulated industries that require AWS-native infrastructure — this simplifies configuration management across multiple environments and removes per-request overhead.

    OpenTelemetry Improvements

    Extended OpenTelemetry trace data now includes more granular span information for Claude Code operations. For enterprise teams with existing observability infrastructure (Datadog, Grafana, Honeycomb), Claude Code activity is now more fully integrated into your trace timeline — you can see exactly where Claude Code operations land within the context of your broader application traces.

    v2.1.123 — April 29

    Fixed OAuth 401 retry loop triggered when CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS was set. If you were seeing repeated authentication failures in environments with that flag set, update to v2.1.123 or later immediately.

    Update Now

    Desk with laptop, checklist notebook, and billing card ready before creating an Anthropic API key
    Update now.

    Update via npm install -g @anthropic-ai/claude-code@latest or through your package manager. v2.1.126 is the current stable release. For teams running Claude Code in CI/CD, update your Docker base images or pipeline steps to pin to 2.1.126.

    Related on Tygart Media: Ultraplan & Ultrareview · Claude Code getting started · Claude Code vs Cursor.