[BUG] Write tool write garbled text when write emojis to empty file - 100% reproduce

Resolved 💬 2 comments Opened Sep 13, 2025 by tjx666 Closed Dec 11, 2025

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?

Write tool write garbled text when write emojis to empty file.

key condition:

  1. empty file
  2. emojis or cjk characters

<img width="1067" height="600" alt="Image" src="https://github.com/user-attachments/assets/5f58ab12-5c2c-4346-bcec-bf31b51a04ef" />

What Should Happen?

Write the emojis to file without garbled text

Steps to Reproduce

reproduce:

  • create a empty file with one empty line
  • ask claude code to write some emojis to it

then you will see some garbled text.

But if the file is not empty, no this issue.

Claude Model

Opus

Is this a regression?

I don't know

Claude Code Version

1.0.113 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

View original on GitHub ↗

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