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 Academic Research and Literature Discovery: Leveraging X/Twitter for Scholarly Intelligence Best Practices Grok Best Practices for Content Strategy: Identify Trending Topics Before They Peak and Create Content That Captures Demand Best Practices Grok Case Study: How a DTC Beauty Brand Used Real-Time Social Listening to Save Their Product Launch Case Study Grok Case Study: How a Pharma Company Tracked Patient Sentiment During a Drug Launch and Caught a Safety Signal 48 Hours Before the FDA Case Study Grok Case Study: How a Disaster Relief Nonprofit Used Real-Time X/Twitter Monitoring to Coordinate Emergency Response 3x Faster Case Study Grok Case Study: How a Political Campaign Used X/Twitter Sentiment Analysis to Reshape Messaging and Win a Swing District Case Study How to Use Grok for Competitive Intelligence: Track Product Launches, Pricing Changes, and Market Positioning in Real Time How-To Grok vs Perplexity vs ChatGPT Search for Real-Time Information: Which AI Search Tool Is Most Accurate in 2026? Comparison How to Use Grok for Crisis Communication Monitoring: Detect, Assess, and Respond to PR Emergencies in Real Time How-To How to Use Grok for Product Improvement: Extract Customer Feedback Signals from X/Twitter That Your Support Team Misses How-To How to Use Grok for Conference Live Monitoring: Extract Event Insights and Identify Networking Opportunities in Real Time How-To How to Use Grok for Influencer Marketing: Discover, Vet, and Track Influencer Partnerships Using Real X/Twitter Data How-To How to Use Grok for Job Market Analysis: Track Industry Hiring Trends, Layoff Signals, and Salary Discussions on X/Twitter How-To How to Use Grok for Investor Relations: Track Earnings Sentiment, Analyst Reactions, and Shareholder Concerns in Real Time How-To How to Use Grok for Recruitment and Talent Intelligence: Identifying Hiring Signals from X/Twitter Data How-To How to Use Grok for Startup Fundraising Intelligence: Track Investor Sentiment, VC Activity, and Funding Trends on X/Twitter How-To How to Use Grok for Regulatory Compliance Monitoring: Real-Time Policy Tracking Across Industries How-To NotebookLM Best Practices for Financial Analysts: Due Diligence, Investment Research & Risk Factor Analysis Across SEC Filings Best Practices NotebookLM Best Practices for Teachers: Build Curriculum-Aligned Lesson Plans, Study Guides, and Assessment Materials from Your Own Resources Best Practices NotebookLM Case Study: How an Insurance Company Built a Claims Processing Training System That Cut Errors by 35% Case Study