Wow, I did not expect such perfect reproduction. Link to the actual source code (before being rewritten):
https://github.com/chardet/chardet/blob/5.0.0/chardet/mbchar...
https://github.com/chardet/chardet/blob/5.0.0/chardet/mbchar...
/home/claude/.cache/uv/archive-v0/nZCy52fMCgTsNaLySn0xf/chardet
/home/claude/.cache/uv/wheels-v6/pypi/chardet
/usr/lib/python3/dist-packages/pip/_vendor/chardet
/usr/local/lib/python3.12/dist-packages/chardet
It's not surprising that they were able to create a new, working version of chardet this quickly. It seems the author just told Claude Code to "do a clean room implementation" and to make sure the code looks different from the original chardet (named several times in the prompt) without considering the training set and the tendency for LLMs to "cheat".