[BUG] `claude doctor` hangs indefinitely with zero output when run without a TTY
Environment
- Claude Code: 2.1.168
- OS: macOS 15.7.7 (Intel, Darwin 24.6.0)
- Shell: zsh
Steps to reproduce
cd "$(mktemp -d)" # clean dir, no .mcp.json
claude doctor < /dev/null
Expected
doctor detects that stdin is not an interactive TTY and either runs its checks non-interactively and prints results, or exits promptly with an error (the way -p mode handles non-TTY contexts).
Actual
Zero bytes of output on stdout/stderr and the process never exits — it appears to block waiting for interactive TTY input. Killed manually after ~45s. Reproduced consistently.
Why it matters
Any scripted/CI health check (claude doctor in a pipeline, cron, or agent-driven smoke test) hangs forever instead of failing fast. Found while systematically smoke-testing every CLI flag/subcommand non-interactively — doctor was the only command of 67 tested that hung rather than running or erroring cleanly.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗