-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Description
Preflight Checklist
- I have searched existing issues and this hasn't been reported yet
- This is a single bug report (please file separate reports for different bugs)
- I am using the latest version of Claude Code
What's Wrong?
When running Claude Code on a Windows machine, the agent attempts to execute Linux/Bash specific shell features (specifically extglob) inside PowerShell. When PowerShell returns a standard "term is not recognized" error, the agent fails to understand the OS context, does not self-correct to use PowerShell-native commands, and gets stuck repeatedly trying to execute the same incompatible command.
What Should Happen?
Claude Code should recognize the Windows/PowerShell environment and translate Bash-centric file operations into their PowerShell equivalents (e.g., using Get-ChildItem, Where-Object, or standard regex). Upon receiving a PowerShell error, it should immediately recognize the shell mismatch and self-correct.
Error Messages/Logs
`extglob.CommandLine: The term 'extglob.CommandLine' is not recognized as a name of a cmdlet, function, script file, or executable program.`Steps to Reproduce
- Run Claude Code in a Windows PowerShell environment.
- [What prompt did you use? e.g., "Find all files matching this pattern..." or "Delete all files except..."]
- Claude Code attempts to run a bash command using
extglob. - PowerShell throws the cmdlet recognition error.
- Claude reads the error but fails to pivot to Windows commands, often repeating the mistake.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
2.1.56
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
No response