[BUG] Windows: Creates reserved "nul" filename, breaks SharePoint/OneDrive sync

Resolved 💬 3 comments Opened Jan 7, 2026 by gigarun Closed Jan 11, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

## Description

Claude Code occasionally creates a file named nul in the working directory on Windows.

On Windows, nul is a Reserved Device Name, which causes:

  • File cannot be deleted via Windows Explorer or standard commands
  • OneDrive/SharePoint sync breaks completely
  • Access denied to folders for all collaborators sharing the SharePoint directory
  • Folder becomes inaccessible until the file is removed via WSL/Git Bash

## Environment

  • OS: Windows 11
  • Storage: OneDrive for Business / SharePoint synchronized folder
  • Shell: Git Bash

## Steps to Reproduce

  1. Use Claude Code in a OneDrive/SharePoint synced folder
  2. Perform file creation/editing operations
  3. A nul file (~100 bytes) appears in the folder
  4. SharePoint sync fails
  5. Collaborators can no longer access the folder

## Business Impact

Critical: Blocks shared folder access for entire team. Requires manual intervention via WSL or special tools to delete the file.

## Workaround

Delete via Git Bash or WSL:
```bash
rm "./nul"

Suggested Fix

Add filename validation to exclude Windows reserved names:
CON, PRN, AUX, NUL, COM1-COM9, LPT1-LPT9

What Should Happen?

Claude Code should never create files with Windows reserved names (NUL, CON, PRN, AUX, COM1-9, LPT1-9). The tool should validate filenames before creation and either:

  1. Skip/block creation of reserved names
  2. Automatically rename to a safe alternative (e.g., "_nul" or "nul_file")

Error Messages/Logs

Steps to Reproduce

  1. Open Claude Code on Windows in a OneDrive/SharePoint synced folder
  2. Ask Claude to perform file operations (create, edit, or list files)
  3. A file named "nul" (~100 bytes) is created in the directory
  4. OneDrive/SharePoint sync fails with error
  5. Collaborators get "Access Denied" when trying to open the folder
  6. File cannot be deleted via Explorer or standard "del" command

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

4-5-20251101

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗