The Biology of Claude's Tokenizer A developer has reverse-engineered Anthropic's Claude tokenizer, finding it is not a standard byte-level BPE but instead uses a minimum-piece tokenization scheme similar to MinGram or PathPiece. The reconstruction reveals novel boundary markers that wrap word-like spans and a capitalization shift marker that lets the model encode title-case and all-caps words from lowercased forms, with the code released on GitHub. Claude's tokenizer remains a mystery, and with the recent 40%+ increase in token cost for basic English text, even more so. While everyone else ships a fairly standard byte-level BPE tokenizer, Anthropic seems to have placed their bets on something unique. In this post I'll go through the most interesting properties I've found while reconstructing Claude's tokenizer. Code is available here: https://github.com/sanderland/ctok https://github.com/sanderland/ctok Claude’s tokenizer is not BPE A pairwise BPE construction requires every non-base token to be built from two smaller vocabulary pieces, so a one-token span must have at least one internal split into two things that are themselves tokens. That’s testable. The Hangul syllable 최 choi is the first example I found. It is one token which makes sense, a very common surname , but testing other Korean syllables which share a common UTF-8 prefix/suffix shows the 2-byte prefix and suffix are not tokens in any other character i.e. all characters sharing a prefix or suffix cost 3, their length in bytes . So what is it? The one rule that seems to consistently explain the token counts is a minimum-piece tokenization as in MinGram https://arxiv.org/abs/2606.27019 or PathPiece https://arxiv.org/abs/2402.18376 . Vocabulary size My best estimate of vocabulary size is around 49-55k for Claude v3-v4.6 and around 16-20k after, based on the list of tokens found so far. Update: it settled at 48k and 15k in the end, almost certainly 49,152 and 16,384 with some of those being reserved Boundary markers and spaces Boundary markers on words One of the main novelties of the Claude tokenizer is wrapping word-like spans in boundary markers. I use ^ and $ as notation for these inferred begin- and end-of-word tokens. For example, “tokenizers” becomes ^token izers$ For example “semiconduct”, “usercontent” are two tokens and “romagnet” is three tokens in isolation, but the tokens here are ^semiconduct $ , ^ usercontent$ and ^ romagnet $ , that is, the phrases are tokens but just in the right context. And indeed, “semiconductromagnetusercontent” tokenizes to the expected three tokens. Similarly, “telecommunications” is a single token, but “telecommunicationsy” is four ^telecommun ic ation sy$ This also clarifies the conclusion of my previous post https://tokencontributions.substack.com/p/whole-words-and-claude-tokenization , where I suggested that most Claude tokens were whole words. What was really being measured was whether the fully marked form ^word$ was a one-token vocabulary entry. Boundary markers on punctuation Spans of punctuation characters also get markers, but only on the side where they border a space, e.g. the punctuation in a== b becomes ==$ Boundary markers eat spaces At first sight, these markers may seem a little wasteful of vocabulary space, but this is compensated for by not needing different variants for word-with-a-space and word-without-a-space. Specifically, I think that any space in $