[BUG] External tools, e.g. test runners, are seemingly not run in non-interactive TTY

Resolved 💬 5 comments Opened Sep 23, 2025 by rassie Closed Jan 11, 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?

It seems Claude Code doesn't run external tools in a non-interactive TTY.

Tools like Vitest tend to have different defaults for interactive and non-interactive TTYs. In case of Vitest the default interactive mode is to activate the "endless" watch mode. Without an interactive TTY, watch mode is deactivated.

When Claude Code starts a Vitest session without any additional parameters for the watch mode, the test session always times out after two minutes instead of being done in a couple of seconds, which leads me to suspect it's not initializing a non-interactive TTY correctly.

What Should Happen?

When run through Claude Code, the expectation is for tests to only run once and then exit unless explicitely specified otherwise.

Error Messages/Logs

Steps to Reproduce

  1. Find a project using Vitest with a default configuration
  2. Use Claude Code to run tests in this project
  3. Observe a two minute timeout instead of an almost immediate return

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

1.0.120

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗