Claude Code is an AI coding agent from Anthropic that lives in your terminal and helps write code faster through natural language commands. Understands entire codebase, executes routine tasks, explains complex code, manages git workflows and integrates with your development environment.
This guide shows how to install Claude Code on Windows three ways — via PowerShell (recommended), WinGet and npm (deprecated). No marketing — only practice: what works, gotchas, how to solve typical problems.
What is Claude Code
Claude Code is a terminal AI assistant working directly in your project's command line. Not an IDE plugin or web interface — full-featured terminal agent understanding entire project context and executing tasks through bash/PowerShell commands.
How it works:
Run claude in project directory. Claude Code scans file structure, reads code, understands dependencies and architecture. Give natural language command — "add email validation to registration form" or "write tests for AuthController". Claude analyzes code, suggests changes, shows diff and applies edits with your confirmation.
Tool works with any programming languages and frameworks — Python, jаvascript, TypeScript, Go, Rust, Java, C#, PHP, Ruby. Understands context of React, Vue, Django, Laravel, .NET, Rails projects. Helps with git — creates commits with meaningful messages, works with branches, resolves conflicts.
Capabilities out of box:
Code generation from task description considering project style. Refactoring — improving existing code while preserving functionality. Writing tests for functions and modules. Explaining complex code in simple language. Finding and fixing bugs. Git workflows — commits, branches, pull requests. Working with databases through MCP servers. GitHub integration for managing issues and PRs.
Difference from GitHub Copilot:
GitHub Copilot works inside editor and autocompletes code line-by-line. Claude Code works in terminal and understands entire project. Copilot autocompletes at function level. Claude executes tasks at feature level — adds new endpoints, writes DB migrations, creates UI components.
Claude Code sees entire codebase simultaneously and understands connections between files. Can modify multiple files within single task. Works with git out of box. Copilot for autocompletion while typing, Claude Code for delegating entire tasks to AI agent.
Models under the hood:
By default uses Claude Opus 4.6 — Anthropic's most powerful model for deep reasoning on large codebases. Can switch to Claude Sonnet 4.6 for better speed/quality balance or Claude Haiku for fast simple tasks with lower cost.
Opus gives best quality for complex architecture, multi-file changes, legacy code refactoring. Sonnet — optimal choice for daily development. Haiku for simple edits, documentation, formatting.
System Requirements
Claude Code officially supports Windows 10 version 1903+ and Windows 11. Works in PowerShell 5.1+ (built into Windows), PowerShell Core 7+ or CMD command prompt. Git Bash also supported.
Mandatory requirements:
Git for Windows 2.34+ must be installed. Claude Code uses Git Bash internally for executing commands even when launching from PowerShell. Download from git-scm.com/download/win if not installed yet. Standard installation with all default options works perfectly.
Claude Pro subscription ($20/month), Claude Max ($100-200/month), Teams or Enterprise plan. Or API key from Anthropic Console with pay-per-token. No free access to Claude Code — tool requires powerful models consuming many tokens.
Stable internet connection. Claude Code sends code and project context to Anthropic servers for processing. Offline work impossible — each command requires API call.
Recommended components:
Windows Terminal — modern terminal from Microsoft with tabs, Unicode support, customizable themes. Installs through Microsoft Store for free. PowerShell looks and works much better in it than standard terminal.
Visual Studio Code or other code editor. Claude Code works in terminal separately from editor but most convenient when terminal open next to code. VS Code has built-in terminal — can work without switching windows.
Node.js 18+ LTS needed only for deprecated npm installation method. Native PowerShell installer and WinGet don't require Node.js at all. If still using npm install, get LTS version from nodejs.org/en/download.
System resources:
Claude Code itself lightweight — takes 50-100 MB on disk and consumes minimal RAM in standby mode. Main load goes to network when sending code to Anthropic servers. Large projects (500+ files) require more time for first scan — up to 10-20 seconds.
For comfortable work need any processor from last 5 years, 4+ GB free RAM (Claude Code itself takes 200-300 MB active memory), 500 MB free disk space, broadband internet from 5 Mbps for fast code transmission.
Method 1: PowerShell Installation (Recommended)
Native PowerShell installer — officially recommended method from Anthropic. Doesn't require Node.js, auto-updates in background, works faster than npm version.
Step 1: Open PowerShell
Press Win + X and select "Windows PowerShell" or "Terminal". Or press Win + R, type powershell and Enter. Administrator rights NOT needed — installation goes to user profile.
Step 2: Run installer
Copy and paste command into PowerShell:
irm https://claude.ai/install.ps1 | iex
Press Enter. Installer downloads Claude Code binary and installs to %LOCALAPPDATA%\Programs\ClaudeCode. Process takes 10-30 seconds depending on internet speed.
Step 3: Verify installation
claude --version
Should show version like 1.2.3. If see "command not found" error, close and reopen PowerShell — PATH updates after terminal restart.
Step 4: First run
Navigate to any code directory:
cd C:\Users\YourName\projects\my-app
claude
First launch opens browser for OAuth authorization. Login with Claude Pro/Max account. After authorization token saves locally to ~/.claude/ and re-authentication not required.
Auto-updates:
Native installation updates automatically in background. New versions download and apply without your participation. Can configure update channel: latest (default) receives features immediately as released, stable uses versions about week older skipping releases with critical bugs.
Switching model:
claude --model claude-sonnet-4-6
Switching model:
claude --model claude-sonnet-4-6
Configure channel:
claude /config
Select "Auto-update channel" and specify needed one.
Method 2: WinGet Installation
WinGet — official Windows package manager. Built into Windows 11 and Windows 10 22H2+. If winget command doesn't work, install App Installer from Microsoft Store.
Installing via WinGet:
winget install Anthropic.ClaudeCode
WinGet downloads and installs Claude Code automatically. After installation:
claude --version
Updating:
WinGet installations do NOT auto-update. Run manual update periodically:
winget upgrade Anthropic.ClaudeCode
Known issue: Claude Code may notify about update before new version appears in WinGet repository. If upgrade finds no update, wait several hours and try again.
Method 3: npm Installation (Deprecated)
npm method officially deprecated but still works. Use only if native installation for some reason doesn't fit.
Requirements:
Node.js 18+ LTS. Check version:
node --version
If no Node.js or version older than 18, download LTS from nodejs.org/en/download.
Installation:
npm install -g @anthropic-ai/claude-code
Do NOT use sudo on Windows — causes permission problems. If getting access errors, configure npm to use user directory:
mkdir $env:USERPROFILE\.npm-global
npm config set prefix "$env:USERPROFILE\.npm-global"
$env:PATH += ";$env:USERPROFILE\.npm-global"
After installation:
claude --version
Updating npm version:
npm update -g @anthropic-ai/claude-code
Migration from npm to native installation:
If currently using npm version and want to switch to native:
Install native version:
irm https://claude.ai/install.ps1 | iex
Remove npm version:
npm uninstall -g @anthropic-ai/claude-code
Settings from ~/.claude/ preserve — nothing to reconfigure.
Authentication and Setup
OAuth via Claude.ai (recommended):
First claude run in any directory opens browser on authorization page. Login with Claude Pro, Max, Teams or Enterprise account. After confirmation token saves locally and no more login needed.
Token stored in %USERPROFILE%\.claude\session.json. Protected by Windows file system access rights. Never commit this file to git and don't share it.
API key for CI/CD:
For servers, containers or CI pipelines where can't open browser, use environment variable with API key:
$env:ANTHROPIC_API_KEY = "sk-ant-api03-your-key"
claude
Get API key at console.anthropic.com → API Keys → Create Key. This is paid method — tokens charged at standard Anthropic API rates.
For permanent use add to Windows environment variables: Win + R → sysdm.cpl → "Advanced" tab → "Environment Variables" → create ANTHROPIC_API_KEY with your key value.
Model selection:
By default uses Claude Opus 4.6. Switching to another model:
Via command at launch:
claude --model claude-sonnet-4-6
Or in settings:
claude /config
Select "Default model" and specify needed one.
Available models:
claude-opus-4-6— maximum quality, slower, more expensiveclaude-sonnet-4-6— balance of speed and quality (recommended)claude-3-5-haiku-20241022— fast and cheap for simple tasks
First Steps and Basic Usage
Creating test project:
Create project folder:
mkdir C:\projects\claude-test
cd C:\projects\claude-test
Initialize git (recommended):
git init
Create simple file:
"console.log('Hello World');" > app.js
Run Claude Code:
claude
Main commands:
Claude Code works through slash-commands and natural language. Important commands:
/help — shows all available commands with description
/ask — ask question about code: /ask "explain what parseUser function does"
/generate — generate code: /generate "create Express server with /api/users route"
/test — write tests: /test "create unit tests for AuthService"
/refactor — refactor code: /refactor "convert callbacks to async/await"
/bug — report bug in Claude Code (sends report to Anthropic)
/compact — compress conversation history to free context
/exit — exit Claude Code
Working through natural language:
Just describe task without commands. Claude will understand:
> add email validation to registration form
> fix bug where user can submit empty form
> create API endpoint for getting posts list with pagination
> write README with project installation instructions
Claude shows which files will change, suggests diff with changes. You confirm or reject each change. Can ask to clarify or redo.
Development session example:
PS C:\projects\blog-api> claude
Claude Code v1.2.3
> create Express API with endpoints for posts: GET /posts, GET /posts/:id, POST /posts, DELETE /posts/:id
⏺ I'll create an Express API with CRUD endpoints for blog posts...
[Claude shows which files will create: server.js, routes/posts.js, controllers/postsController.js]
Accept all changes? (y/n/show): y
✓ Created server.js
✓ Created routes/posts.js
✓ Created controllers/postsController.js
> add validation for POST /posts — title required and minimum 5 characters
⏺ I'll add input validation for the POST endpoint...
[Shows changes in postsController.js]
Accept? (y/n): y
✓ Updated controllers/postsController.js
> create tests for these endpoints
⏺ I'll write tests using Jest and supertest...
[Creates tests/posts.test.js with 10+ test cases]
CLAUDE.md File — Project Instructions
CLAUDE.md — markdown file in project root giving Claude permanent context: build commands, code conventions, architectural patterns, project specifics.
Generating CLAUDE.md:
cd C:\projects\your-app
claude /init
Claude analyzes project and creates CLAUDE.md automatically with information аbout:
- Project structure and directory purposes
- Technologies and dependencies
- Commands for running dev/build/test
- Code style and naming conventions
- Architectural decisions
Example CLAUDE.md:
# Blog API Project
## Tech Stack
- Node.js 20 + Express 4.18
- PostgreSQL 16
- Jest for testing
- Sequelize ORM
## Commands
- `npm run dev` — start dev server on port 3000
- `npm test` — run tests
- `npm run migrate` — DB migrations
## Code Conventions
- Use async/await instead of promises
- File naming: camelCase for JS, kebab-case for directories
- All API responses in format {success: boolean, dаta: any, error?: string}
- Validation through express-validator middleware
## Architecture
- MVC pattern: controllers → services → models
- Routes in routes/, business logic in services/
- Configuration in config/ via dotenv
After creating CLAUDE.md each time you run claude, it reads this file and considers instructions when generating code.
Project Integration
Working with existing project:
# Navigate to project
cd C:\Users\YourName\workspace\existing-app
# Run Claude
claude
# Ask to analyze project
> analyze this project and tell me what it does
Claude scans all files, understands structure and technologies. For large projects (1000+ files) first scan takes 20-60 seconds.
Git workflows:
Claude Code understands git and helps with version control:
> look at my changes and create meaningful commit message
> create new branch feature/user-authentication
> help resolve merge conflict in auth.js file
Claude sees git status, can read diff, create commits with good messages following Conventional Commits.
GitHub integration:
Through MCP servers Claude can work with GitHub directly:
> create GitHub issue about this bug
> look at open pull requests and give me summary
> reply to comment in PR #42
Requires GitHub MCP server setup via claude mcp add.
Database work:
With DB MCP servers Claude can:
> show users table schema
> run SELECT * FROM posts WHERE status='published'
> create migration for adding avatar_url field to users table
PostgreSQL, MySQL, MongoDB supported through corresponding MCP servers.
MCP Servers — Extending Capabilities
MCP (Model Context Protocol) — protocol for connecting external tools to Claude Code. Turns assistant into full-featured agent working not only with files but external systems.
Popular MCP servers:
GitHub MCP — work with repositories, issues, pull requests. Creating PRs, code review, managing issues directly from Claude Code.
PostgreSQL/MySQL MCP — database queries, schema inspection, running migrations. Claude sees data and uses it when generating code.
Slack MCP — sending messages, reading channels. Can automate notifications or get context from team discussions.
File Search MCP — smart code search with RL-trained algorithms. Finds exact code sections instead of dumping entire files.
Installing MCP server:
HTTP servers:
claude mcp add --transport http server-name http://localhost:8080
Local servers:
claude mcp add github-mcp -- npx -y @modelcontextprotocol/server-github
View connected:
claude mcp list
After installation Claude gets access to MCP server functions and can use them in responses.
Troubleshooting
Problem: "claude: command not found"
After installation PowerShell doesn't see claude command.
Solution: Close and reopen PowerShell. PATH updates only at new terminal session start. If doesn't help, verify that C:\Users\YourName\AppData\Local\Programs\ClaudeCode added to PATH.
Problem: "Git is not installed"
Claude Code requires Git for Windows but can't find it.
Solution: Download and install Git for Windows from git-scm.com/download/win. Use standard installer settings. After installation restart PowerShell and try again.
Problem: npm installation gives access errors
When npm install -g get EACCES or permission denied errors.
Solution: Do NOT use sudo on Windows. Configure npm to local directory:
mkdir $env:USERPROFILE\.npm-global
npm config set prefix "$env:USERPROFILE\.npm-global"
Add to PATH:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:USERPROFILE\.npm-global", "User")
Restart PowerShell and install again.
Problem: Claude Code won't authenticate
OAuth window opens but authorization doesn't complete.
Solution: Ensure you have active Claude Pro/Max subscription. Check that %USERPROFILE%\.claude\session.json file not readonly. Try deleting this file and re-authenticating. If doesn't help, use API key via environment variable.
Problem: Very slow performance
Claude Code lags, commands execute for minutes.
Solution: Check internet speed — Claude sends lots of data to servers. Large projects (2000+ files) require time for analysis. Use .claudeignore file to exclude node_modules, build folders, logs. Try Haiku model for simple tasks — it's faster.
Problem: "context window exceeded" error
Claude says context limit exceeded.
Solution: Use /compact to compress conversation history. Split large task into several smaller sessions. Clear old messages via /clear. Don't dump huge files into context entirely — ask Claude to work with specific functions.
Problem: Update doesn't work
claude update or winget upgrade updates nothing.
Solution: For WinGet installations new version may appear in repository with delay. Wait 1-2 days and try again. For npm version run npm update -g @anthropic-ai/claude-code. Native PowerShell installation updates automatically in background — check version via claude --version.
Diagnostics:
claude doctor
This command automatically checks: Node.js version (for npm install), authentication status, MCP server health, file access permissions. Shows what's wrong and how to fix.
FAQ
Do I need administrator rights for installation?
No. Native PowerShell installation and npm method install to user profile without admin rights. WinGet may require rights for first run but Claude Code installation itself without them.
Does Claude Code work offline?
No. Each command sends code to Anthropic servers for processing. Offline mode impossible by architecture.
How much does usage cost?
With Claude Pro subscription ($20/month) or Max ($100-200/month) Claude Code included without additional charge. When using API key pay for tokens at standard API rates: Opus ~$15/$75 per million input/output tokens, Sonnet cheaper.
Is it safe to send code to Anthropic servers?
Anthropic states they don't use user data for training models. Code stored limited time for session work. For critical projects use self-hosted options through AWS Bedrock or Google Vertex AI where data stays in your infrastructure.
Can I use on company projects?
Yes if company has Teams or Enterprise subscription. For enterprise managed settings available for centralized team configuration management.
Which programming languages supported?
All popular languages: jаvascript, TypeScript, Python, Java, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, C++. Claude understands frameworks: React, Vue, Angular, Django, Flask, Spring Boot, .NET, Laravel, Rails.
Does it work with WSL?
Yes. Can install Claude Code in WSL Ubuntu and run from there. Gives native Linux experience on Windows. Installation inside WSL via bash script: curl -fsSL https://claude.ai/install.sh | bash
How to uninstall Claude Code?
PowerShell installation: delete directory %LOCALAPPDATA%\Programs\ClaudeCode and %USERPROFILE%\.claude. WinGet: winget uninstall Anthropic.ClaudeCode. npm: npm uninstall -g @anthropic-ai/claude-code.
Using with THE.Hosting Servers
While Claude Code works locally on your Windows computer, developers often deploy projects to remote servers for production, staging or CI/CD.
THE.Hosting use cases:
Development and staging servers — VPS for testing application in production-like environment before release. Claude Code helps write code locally, then deploy to THE.Hosting VPS for verification.
CI/CD pipelines — automatic build and tests on git push. Deploy GitHub Actions or GitLab CI on THE.Hosting runner servers. Claude Code generates code, CI runs tests and deploys to production.
Development databases — PostgreSQL or MySQL on THE.Hosting VPS. Claude Code through MCP servers can connect to remote DB for queries and migrations.
API servers — backend on Node.js, Python, Go deployed on THE.Hosting. Frontend develop locally with Claude Code, API runs on VPS.
Recommended VPS configurations:
For staging Node.js/Python projects fits Beryllium VPS: 2 vCPU / 2 GB RAM / 20 GB NVMe for €3.77/month. Enough for small APIs and test environments.
For production applications take Ruthenium VPS: 4 vCPU / 8 GB RAM / 80 GB NVMe for ~€20/month. Handles production load up to 100-200 concurrent users.
For microservices or CI runners several Beryllium VPS cheaper and more flexible than one powerful server. Different services on different VPS — isolation and scalability.
THE.Hosting location choice:
THE.Hosting has 50+ locations globally. For European users optimal Netherlands (Meppel) or Germany (Frankfurt) with minimum 10-30ms latency. US developers choose USA (New Jersey) for East Coast proximity. Asian traffic better served from Japan (Tokyo) or Hong Kong.
All VPS with full root access, NVMe disks and 24/7 support. Can install Docker, configure Nginx, deploy DB — everything needed for production environment.
Conclusion
Claude Code — powerful AI tool for Windows developers accelerating code writing through delegating routine tasks to AI agent. Installation takes 5 minutes via PowerShell command. Works with any languages and frameworks. Understands project context and generates code considering architecture.
Having studied this guide you got: three Windows installation methods (PowerShell, WinGet, npm), authentication setup via OAuth or API key, understanding of main commands and natural requests, knowledge about CLAUDE.md for project customization, integration with git and external systems through MCP, solutions for typical installation and operation problems.
Claude Code doesn't replace developer but significantly speeds up work on routine tasks. Boilerplate code generation, writing tests, refactoring, documentation — everything taking time but not requiring creative solutions. Leaves more time for architectural decisions and complex business logic.
For deploying projects use THE.Hosting VPS in 50+ locations — from Netherlands (Meppel) to Japan (Tokyo), from Germany (Frankfurt) to USA (New Jersey). All servers with NVMe disks, root access and 24/7 support.
Useful Links
Claude Code:
THE.Hosting:
- VPS in 50+ Countries — from €1/mo
- VPS in Netherlands — Europe's internet hub
- Knowledge Base — guides and tutorials
- Telegram Support — 24/7 in Russian and English