feat: language-orthography plugin — enforce diacritical marks for non-English languages#32894
Open
alissonlinneker wants to merge 1 commit intoanthropics:mainfrom
Open
Conversation
The built-in language instruction ("Always respond in X") doesn't mention
diacritical marks, so the model frequently drops accents, cedillas, and
other characters required by non-ASCII languages like Portuguese, French,
Vietnamese, Czech, etc.
This plugin adds a SessionStart hook that reads the user's language setting
and injects an explicit orthographic enforcement instruction, framing
diacritic omission as an error rather than a style choice.
No-op for English or when no language is configured.
Closes anthropics#32886
3 tasks
This was referenced Mar 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
language-orthographyplugin that enforces full orthographic correctness (accents, cedillas, umlauts, etc.) when thelanguagesetting targets a non-ASCII language.languagefrom settings and injects an orthographic enforcement instructionexplanatory-output-styleandlearning-output-stylepluginsCloses #32886
Context
The built-in language instruction template says "Always respond in pt-BR" but never mentions diacritical marks. The model interprets this loosely and frequently produces accent-less text — e.g.,
informacaoinstead ofinformação,voceinstead ofvocê. This affects every language with diacritics: Portuguese, French, Vietnamese, Czech, Turkish, Spanish, German, etc.The problem gets worse after context compaction because:
"may or may not be relevant"disclaimer, which the model uses to deprioritize themThis plugin works around the issue at the prompt level. The long-term fix would involve strengthening the core
r1z()language template and passing language rules to the compaction step — details in #32886.What the plugin does
The SessionStart hook:
languagefrom~/.claude/settings.jsonorsettings.local.jsonTest plan
language: "pt-BR"— outputs correct enforcement JSON with accented exampleslanguage: "fr"— outputs enforcement for Frenchlanguage: "en-US"— silent no-op (exit 0, no output)