Claude Code Installation & Setup Guide for Windows: Node.js, Auth, Shell & CLAUDE.md Configuration

Claude Code Installation & Setup Guide for Windows Developers

Claude Code is Anthropic’s agentic AI coding tool that operates directly in your terminal. It understands your entire codebase, executes commands, edits files, and manages complex software engineering workflows. This guide walks you through a complete Windows installation, from Node.js prerequisites to advanced project configuration with CLAUDE.md.

Prerequisites

Before installing Claude Code, ensure your Windows environment meets these requirements:

  • Node.js 18+ (LTS recommended)- npm 9+ (ships with Node.js)- Git for Windows with Git Bash- Windows 10/11 (64-bit)- An Anthropic API key or a Claude Pro/Max subscription

Step 1: Install and Configure Node.js

Download the latest LTS version of Node.js from the official website and run the installer. After installation, verify your setup: node —version npm —version

You should see version numbers for both. If Node.js is not recognized, add it to your system PATH manually: # Add to your shell profile (~/.bashrc for Git Bash) export PATH=“/c/Program Files/nodejs:$PATH”

Ensure npm is up to date: npm install -g npm@latest

Step 2: Install Claude Code

Install Claude Code globally via npm: npm install -g @anthropic-ai/claude-code

Verify the installation: claude --version

If you encounter permission errors on Windows, run your terminal as Administrator or configure npm to use a different global directory: npm config set prefix "$HOME/.npm-global" export PATH="$HOME/.npm-global/bin:$PATH" ## Step 3: Authenticate Claude Code

Claude Code supports two authentication methods. Choose the one that matches your setup:

Option A: Anthropic API Key

Set your API key as an environment variable: # In ~/.bashrc or ~/.bash_profile export ANTHROPIC_API_KEY=“YOUR_API_KEY”

Then reload your shell: source ~/.bashrc

Option B: Claude Pro/Max Subscription

Launch Claude Code and follow the interactive OAuth flow: claude

This opens a browser window where you sign in with your Anthropic account. The authentication token is stored locally at ~/.claude/ and refreshes automatically.

Step 4: Shell Integration

Claude Code works best with Git Bash on Windows. Configure your shell for an optimal experience: # Add to ~/.bashrc

Claude Code shell integration

eval ”$(claude shell-setup)“

This enables features like:

  • Tab completion for Claude Code commands- Inline suggestions via Ctrl+K in supported terminals- Command history integration with your shellFor PowerShell users, add the following to your $PROFILE: # PowerShell profile claude shell-setup —shell powershell | Invoke-Expression

Step 5: Create Your CLAUDE.md Project Instructions

CLAUDE.md is a special configuration file that gives Claude Code persistent context about your project. Place it in your project root: # Create CLAUDE.md in your project root touch CLAUDE.md

Here is a practical CLAUDE.md template: # Project Instructions for Claude Code

Tech Stack

  • Frontend: React 18 + TypeScript
  • Backend: Node.js + Express
  • Database: PostgreSQL
  • Package Manager: npm

Code Conventions

  • Use TypeScript strict mode
  • Prefer functional components with hooks
  • Use named exports, not default exports
  • Run npm run lint before committing

Project Structure

  • /src/components — React components
  • /src/api — Express route handlers
  • /src/utils — Shared utilities
  • /tests — Test files mirroring src structure

Testing

  • Framework: Vitest
  • Run tests: npm test
  • Always write tests for new features

Common Commands

  • npm run dev — Start development server
  • npm run build — Production build
  • npm run db:migrate — Run database migrations

CLAUDE.md Hierarchy

Claude Code reads CLAUDE.md files at multiple levels, with more specific files taking precedence:

LocationScopeUse Case
~/.claude/CLAUDE.mdGlobal (all projects)Personal preferences, auth info, global tools
./CLAUDE.mdProject rootStack, conventions, team standards
./src/CLAUDE.mdSubdirectoryModule-specific instructions
## Step 6: Start Using Claude Code Navigate to your project directory and launch Claude Code: cd /c/Users/yourname/projects/my-app claude

Try these common workflows: # Ask Claude to understand your codebase > Explain the authentication flow in this project

Fix a bug

Fix the race condition in src/api/users.ts

Add a feature

Add pagination to the /api/products endpoint with limit and offset params

Run in non-interactive mode

claude -p “Write unit tests for src/utils/validation.ts”

Pro Tips for Power Users

  • Use /compact during long sessions to compress conversation context and avoid hitting token limits.- Use claude -p for non-interactive, scriptable commands in CI/CD pipelines or automation scripts.- Permission modes: Use claude —allowedTools to pre-approve specific tools (e.g., Edit, Bash) for hands-free operation.- Multi-file edits: Claude Code can edit multiple files in a single turn. Describe the full scope of your change and let it work across files.- Git-aware workflows: Claude reads your git history and status. Ask it to write commit messages, review diffs, or create pull request descriptions.- Custom slash commands: Create reusable prompts in .claude/commands/ as markdown files to standardize team workflows.

Troubleshooting Common Errors

ErrorCauseSolution
claude: command not foundnpm global bin not in PATHRun npm bin -g and add the output path to your PATH variable
ANTHROPIC_API_KEY not setMissing environment variableAdd export ANTHROPIC_API_KEY="YOUR_API_KEY" to ~/.bashrc and run source ~/.bashrc
EACCES permission deniednpm global install permission issueReconfigure npm prefix: npm config set prefix "$HOME/.npm-global"
Node.js version too oldNode.js below v18Install Node.js LTS from the official website or use nvm to manage versions
Shell integration not workingProfile not sourcedRestart your terminal or run source ~/.bashrc after adding shell setup
OAuth login fails in browserFirewall or proxy blocking localhost callbackTemporarily disable VPN/proxy, or use API key authentication instead
## Frequently Asked Questions

Can I use Claude Code with PowerShell instead of Git Bash on Windows?

Yes. Claude Code supports PowerShell on Windows. However, Git Bash is recommended because Claude Code uses Unix shell syntax by default. If you prefer PowerShell, add shell integration via claude shell-setup --shell powershell | Invoke-Expression in your PowerShell profile. Be aware that some commands may require syntax adjustments, such as escaping JSON strings with backslashes in PowerShell.

Does CLAUDE.md get committed to version control, and is it safe to do so?

Yes, placing CLAUDE.md in your project root and committing it to version control is the recommended practice. It allows your entire team to share consistent Claude Code instructions. Avoid putting sensitive information like API keys or secrets in CLAUDE.md. For personal preferences or credentials, use the global file at ~/.claude/CLAUDE.md, which is not part of any repository.

How do I update Claude Code to the latest version?

Run the same npm global install command to update: npm install -g @anthropic-ai/claude-code. This overwrites the existing installation with the latest release. You can check your current version with claude —version and compare it against the latest release on npm. Claude Code also notifies you in-terminal when a new version is available.

Explore More Tools

Grok Best Practices for Real-Time News Analysis and Fact-Checking with X Post Sourcing Best Practices Devin Best Practices: Delegating Multi-File Refactoring with Spec Docs, Branch Isolation & Code Review Checkpoints Best Practices Bolt Case Study: How a Solo Developer Shipped a Full-Stack SaaS MVP in One Weekend Case Study Midjourney Case Study: How an Indie Game Studio Created 200 Consistent Character Assets with Style References and Prompt Chaining Case Study How to Install and Configure Antigravity AI for Automated Physics Simulation Workflows Guide How to Set Up Runway Gen-3 Alpha for AI Video Generation: Complete Configuration Guide Guide Replit Agent vs Cursor AI vs GitHub Copilot Workspace: Full-Stack Prototyping Compared (2026) Comparison How to Build a Multi-Page SaaS Landing Site in v0 with Reusable Components and Next.js Export How-To Kling AI vs Runway Gen-3 vs Pika Labs: Complete AI Video Generation Comparison (2026) Comparison Claude 3.5 Sonnet vs GPT-4o vs Gemini 1.5 Pro: Long-Document Summarization Compared (2025) Comparison Midjourney v6 vs DALL-E 3 vs Stable Diffusion XL: Product Photography Comparison 2025 Comparison Runway Gen-3 Alpha vs Pika 1.0 vs Kling AI: Short-Form Video Ad Creation Compared (2026) Comparison BMI Calculator - Free Online Body Mass Index Tool Calculator Retirement Savings Calculator - Free Online Planner Calculator 13-Week Cash Flow Forecasting Best Practices for Small Businesses: Weekly Updates, Collections Tracking, and Scenario Planning Best Practices Amazon PPC Case Study: How a Private Label Supplement Brand Lowered ACOS With Negative Keyword Mining and Exact-Match Campaigns Case Study Antigravity vs Jasper vs Copy.ai: AI Brand Voice Consistency Compared (2026) Comparison 30-60-90 Day Onboarding Plan Template for New Marketing Managers Template Apartment Move-Out Checklist for Renters: Cleaning, Damage Photos, and Security Deposit Return Checklist ATS-Friendly Resume Formatting Best Practices for Career Changers Best Practices