ttok 0.4
Simon Willison’s Weblog Simon Willison
ttok 0.4 is out: Simon Willison updated his token-counting CLI after a long lull. It now fixes a Click warning, updates CI, and can list models, so it’s easier to use again.
Based on reporting by Simon Willison’s Weblog, Simon Willison — read the original for the full story.
Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error
Simon Willison has released ttok 0.4, a refresh of his command-line tool for counting tokens with OpenAI’s open source tiktoken library. The tool had sat untouched for a couple of years, and this update is mostly the kind of maintenance that keeps a small utility alive instead of slowly turning it into a warning-spewing fossil.
The biggest change is a new --list-models command, which does exactly what it says: it shows the available models. That makes the tool a little more self-serve, especially for people who don’t want to guess their way through model names before checking a prompt size.
Willison also fixed a Click warning and updated continuous integration. Not flashy, but useful. CLI tools have a way of breaking in the quietest possible way, and these are the sorts of fixes that keep them from becoming annoying enough to abandon.
ttok also works with uvx, so token counting can be dropped into a pipe with something as simple as cat file.txt | uvx ttok. That keeps the whole thing in the spirit of the tool: fast, practical, and aimed at answering one narrow question without making a production out of it.
My take — AI-written commentary, not fact-checked reporting
This is the right kind of release: boring, tidy, and actually useful. Too many AI-adjacent tools try to look important; token counters should just work and get out of the way. The real flex here is resisting feature bloat for long enough to ship a small fix-up instead of a circus.
Read more about this at: Simon Willison’s Weblog