Setup Claude Code Inside Cursor with WSL on Windows

Claude Code Cursor

Written by Jens Becker

Last updated on June 21, 2025

Screenshot of a presentation slide titled 'Setup Claude Code Inside Cursor with WSL on Windows' with logos of Claude, Cursor, and Windows.

This guide walks you through setting up Claude Code step by step inside Cursor using WSL on Windows.

Claude Code is a CLI tool for agentic coding. It enables advanced code transformations, command execution, and file editing through a conversational interface, ideal for deep AI-driven development. Cursor , on the other hand, is a modern IDE with powerful AI support, offering inline AI editing, tab completions, and context-aware editing.

So why use Claude Code inside Cursor? Combining both tools gives you the best of both worlds:

  • Cursor for inline AI tab completions and edits
  • Claude Code for structured agentic workflows, and advanced automation

However, Claude Code does not natively support Windows, and running the CLI directly in PowerShell or CMD will result in this error:

Error: No suitable shell found. Claude CLI requires a POSIX shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.

To fix this, we'll install Claude Code in WSL (Windows Subsystem for Linux) and connect it to Cursor via its IDE integration.

Step 1: Set Up WSL

Claude requires a POSIX shell, so you must install WSL on your Windows machine. For this:

  1. Open PowerShell as Administrator.
  2. run wsl --install (Or, if already installed: wsl --update)
  3. Choose your WSL username and password when prompted.
  4. After setup completes, restart your computer.

Step 2: Install Node & NPM in WSL

To later install Claude Code on WSL, you first have to install Node.JS and npm. I would recommend you to install it via the nvm (Node Version Manager).

  1. In your WSL terminal, run: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
  2. Restart your terminal. Note to start your WSL Ubuntu terminal, not a regular PowerShell terminal)
  3. Install your preferred node version, e.g., 22, via nvm install 22
  4. Verify the installation by running node -v

Step 3: Install Claude Code CLI

Next, install Claude Code via npm by running npm install -g @anthropic-ai/claude-code in your WSL terminal.

Claude Code is now successfully installed in your WSL environment. To begin, open Cursor and launch a WSL terminal via the terminal dropdown. From there, run claude to start the CLI. You should see a welcome message along with setup prompts (like theme selection and login). Follow these steps to get started.

⚠️ However, at this stage, Claude Code is not yet connected to the Cursor editor. Running /ide will show that no IDE is detected.

Additionally, if your project is located on a Windows-mounted path (like /mnt/c/...), you may experience significant performance issues with tools like pnpm install or pnpm lint due to the overhead of WSL's file system bridge.

Follow the next steps to fully integrate Claude Code with Cursor and move your project into the WSL-native file system for optimal performance and IDE features.

Step 4: Connect Claude Code to Cursor

To use Claude Codes IDE features (selection context, file references, diffs, etc.), we must connect Cursor to WSL.

Install required Cursor Extension

  1. Open the Extensions tab in Cursor
    1. install the 'Claude Code' extension
    2. install the 'WSL' extension (Not the VS Code WSL extension, uninstall it if necessary)
  2. Restart Cursor after installation

When you now start Claude and run the /ide command, you'll notice that Claude detects Cursor, but reports that the directories don’t match. This happens because Cursor is running in the Windows file system, while Claude is operating in the WSL virtual file system, causing a path mismatch.

Run Cursor inside WSL

To resolve the path mismatch, you have to run cursor inside WSL:

  1. run Ctrl + Shift + P
  2. enter WSL: Connect to WSL
  3. look for a notification banner with the text: Setting up WSL distro: Ubuntu.
    1. If the message shows a distro besides Ubuntu, open a regular terminal and set Ubuntu as your default WSL distribution by running: wsl --set-default Ubuntu

You should now see an Ubuntu bash terminal open in Cursor on the right. If it doesn't appear automatically, open a new terminal and select Ubuntu (WSL).

Now, if you run claude, you should see the following message:

🎉 Claude Code extension installed in Cursor!

Congratulations! Claude Code is now successfully connected to Cursor, and you're ready to use its full IDE integration features.

Clone Your Git Repo Into WSL

The final step is to clone your Git repository into the WSL file system, so you can open it in Cursor while running in WSL mode. For example, you can create a projects directory and clone your repo like this:

Then simply open the folder via the Open Folder Button in Cursor.

Conclusion

By combining Claude Code and Cursor inside WSL, you unlock a powerful, AI-assisted development environment that supports both agentic workflows and seamless inline code editing. While Claude Code isn’t natively supported on Windows, WSL makes it possible to run it efficiently, and with a few setup steps, you can fully integrate it with Cursor for the best experience.

Do you have a question or feedback on how to integrating Claude Code into Cursor on Windows? We’d love to hear from you! For feedback, suggestions, or anything else, feel free to reach out via email at info@jhb.software . Thanks for reading!