Write tool fails on new/empty files: 'File has not been read yet'

Resolved 💬 3 comments Opened Jan 13, 2026 by Samburskoy Closed Mar 5, 2026

Problem

The Write tool requires a prior Read call before writing to a file. This creates a catch-22 for new or empty files:

  1. Write requires Read first
  2. Read on empty/non-existent file doesn't register as successful read
  3. Write refuses to work

Error message

File has not been read yet. Read it first before writing to it.

Expected behavior

Write tool should allow creating new files without requiring a Read call first. The Read requirement makes sense for existing files (to prevent accidental overwrites), but not for new file creation.

Workaround

Using Bash with echo or cat > to create new files instead of Write tool.

Environment

  • OS: Windows 11 (Git Bash / MINGW64)
  • Claude Code version: latest (npm)

Suggested fix

Skip the "file has been read" check when the target file doesn't exist or is empty.

View original on GitHub ↗

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