Deleting `nul` files created in error by Claude code

Search for a command to run...

No comments yet. Be the first to comment.
This series groups articles which discuss specific code or technical concepts (as opposed to the process of working, etc.) If the blog consisted of only these articles, it would be a technical blog.
I’m far from a command line wizard, but am gradually picking up more tricks and tips as time goes by. I recently found a styling bug I was confident I’d introduced in the previous few commits, but I wasn’t sure which one. In the past I’ve used git bi...
I recently use the /goal command in Claude Code for the first time. I was struggling to reproduce a bug that I already had a theoretical understanding of from investigating the codebase, but had previ

Things that happened I received a happy birthday message from our HR system. It gave me the same vibes as the AI-written compliments I mentioned in Month in review: May 2026. Microsoft ran an "AI sk

Fixing a code analysis auto-fix which made acronyms less clear

Things I learnt A HashSet is for storing unique elements. The point is that it has O(1) lookups like a Dictionary does. It uses the same basic mechanism as a Dictionary does (hashing objects then usi

I was recently working with an EF Core entity which contained a C# Point property representing a geolocation. This was stored in a single column in a SQL Server database. (I think this uses NetTopolog

I’ve recently been given access to Claude Code at work, so I’ve been trying it out to see how I get on with it. I tend to run it from a Windows Command Prompt, and I’ve noticed that it keeps creating files named nul with 0KB size. Worse, when I try to delete them I have to provide admin credentials, and even as an admin the file isn’t actually deleted and reappears after refreshing Windows Explorer.
Claude Code sometimes runs commands which contain something along the lines of > ./nul, which I assume does something meaningful in Bash but not in Windows Command Prompt. Windows creates a file instead of whatever the intended behaviour is. Something about the filename nul means the normal Windows operations for deleting a file can’t be used. So how can I get rid of the file?
Happily, once I explained the problem to Claude, it gave me a Windows Command Prompt command to delete the file:
del "\\?\%CD%\nul"
This command needs running in the same directory as the nul file.
Apparently, the \\?\ prefix bypasses Windows' normal checks for reserved filenames, allowing you to directly access and delete the nul file. Admin permissions are not required. I’ve updated Claude’s instructions to try and avoid it creating more of these nul files in the future, but I suppose I’ll need to wait a while to see how that turns out!