anthropics / anthropics/claude-code

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

未关闭
#94,228 2 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area:bash area:desktop bug platform:windows
主要语言
Python
星标
145k
派生
23.1k
PR 合并指标
PR 指标待抓取

描述

### 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).

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
powershell
领域
cli
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。