Fermat's Last Token
A middleware layer for Claude Code that cuts token usage 34-51% on average via semantic context pruning, without changing your workflow.
🔗 Visit Fermat's Last TokenDescription
AI coding assistants like Claude Code can rack up a real bill, because every message you send drags along a growing pile of context — file contents, past turns, tool outputs — that the model has to re-read every time. Fermat's Last Token sits between you and Claude Code and quietly trims that context down to what actually matters before it's sent, so you pay for less without the assistant losing track of what it's doing.
Technically, it uses semantic context pruning and purpose-built, optimized tool calls to reduce token expenditure by a documented 34-51% on average, while preserving critical instructions and task state and falling back gracefully (fail-soft passthrough) if pruning risks losing something important. It works with Opus, Sonnet, and Haiku, integrates without requiring workflow changes, and offers organization-level support with centralized billing. Pricing is $20/month for unlimited usage, or an optional metered model where you pay only 10% of whatever it saves you — plus a free trial through the end of September. The company is Y Combinator-backed, founded by researchers with backgrounds at Stanford, AWS, Apple, and Accenture, and publishes its benchmark methodology openly on GitHub.
💬 Our review
The short version: if your Claude Code API bill is a real line item, Fermat's Last Token is a low-risk way to cut it by roughly a third to half, especially with the pay-only-a-cut-of-savings pricing option removing most of the downside.
Against just manually managing context yourself (clearing conversations, being disciplined about what you paste in), the tool's advantage is that it works automatically and continuously, and the fail-soft design means it shouldn't silently break your session if it prunes something it shouldn't. Against Claude Code's own built-in /compact and context management, Fermat's Last Token claims to go further with semantic pruning rather than simple truncation, though — as with any third-party benchmark — the 34-51% figure is the vendor's own number and worth validating on your specific workload rather than taking at face value. At $20/month flat or 10% of savings, the metered option in particular is close to risk-free to try. Skip it if your usage is already light enough that token cost isn't a real pain point.
💰 Pricing
📊 Global score
🤖 AI-enriched data
$20/month for unlimited usage, or metered billing at 10% of savings. 2-week free trial through September 30.
Pros
Documented 34-51% average token savings
No workflow changes required to adopt
Fail-soft passthrough avoids silently breaking sessions
Metered pricing option (10% of savings) makes it near risk-free to try
Open benchmark methodology published on GitHub
Cons
Savings figures are the vendor's own benchmark, worth validating on your workload
Only useful if token cost is already a meaningful pain point
$20/month flat tier adds cost on top of your existing Claude Code usage
Third-party layer between you and Claude Code — one more dependency to trust
