Claude Token Counter Updated with Model Comparison Feature

Tool Update: Model Comparison Added
Simon Willison upgraded his Claude Token Counter tool to add the ability to run the same count against different models for comparison. The tool accepts any Claude model ID, with options for four notable current models: Opus 4.7 and 4.6, Sonnet 4.6, and Haiku 4.5.
Key Findings from Tokenizer Changes
According to Anthropic's Opus 4.7 announcement, the model uses an updated tokenizer that improves text processing but causes the same input to map to more tokens—roughly 1.0–1.35× depending on content type.
Specific test results:
- When pasting the Opus 4.7 system prompt into the token counting tool, Opus 4.7 used 1.46× the number of tokens as Opus 4.6
- Opus 4.7 maintains the same pricing as Opus 4.6 ($5 per million input tokens, $25 per million output tokens), but token inflation means it could be around 40% more expensive
- Claude Opus 4.7 is the first model to change the tokenizer, making comparisons primarily relevant between 4.7 and 4.6
Image Token Counting Results
The token counter tool also accepts images. Opus 4.7 has improved image support, accepting images up to 2,576 pixels on the long edge (~3.75 megapixels), more than three times as many as prior Claude models.
Image test results:
- A 3456×2234 pixel 3.7MB PNG showed 3.01× more tokens for Opus 4.7 compared to 4.6
- Update: This 3× increase is entirely due to Opus 4.7 handling higher resolutions. A 682×318 pixel image took 314 tokens with Opus 4.7 and 310 with Opus 4.6—effectively the same cost
PDF Processing Comparison
For a 15MB, 30-page text-heavy PDF:
- Opus 4.7 reported 60,934 tokens
- Opus 4.6 reported 56,482 tokens
- This represents a 1.08× multiplier, significantly lower than the multiplier for raw text
This tool is useful for developers who need to estimate costs and understand token usage differences between Claude model versions, particularly when planning migrations or comparing processing efficiency.
📖 Read the full source: HN AI Agents
👀 See Also

Project Headroom: Netflix Engineer's Open Source Tool Slashes AI Token Costs by 90%
Netflix senior engineer Tejas Chopra created Project Headroom, an open source proxy that compresses AI context input by up to 90%, saving an estimated $700,000 across users since January 2026. It runs locally on port 8787 and wraps any LLM CLI.

Qwen Meetup Draft: Function Calling Harness 2 Boosts CoT Compliance from 9.91% to 100% via Structured Schemas
A follow-up to the earlier function-calling harness post extends the pattern to domains without a compiler (investment memos, legal opinions, clinical charts). The schema forces required fields — submission rejected if incomplete. Qwen3.6-27b achieves 100% CoT compliance on these schemas.

skill-depot: A Local-First Memory and Skill System for MCP-Compatible AI Agents
skill-depot is a retrieval system that stores agent knowledge as Markdown files and uses vector embeddings to semantically search and selectively load only relevant content. It runs 100% locally with no API keys, works with any MCP-compatible agent, and can be set up with npx skill-depot init.

Torrix: Self-Hosted LLM Observability Without Postgres or Redis
Torrix is a self-hosted LLM observability tool that runs as a single Docker container backed by SQLite. Install with docker compose up; logs LLM calls via HTTP proxy or SDK — tokens, cost, latency, full traces, PII masking, cost forecasting.