How to avoid 'no newline at end of file' efficiently?

Resolved 💬 5 comments Opened Jun 12, 2025 by sorah Closed Jan 8, 2026

Our code style prohibits no new line at end of file, OTOH, prohibits no leading \n at the end of text files.

I have tried several prompts in CLAUDE.md but it appears to be ignored. When I remind that the prompt has been ignored, Claude Code tries to echo >> ... for every changed file, which is inefficient.

Are there any chance to ensure \n at the end when writing files on tools' end?

View original on GitHub ↗

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