You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These issues describe the same problem with the nul file being created and causing issues on Windows. Consider consolidating the discussion there to help maintainers track the fix.
PS: Claude says this: "This is almost certainly being created by OpenCode (or one of its tools) running on Windows. When code written for Unix tries to redirect output to /dev/null, on Windows that can inadvertently create a literal file named nul in the working directory."
...can delete using File Explorer. Requires admin approval to delete.
Scratch that, it just appears to delete it, but when i hit it F5 it's there again. So either it didn't actually get deleted, or it got re-created immediately? 🤔
On Windows, opencode often runs commands via Git Bash.
The model sometimes emits Windows‑style redirection like > NUL.
In Git Bash, NUL is treated as a literal filename, so it creates a file named nul (a reserved device name). PowerShell then can’t delete it.
Best fix
Normalize null‑device redirections before executing: if the shell is POSIX (bash/sh), rewrite NUL → /dev/null; if the shell is cmd/PowerShell, rewrite /dev/null → NUL.
Also surface the actual shell in the system prompt so the model doesn’t guess the wrong redirection syntax.
Will see if the fix works locally.
Btw. you can also delete the file with git bash.
Activity
github-actions commentedon Feb 12, 2026
This issue appears to be a duplicate of existing open issues. Please check:
These issues describe the same problem with the
nulfile being created and causing issues on Windows. Consider consolidating the discussion there to help maintainers track the fix.breggles commentedon Feb 14, 2026
Happens for me in OpenCode 1.2.1 on Windows 11. Can't delete in PowerShell, but can delete using File Explorer. Requires admin approval to delete.
breggles commentedon Feb 14, 2026
PS: Claude says this: "This is almost certainly being created by OpenCode (or one of its tools) running on Windows. When code written for Unix tries to redirect output to /dev/null, on Windows that can inadvertently create a literal file named nul in the working directory."
breggles commentedon Feb 14, 2026
Scratch that, it just appears to delete it, but when i hit it F5 it's there again. So either it didn't actually get deleted, or it got re-created immediately? 🤔
breggles commentedon Feb 14, 2026
Oh, there is a fix. Ignore me...
harunurhan commentedon Feb 20, 2026
FYI, you can delete the file using something like this
cmd /c del \\.\C:\path\to\nul, for the time being.Xenogix commentedon Feb 25, 2026
It looks like our version of this file contains
stdoutredirect data, which is possible to read through WSL (cat /mnt/c/path/to/nul)It is also possible to remove it easily with WSL using
rm /mnt/c/path/to/nulkevin-regnology commentedon Mar 1, 2026
Here is what i found with codex:
What’s going wrong
Best fix
Will see if the fix works locally.
Btw. you can also delete the file with git bash.
festoney8 commentedon Mar 14, 2026
I can't delete it using any Windows command, and even DiskGenius returns an error, but in WSL works
JustPlayground commentedon Mar 16, 2026
try run in cmd:
del "\\?\C:\path to it\nul"
path must be absolute
orhanmaden commentedon Mar 26, 2026
I ask opencode to remove it and it works. It is annoying.
OwenClaw commentedon Apr 1, 2026
I tried a lot of commands in WINDOWS PowerShell or CMD, but finally only GitBash
rm nulworksHona commentedon Apr 1, 2026
for windows users, opencode now uses powershell by default. so there wont be any pipe issues creating the nul files