Splits text on Unicode boundaries (UAX-29 grapheme clusters, words, sentences; UAX-14 line breaks) and performs full case folding across all code points, including Turkish I and Eszett, without ICU.
Ships in stringzilla-cli. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
sz-segment-utf8 --by graphemes herd.txt # user-perceived characters, emoji sequences intact
sz-segment-utf8 --by words --show count herd.txt # tiles the input: spaces and punctuation are segments too
sz-segment-utf8 --by sentences --format json herd.txt
sz-segment-utf8 --by linebreaks herd.txt # soft-wrap opportunities, not lines
--by | Boundary | Note |
|---|---|---|
graphemes | UAX-29 grapheme clusters | the unit a user calls "a character" |
words | UAX-29 word boundaries | tiles, so separators are segments — filter, don't assume |
sentences | UAX-29 sentences | no abbreviation dictionary, so "Dr. Smith" splits after "Dr." |
linebreaks | UAX-14 line-break opportunities | wrap points, not hard line terminators |
whitespace | whitespace runs, separators dropped | the naive tokenizer, when that is what you want |
delimiters | any Unicode punctuation, symbol or separator | drops the separators |
newlines | LF, CR, CRLF, NEL, LS, PS | the hard terminators |
Tilers and splitters differ: graphemes, words, sentences and linebreaks tile the input, so concatenating the segments reproduces it exactly, while whitespace, delimiters and newlines drop what they split on.
--fields byte-span prefixes each segment with its byte offsets.
Case folding is what --ignore-case applies, and it is full rather than partial — all defined code points, not just ASCII plus a few.
sz-find --show count --ignore-case strasse xlsum.csv # 205 results; ripgrep finds 183
sz-find --show count --ignore-case işi xlsum.csv # 25,065; GNU grep returns 29,942, wrong twice over
The Eszett folds to ss, so "Straße" answers to strasse.
Turkish "İ" folds to i plus a combining dot, and GNU grep folds dotless "ı" into i, sweeping in words that do not contain the query while still missing the ones that do.
Its extra results are the wrong ones twice over, which is the failure mode to watch for: a plausible count that is silently the wrong set.
Reach for this on legal text, German or Swiss news, Turkish text, or anything mixing scripts.
A fold can change the matched length, since ß is one code point and ss is two, so never assume the match is as long as the needle.
There is no normalization here.
Nothing in this toolset applies NFC, NFD, NFKC or NFKD, so é as one code point and e plus a combining acute stay distinct under every command including --ignore-case.
Normalize upstream if the corpus needs it.
sz-count --fields chars herd.txt # code points, not bytes
sz-count herd.txt # lines, words, bytes, as `wc` defines them
--utf8 widens the newline set from LF alone to the Unicode set — VT, FF, NEL, LS and PS — everywhere a command splits lines.
The two sets disagree about where a line begins, so pass --utf8 consistently across a pipeline, and to both the read and the edit when a line name issued by one command is consumed by another.
sz-replace matches byte-literally, which is why it has --ignore-case but no --utf8 to pair with it.
To search or rewrite what you have segmented, load find-and-replace-text-with-content-hash-guarded-edits.
What SKILL.md sets; muted values are Claude Code's defaults
Triggers: sz-segment-utf8, tokenize, segmentation, grapheme cluster, user-perceived character, emoji sequence, word boundary, sentence boundary, line-break opportunity, UAX-29, UAX-14, ICU, case folding, case-insensitive matching on non-ASCII text, Unicode, UTF-8, Eszett, ß, Straße, Turkish I, dotless i, counting characters versus bytes, multilingual corpus, "why did grep -i miss this", "split this into words properly", "count the characters not bytes".
Three short reads, in order
/stringzilla-cli:segment-tokenize-and-case-fold-unicode-textfrom stringzilla-cli
npx claudepluginhub ashvardanian/stringzilla-cli --plugin stringzilla-cli2 skills in this plugin
Other plugins' skills for the same job