Skip to content

Add Windows Command Line Best Practices to AGENTS.md#7980

Merged
NachoEchevarria merged 2 commits intomasterfrom
nacho/AvoidClaudeNulError
Dec 23, 2025
Merged

Add Windows Command Line Best Practices to AGENTS.md#7980
NachoEchevarria merged 2 commits intomasterfrom
nacho/AvoidClaudeNulError

Conversation

@NachoEchevarria
Copy link
Collaborator

Summary of changes

Added clear guidelines to AGENTS.md about avoiding >nul and 2>nul redirections on Windows, which can create literal "nul" files that are extremely difficult to delete.

Reason for change

On Windows, redirecting to nul (e.g., command 2>nul) can create a literal file named "nul" in the current directory instead of properly redirecting to the NUL device. These files are problematic because:

  • They cannot be deleted using standard Windows commands
  • They cause repository hygiene issues
  • They're confusing and frustrating to deal with

This issue was documented in anthropics/claude-code#4928

Implementation details

  1. Added new section: "Windows Command Line Best Practices" in AGENTS.md after the Coding Standards section
  2. Provided clear examples of problematic commands (including findstr with 2>nul)
  3. Documented safe alternatives:
    • Let error output show naturally (don't suppress)
    • Use full device path \\.\NUL if suppression is essential
    • Prefer PowerShell or dedicated tools over piped bash commands

Test coverage

Other details

@NachoEchevarria NachoEchevarria marked this pull request as ready for review December 19, 2025 15:58
@NachoEchevarria NachoEchevarria requested a review from a team as a code owner December 19, 2025 15:58
Copy link
Collaborator

@bouwkast bouwkast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW whenever this happened I just started a WSL instance in the terminal and ran git clean -fd

@NachoEchevarria NachoEchevarria merged commit 053addc into master Dec 23, 2025
98 of 101 checks passed
@NachoEchevarria NachoEchevarria deleted the nacho/AvoidClaudeNulError branch December 23, 2025 12:39
@github-actions github-actions bot added this to the vNext-v3 milestone Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants