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

Antigravity AI Content Pipeline Automation Guide: Google Docs to WordPress Publishing Workflow Guide Bolt.new Case Study: Marketing Agency Built 5 Client Dashboards in One Day Case Study Bolt.new Best Practices: Rapid Full-Stack App Generation from Natural Language Prompts Best Practices ChatGPT Advanced Data Analysis (Code Interpreter) Complete Guide: Upload, Analyze, Visualize Guide ChatGPT Custom GPTs Advanced Guide: Actions, API Integration, and Knowledge Base Configuration Guide ChatGPT Voice Mode Guide: Build Voice-First Customer Service and Internal Workflows Guide Claude API Production Chatbot Guide: System Prompt Architecture for Reliable AI Assistants Guide Claude Artifacts Best Practices: Create Interactive Dashboards, Documents, and Code Previews Best Practices Claude Code Hooks Guide: Automate Custom Workflows with Pre and Post Execution Hooks Guide Claude MCP Server Setup Guide: Build Custom Tool Integrations for Claude Code and Claude Desktop Guide Cursor Composer Complete Guide: Multi-File Editing, Inline Diffs, and Agent Mode Guide Cursor Case Study: Solo Founder Built a Next.js SaaS MVP in 2 Weeks with AI-Assisted Development Case Study Cursor Rules Advanced Guide: Project-Specific AI Configuration and Team Coding Standards Guide Devin AI Team Workflow Integration Best Practices: Slack, GitHub, and Code Review Automation Best Practices Devin Case Study: Automated Dependency Upgrade Across 500-Package Python Monorepo Case Study ElevenLabs Case Study: EdTech Startup Localized 200 Course Hours to 8 Languages in 6 Weeks Case Study ElevenLabs Multilingual Dubbing Guide: Automated Video Localization Workflow for Global Content Guide ElevenLabs Voice Design Complete Guide: Create Consistent Character Voices for Games, Podcasts, and Apps Guide Gemini 2.5 Pro vs Claude Sonnet 4 vs GPT-4o: AI Code Generation Comparison 2026 Comparison Gemini API Multimodal Developer Guide: Image, Video, and Document Analysis with Code Examples Guide