anthropics / anthropics/claude-code

[BUG] Windows - Write tool call incorrectly calls mkdir on Windows drive

Open
#81,162 1 comment 0 reactions 0 assignees View on GitHub
area:tools bug
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) 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?

Write hello.txt prompt fails on Windows

### What Should Happen?

mkdir should not be called on Windows drive directly.

### Error Messages/Logs

```shell
● Write(hello.txt)
⎿  Error: EPERM: operation not permitted, mkdir 'I:\'
⎿  Loaded 2 skills from .claude\skills
```

### Steps to Reproduce

1. Mount a folder to drive I: in Windows 11.
2. Open Powershell and go to drive root I:
3. Open Claude Code v2.1.170 with 'CLAUDE_CODE_PERFORCE_MODE' to '1'
4. Ensure environment is
```
Primary working directory: I:\
Platform: Windows 11 Enterprise (10.0.26200)
Shell: Bash (Unix shell syntax)
Git repository: No
Model: Claude Haiku 4.5 (us.anthropic-claude-haiku-4-5-20251001-v1:0)
Knowledge cutoff: February 2025
```
5. Enter prompt: Write hello.txt

### Claude Model

Other

### Is this a regression?

No, this never worked

### Last Working Version

_No response_

### Claude Code Version

2.1.170

### Platform

Anthropic API

### Operating System

Windows

### Terminal/Shell

Windows Terminal

### Additional Information

_No response_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the Write tool call from the issue at the root of a mounted Windows I: drive, using the stated Claude Code and shell setup. Trace the Write tool's directory-creation path and verify that writing hello.txt does not attempt mkdir on I:\; repeat the reproduction to confirm the file is created successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.