anthropics / anthropics/claude-code

[BUG] «PowerShell tool в Code tab всегда возвращает Exit code 1 без вывода на любую команду (даже Write-Output test), при этом PowerShell в системе работает нормально

Aperta
#94,228 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
area:bash area:desktop bug platform:windows
Lingua principale
Python
Stelle
145k
Fork
23.1k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

Every PowerShell tool call in this session returns "Exit code 1" with zero
output, even for trivial no-op commands (e.g. `Write-Output test`,
`Get-Date`, `1+1`). A command writing to a file (`Out-File`) also produces
no file at all, confirming the shell process itself never runs — this is
not a script error. PowerShell works normally when run manually outside
Claude Code on the same machine. The issue persisted after fully closing
and restarting the Claude Code app, and also reproduces identically inside
a spawned subagent in the same session.

### What Should Happen?

The PowerShell tool should execute the given command and return its actual
stdout/stderr and exit code — e.g. running `Write-Output test` should return
exit code 0 with output "test".

### Error Messages/Logs

```shell

```

### Steps to Reproduce

1. Open Claude Code desktop app (Code tab), any project folder on Windows.
2. Ask Claude to run any PowerShell command via its terminal tool.
3. Observe: tool call returns only "Exit code 1", no stdout/stderr, no
side effects (files never get created).

### Claude Model

None

### Is this a regression?

Yes, this worked in a previous version

### Last Working Version

_No response_

### Claude Code Version

1.52386.6

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

PowerShell

### Additional Information

Windows 11 Home Single Language, PowerShell 5.1 (Windows PowerShell),
Claude Code desktop app (Code tab).

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start at the PowerShell tool entry point used by the desktop app and reproduce the failure on Windows with `Write-Output test`, `Get-Date`, and `1+1`. Compare the tool's process, stdout/stderr, and exit-code handling with a manually run PowerShell session; done means these commands execute, return output, and report exit code 0, including inside a spawned subagent.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
powershell
Ambito
cli
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.