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
- Added new section: "Windows Command Line Best Practices" in AGENTS.md after the Coding Standards section
- Provided clear examples of problematic commands (including
findstrwith2>nul) - Documented safe alternatives:
- Let error output show naturally (don't suppress)
- Use full device path
\\.\NULif suppression is essential - Prefer PowerShell or dedicated tools over piped bash commands