Add Windows Command Line Best Practices to AGENTS.md by NachoEchevarria · Pull Request #7980 · DataDog/dd-trace-dotnet

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