Skip to content

[BUG] file named nul created on windows #4928

@rweijnen

Description

@rweijnen

Environment

  • Platform (select one):
  • Anthropic API
  • Other: Claude CLI
  • Claude CLI version: 1.0.62
  • Operating System: Windows
  • Terminal:

Bug Description

Claude CLI is creating an unwanted file named "nul" in the current directory during execution. This appears to be related to incorrect handling of null device redirection on Windows systems.

Steps to Reproduce

  1. Run Claude CLI commands on Windows with version 1.0.62
  2. Check the current working directory after command execution
  3. Observe that a file named "nul" has been created

Expected Behavior

No "nul" file should be created. Output redirection to null device should properly use Windows equivalent (>nul or 2>nul) without creating actual files.

Actual Behavior

A file named "nul" is created in the current directory, suggesting the CLI is attempting to redirect output using Unix-style /dev/null syntax which Windows interprets as a literal filename.

Additional Context

This issue is likely caused by cross-platform compatibility problems where Unix-style null device redirection (>/dev/null) is being used instead of Windows-appropriate syntax (>nul). The behavior appears intermittent ("sometimes created"), which may depend on specific command paths or error handling routines within the CLI.

Metadata

Metadata

Assignees

Labels

area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsoncallplatform:windowsIssue specifically occurs on Windows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions