Repository navigation
Semantic Breaks
This page describes how the core plugin claudetto puts each sentence of a Markdown file on its own line.
It is for a user who writes Markdown with Claude and for a contributor who edits the sembr slice.
A tool.call hook rewrites the Write and Edit calls for a Markdown file.
It also rewrites the quoted heredoc of git commit and gh pr create in a Bash call.
Each sentence starts on a new line, and a long sentence breaks only between clauses.
The hook never breaks a line at a column or in a word.
The hook uses Intl.Segmenter with sentence granularity and the locale und.
These are the Unicode sentence rules with CLDR data.
They work for each written language, for example Polish, Russian, and Japanese (。).
The hook has no word list of abbreviations and no rule about capital letters.
A break can follow an abbreviation, such as np. or e.g., when a capital letter follows it.
This only moves the text to a new line, and Markdown shows the same paragraph.
If the runtime has no Intl.Segmenter, the hook makes no break.
The hook leaves code blocks, inline code, tables, and links as they are. A list item and a quote keep their prefix on each new line, so a break stays inside the item or the quote. A file with CRLF line ends keeps CRLF on each line that the hook writes.
An Edit call whose old_string crosses a sentence break is split to match the file.
The hook runs before the guards, so the guards see the rewritten call.
- Start
- How claudetto Works
- Add-On Plugins
- How Claude Code Works
- Reference
- Rationale
- Evidence
- Development
- Archive