`claude` exits 1 when run with no args and no stdin, which blocks winget releases

Status Open
Reported on v2.1.268
Maintainer reply None cached
Activity 1 comment · opened Sep 25, 2026

Preflight Checklist

  • [x] I have searched existing issues 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?

Running claude with no arguments when stdin isn't a terminal drops into --print mode and exits 1, instead of showing usage.

That breaks WinGet's package validation, which installs the exe and runs it bare to check it works. Because it exits 1, every Claude Code release gets flagged with Validation-Executable-Error and has to be hand-approved by a volunteer moderator.

Right now winget is stuck on 2.1.268 (merged Sep 11) while you're shipping 2.1.282 — 16+ PRs queued up, a two-week backlog. Windows users who installed via winget are stranded, since Claude Code turns off self-update when it detects a package-manager install.

It isn't a one-off either: the check re-fires on every release, so someone has to manually wave through each version, forever.

This was already diagnosed by @aberus in microsoft/winget-pkgs#417619, who pulled the validation artifacts:

The validator launches the portable exe with no args and no stdin; claude.exe falls into --print mode and exits 1. Same result at WinGet\Packages\...\claude.exe and the WinGet\Links\claude.exe shim, across all five verify cycles. Nothing in the manifest can suppress that check. The fix would be from Anthropic: exit 0 with usage output when stdin isn't a TTY and no prompt is supplied.

Everything else in validation came back clean — ARP metadata, manifest policy, URL domain and catalog checks. This exit code is the only blocker.

What Should Happen?

With no prompt argument, and stdin that is neither a TTY nor piped input, claude should print usage and exit 0 — same as claude --help — rather than routing into --print mode and erroring.

Error Messages/Logs

$ claude < /dev/null
Error: Input must be provided either through stdin or as a prompt argument when using --print
ExitCode: 1

Steps to Reproduce

  1. Install Claude Code on Windows (any method — winget is where this actually bites).
  2. Run it with no arguments and stdin redirected away from the terminal:

claude < /dev/null ; echo "ExitCode: $?"

  1. It prints the error above and exits 1.

For comparison, on the same build:

| Command | ExitCode |
| --- | --- |
| claude --help | 0 |
| claude --version | 0 |
| claude < /dev/null | 1 |
| echo -n "" \| claude | 1 |

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.268 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

A note on the version field: I'm on 2.1.268 rather than the newest release because winget is precisely what's stuck — that is the bug. I can't check the behaviour on 2.1.282 without switching install methods.

On whether it's a regression: I marked "I don't know" because I haven't tested older builds myself. There is one data point though — in microsoft/winget-pkgs#417619 a winget maintainer noted "the build has been failing since version 2.1.226". That may refer to a separate Defender-scan error in the same pipeline rather than this exit code, so I didn't want to overstate it. Might be worth a look if you bisect.

Backlog context: microsoft/winget-pkgs#439193, plus the ~16 other open Anthropic.ClaudeCode PRs.

View original on GitHub ↗

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