Claude Code can't add trailing newline
Resolved 💬 12 comments Opened Feb 27, 2025 by steinerkelvin Closed Jan 20, 2026
Bug Description
Claude Code can't write files with a newline at the end even if explictly instructed to do so.
Environment Info
- Platform: macos
- Terminal: kitty
- Version: 0.2.19
- Feedback ID: b67373c4-f119-4d1c-8e62-8119531505c2
Transcript:
- User asks to create SAMPLE.md with a newline at the end
- Claude creates file but without trailing newline
- Hex dump confirms missing newline (ends with "2e" which is ".")
- Multiple attempts to add the newline using Replace tool fail
- Command verification with tail -c 1 SAMPLE.md | xxd -p shows "2e" after each attempt
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗