> ## Content Index
> Fetch the complete content index at: https://www.winsolvetech.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Claude Code Not Working in Windows Terminal
- URL: https://www.winsolvetech.com/claude-code-not-working-windows-terminal/
- Published: 2026-10-11T07:55:02.000Z
- Updated: 2026-10-11T07:55:02.000Z
- Author: MD Syful Islam Rasel
- Tags: Troubleshooting, Error Fixes

If Claude Code won’t [launch in Windows Terminal](https://www.winsolvetech.com/windows-11-automatic-updates/), the most common cause is that you’re running it from native Windows instead of WSL or another supported shell. The other usual causes are a missing \`PATH\` entry, the wrong Windows Terminal profile, or a shell startup file that exits too early. The first fix is to check the shell you opened, then confirm where Claude Code is installed, and only then change Terminal settings.

## What’s actually failing in Windows Terminal?

The failure usually shows up in one of a few ways: the command is not recognized, the window opens and closes right away, or Claude Code starts but never gets to the login or project prompt you expected.

If you see an error like this, it usually means the shell cannot find the command:

```text
'claude' is not recognized as an internal or external command, operable program or batch file.
```

Error

If nothing visible happens, or the window flashes and disappears, the shell profile may be closing immediately, or Claude Code may be launching in the wrong environment. If it opens but does not begin authentication, the CLI is often running in a shell that does not have the right browser handoff, TTY behavior, or file paths.

The practical takeaway is simple: this is usually not a Claude Code bug by itself. It is more often a shell mismatch, a profile problem, or a path issue.

## Before you start

This applies to Claude Code on Windows machines, especially when you’re using Windows Terminal with PowerShell, Command Prompt, or WSL. The safest checks do not require Administrator access or sudo.

You do not need to restart yet, and you should not reinstall anything before you check the shell and install location. Start with these safe checks:

- Open the same Windows Terminal profile you normally use for Claude Code.
- Confirm whether you’re in PowerShell, Command Prompt, or WSL before changing settings.
- Check whether `claude` is available in that same shell.

## When Claude Code works on Windows and when it doesn’t

Claude Code is most likely to behave the way the setup instructions describe when you run it in a supported shell, especially WSL, where the Linux environment matches the tool’s expectations better than plain Windows shells do.

If you are opening Windows Terminal into a PowerShell or Command Prompt profile and trying to run a CLI that was installed inside WSL, Windows will not see that install the same way WSL does. The reverse is also true: a Windows install won’t automatically be available inside your WSL distro.

Before changing anything, check these points:

- Which profile Windows Terminal opens by default.
- Whether the command works inside the same shell where you installed it.
- Whether your project folder is on the Linux side of WSL or on a Windows path.

If you installed Claude Code in WSL, open the WSL profile in Windows Terminal and test it there first. If you installed it in native Windows, test it in the same native shell, not inside Ubuntu or another WSL distro.

![A laptop shows a terminal running in a WSL shell.](https://tse1.mm.bing.net/th?q=laptop%20terminal%20running%20WSL%20shell&w=624&h=352&c=7)

## Fix the shell and install path first

Start by confirming you are in the shell that actually contains Claude Code. This is the safest fix because it does not change system settings or delete anything.

1. Check which shell Windows Terminal opened.

```powershell
$PSVersionTable.PSEdition
```

PowerShell

```bash
uname -a
```

Linux shell

If you get a Linux-style result from `uname`, you are in WSL or another Linux shell. If you are in PowerShell, you should see a PowerShell response instead.

1. Check whether Claude Code is on the command path in that same shell.

```powershell
Get-Command claude
```

PowerShell

```bash
which claude
```

Linux shell

If the command returns a path, the shell can see the install. If it returns nothing or says the command is not found, Claude Code is either not installed there or the shell has not loaded the correct `PATH`.

1. If the command is not found, open the shell where Claude Code was actually installed and try again there. If the install is in WSL, use the WSL profile. If the install is native Windows, use the matching Windows shell.
2. If you recently installed or changed anything, close all Windows Terminal tabs and open a fresh session. Some shells only pick up `PATH` changes in a new process.

If `Get-Command` or `which` finds Claude Code but launching it still fails, the install may be fine and the problem is more likely in Windows Terminal settings or shell startup files.

## Check Windows Terminal settings that can break it

If the shell and install both look right, the next place to check is Windows Terminal itself. A bad default profile, a custom startup command, or the wrong command line can send you into the wrong environment every time.

Use the settings UI or the settings file and look for these common problems:

- The default profile is PowerShell or Command Prompt, but Claude Code was installed in WSL.
- The profile has a custom command line that bypasses the normal shell startup.
- A startup script exits the shell immediately.

Settings path:

```text
Windows Terminal > Settings > Startup > Default profile
Windows Terminal > Settings > Profiles > [your profile] > Command line
Windows Terminal > Settings > Profiles > [your profile] > Starting directory
```

Settings path

A concrete example: if Windows Terminal always opens PowerShell, but you installed Claude Code inside Ubuntu on WSL, the command will never be visible in that default profile. Change the default profile to the WSL distro, or open the WSL profile explicitly when you want to use Claude Code.

Also check your shell startup files. A profile script that calls `exit`, throws an error, or changes directories to a missing path can make the window close before you see the problem. In PowerShell, that is often your profile script; in WSL, it may be `.bashrc`, `.zshrc`, or a similar startup file.

If the profile settings look odd, fix one thing at a time. Change the default profile or command line, then test again before editing startup files.

## Verify it’s working with a simple test

Once you think it is fixed, use a small test that proves the shell, path, and startup flow all work together.

1. Open Windows Terminal in the profile where Claude Code is installed.
2. Confirm the command is visible.

```powershell
Get-Command claude
```

PowerShell

```bash
which claude
```

Linux shell

Expected result: the shell prints a path to the Claude Code executable or script. If it does, the command lookup is working.

1. Run Claude Code from the current project folder.

```bash
claude
```

Linux shell

If the tool is installed and the environment is correct, it should stay open long enough to show its prompt or authentication flow instead of closing immediately.

1. Check that it is using the folder you expected. If your project is not the current directory, change into it first and run the command again.

```bash
pwd
```

Linux shell

If the prompt appears but authentication never starts, the shell may still be wrong, the browser handoff may be blocked, or the startup file may be interfering. If the command is found but exits immediately, focus on the profile and startup script rather than reinstalling right away.

## How to keep it from breaking again

The easiest way to avoid repeat failures is to keep Windows and WSL paths separate and always open the same profile for Claude Code. If you installed it in WSL, use the WSL profile every time. If you installed it in native Windows, stay in that shell and do not mix in WSL commands or paths.

A few habits help a lot:

- Keep one Windows Terminal profile dedicated to Claude Code.
- Leave shell startup files simple, with no early exits or aggressive path changes.
- Use Linux paths inside WSL and Windows paths inside native Windows shells.
- After installing or changing `PATH`, open a new terminal session before testing.

If you edit your profile again later and Claude Code stops working, check the last startup change first. That is often faster than reinstalling anything.

## Conclusion

If Claude Code still will not run, test it in the shell where it was installed instead of switching between Windows Terminal profiles. Once you know whether the failure is shell, path, profile, or startup-file related, the fix usually becomes straightforward.

## Frequently Asked Questions

### Should I run Claude Code from PowerShell or WSL on Windows?

Use the shell that matches the install. If you installed it in WSL, run it in the WSL profile. If you installed it natively on Windows, run it in the matching Windows shell.

### Why does the window open and immediately close?

That usually means the profile or startup script is exiting, or the shell cannot find the command and the window closes before you can read the error. Check the shell, the \`PATH\`, and the startup file in that order.

### How do I know if Windows Terminal is opening the wrong profile?

Check the default profile in Windows Terminal settings. If it opens PowerShell or Command Prompt but your Claude Code install is in WSL, that mismatch is the problem.