DEV Community

CleanDataDev
CleanDataDev

Posted on

How I cut my Cursor/Claude token usage by 90% with a custom "Dehydrator" tool matrix 🛡️

Hey fellow AI-native devs! 👋

Lately, I’ve been feeling the pain of "Context Window Full" and escalating API bills while using Cursor and Claude Code. I realized 80% of what we feed into the AI is just "Token Slop"—massive JSDocs, redundant logs, and implementation fluff that the LLM doesn't actually need to "see" to understand the core logic.

So, I built TokenCount (and the JustinXai Matrix). It's a suite of local-first tools designed to "dehydrate" your codebase before the AI reads it.

⚡ The "Wow" Moment:

I ran this on a heavy React component today:

  • Before: 1,248 tokens (Bloated with boilerplate)
  • After: 12 tokens (Pure semantic skeleton)
  • Total Saved: 92% reduction 🤯

🛠️ What’s in the Matrix?

  1. CLI (@xdongzi/ai-context-bundler): Dehydrate entire repos in seconds.
  2. VSCode Extension: A live token skimmer in your sidebar.
  3. MDC Generator: Instantly generate structured .cursorrules from snippets.

🛡️ 100% Local & Privacy-First

Everything runs on your machine. No servers, no tracking, just efficient context.

I’m launching this project TODAY on Product Hunt! 🚀
To celebrate, the Pro Pass is currently 50% OFF! for early birds.

Support us on Product Hunt (Launching in 4 hours!):
👉 https://www.producthunt.com/products/tokencount-context-bundler

I'd love to hear how you manage your context bloat. What’s your record for saving tokens? Let me know in the comments!

Top comments (3)

Collapse
 
johns23424234324234 profile image
John

The 12-token semantic skeleton is the interesting part. I’d love to see a follow-up showing where dehydration starts to hurt accuracy, because the best cutoff is probably different for UI code, config, and business logic.

Collapse
 
johns23424234324234 profile image
John

The big win here is separating “what the model needs to reason” from “what the repo happens to contain.” I’d also track saved tokens per changed file over time, because that shows whether the dehydration rules are actually getting better instead of just making one demo look good.

Collapse
 
johns23424234324234 profile image
John

The “token slop” framing is spot on. Once you see how much context is boilerplate, token optimization starts feeling less like penny-pinching and more like keeping the agent focused on the actual decision surface.