PowerShell tool drops pipeline output when result uses default formatter (no Format-Table/Format-List)

Resolved 💬 1 comment Opened May 16, 2026 by pedropaulovc Closed May 20, 2026

Summary

The PowerShell tool returns (PowerShell completed with no output) for commands whose output relies on PowerShell's implicit/default formatter, even when the command genuinely produces objects. Appending | Format-Table (or | Format-List / | Out-String) to the exact same command makes the output appear correctly.

Reproduction

On Windows 11, PowerShell 7+ (pwsh), via Claude Code's PowerShell tool:

  1. Run:

``powershell
Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime
`
→ Tool reports:
(PowerShell completed with no output)`

  1. Run the identical command with | Format-Table appended:

``powershell
Get-Process -Name explorer -ErrorAction SilentlyContinue | Select-Object Id, ProcessName, StartTime | Format-Table
`
→ Tool returns the expected row, e.g.:
`
Id ProcessName StartTime
-- ----------- ---------
10592 explorer 5/14/2026 2:06:24 PM
``

The underlying process exists in both cases; only the rendering differs.

Expected behavior

The tool should capture and return whatever PowerShell's default host would render — i.e. objects emitted to the success stream should be formatted to text (equivalent to | Out-String -Stream) before being returned, just as an interactive pwsh session does.

Actual behavior

Without an explicit Format-* cmdlet, the output stream appears empty to the tool, leading to misleading "no output" results and forcing users (and the model) to add formatter cmdlets defensively.

Impact

  • Misleading diagnostics — "no output" looks like "no matching process" or "command failed silently."
  • Wastes turns — the model often re-runs the command or invents explanations for the empty result.
  • Breaks parity with interactive pwsh, where the same one-liner works as written.

Related /feedback submission

This bug was also submitted via Claude Code's /feedback command.

  • Feedback ID: 84e84c3c-a605-4069-b029-0af8c88ae656
  • Submitted: 2026-05-16T02:58:01.524Z
  • Session ID: b69dfbc4-f591-4cb1-8807-cd5d226bfe1a
  • Claude Code version: 2.1.143
_Minor sub-issue noticed while preparing this report: the Feedback ID that /feedback prints to the terminal UI is not written into the session JSONL log — only the Feedback / bug report submitted line is persisted. The ID is therefore lost if the user closes the terminal or scrolls past it. Worth either logging it alongside the existing local-command-stdout event, or echoing it back when the user later runs /feedback (or a hypothetical /feedback list)._

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Shell: PowerShell 7+ (pwsh), invoked via Claude Code PowerShell tool
  • Claude Code model: Opus 4.7 (1M context)
  • Claude Code version: 2.1.143
  • Date observed: 2026-05-15

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗