Add option to disable emojis in code generation
Status Closed — not planned
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Sep 14, 2025 · closed Feb 27, 2026
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Feature Request: Emoji-free Code Generation Option
### Problem
When generating Python code, Claude Code frequently includes emoji characters in:
- print statements
- comments
- string literals
This causes UnicodeEncodeError on Windows systems using cp1252 encoding:
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f393'
in position 0: character maps to
Proposed Solution
Add a setting/option to disable emoji usage in all code generation, ensuring:
- Clean, professional code output
- Windows compatibility
- No encoding issues
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
Configuration and settings
Use Case Example
Professional development environments where:
- Code needs to run on various systems
- Emoji-free output is preferred
- Encoding compatibility is critical
Thank you for considering this feature request!
Additional Context
_No response_
11 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Hey, this is a great point. I've run into similar encoding issues on Windows before. It's definitely frustrating when generated code doesn't run out of the box because of an unexpected emoji.
I was curious and dug into the official documentation you were given. It looks like the model is actually instructed not to use emojis unless explicitly asked.
The unpublished system prompt for
claude code v1.0.113includes these lines:And for tools that modify files, like
WriteandEdit, it repeats the instruction:So, your experience seems to be a case of the model not following its instructions perfectly, which makes this a really good bug report.
While we wait for an official setting, I've had a lot of success using the
CLAUDE.mdmemory file to add stricter, project-specific rules. You could create a file in your project root at./CLAUDE.md(or for all your projects at~/.claude/CLAUDE.md) with a strong directive like this:According to the memory docs, Claude loads this file into its context for every session in that project. I've found it's pretty good at following these kinds of explicit overrides.
It's not a perfect solution, but it should solve the
UnicodeEncodeErrorfor you in the meantime. Hope this helpsClaude Code's emoji-spam and hyperbolic language are a serious problem that negatively impacts development quality:
This cumulative reality distortion might be termed "Panglossian", "auto-propaganda" or "self-delusion".
Moderating its tone and eliminating emojis is therefore a serious requirement ... nobody wants a tool that counteracts itself.
Yeah, it’s really frustrating to see it mess up on this… and it eats up tokens for nothing… thanks, planet Earth.
emojis and also icons, it's a nightmare with this. when I ask for a clean report with no emojis, and no icons, just strictly pure facts and data integrity i finally get a reasnable report. why shouldn't this be a default state?
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Workaround: PreToolUse Hook with
updatedInput(requires v2.0.10+)Until an official option is added, here's a working solution using the
updatedInputfeature introduced in v2.0.10.This hook intercepts
Write/Editoperations and auto-converts emoji/symbols to ASCII equivalents before the file is written.Setup
.claude/hooks/unicode_auto_fixer.js:.claude/settings.local.json:How it works
[OK], star ->*)updatedInputto modify content before write (not just block)Example
Tested Environment
Should also work for other non-UTF-8 Windows locales (cp1252, GB2312, etc.).
Thanks for the solution. Is there anyway to achieve this via the frontend GUI rather than when using the API?
Is it the only issue on emojis ? Is there fix to be planned ? What is the latest workaround ?
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.