{"slug": "a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift", "title": "A linter that finds wasted tokens in your prompts (fork of ritenv/tokensift)", "summary": "A developer packaged a fork of Riten Vagadiya's Token Sift library as an npm CLI tool called @yuhond/token-sift that scans prompts, message arrays and tool schemas for wasted tokens. The tool ships with 20 built-in rules covering repeated text, oversized identifiers, verbose JSON, duplicated messages, filler and inefficient tables, plus two CI gate rules for token budgets and baselines that can fail a build when a prompt regresses. Analysis runs fully locally, and Claude token counts are labeled as estimates because no public tokenizer is available.", "body_md": "Fork of ritenv/tokensift — full credit to Riten Vagadiya for the original library. I packaged it for npm; I did not build it from scratch.\n\nI kept noticing the same thing in my own prompts: repeated instructions, filler words, bloated JSON, IDs and tables that cost tokens without adding meaning. Editing by feel never showed how much it actually cost — so I packaged this linter for npm to make it easy to install and use.\n\nToken Sift is a local command-line tool that finds avoidable token use in prompts, message arrays, and tool schemas. It ships with 20 built-in rules for common inefficiencies — repeated text, oversized identifiers, verbose JSON, duplicated message content, unhelpful filler, dynamic data that should not be baked into a prompt, inefficient tables — plus 2 CI gate rules for budgets and baselines.\n\nInstall it with:\n\n```\nnpm install --global @yuhond/token-sift\n```\n\nThen point it at a prompt file:\n\n```\ntoken-sift prompts/support-ticket.md --model gpt-4o\n```\n\nEvery finding shows the affected text, severity, token counts, a suggested change, and a confidence label. If a finding supports a safe automatic fix, you can apply it with --write — but review the result first on important files. --format json exports structured results for scripts and CI.\n\nThe part I use most in real projects is the CI gate. You can set a token baseline and a budget, then fail the build when a prompt regresses:\n\n```\ntoken-sift prompts/*.md --model gpt-4o --update-baseline\ntoken-sift budget init prompts/*.md --model gpt-4o\ntoken-sift check prompts/*.md --model gpt-4o\n```\n\nTwo things I was strict about. First, privacy: analysis runs fully locally. The only commands that touch the network are the explicit pricing update and calibrate commands — no code or prompts are ever uploaded. Second, honesty about Claude: Claude has no public tokenizer in this tool, so every Claude count is labeled estimate, never presented as exact. OpenAI-model counts use their corresponding tokenizer.\n\nFork details: MIT, attribution kept. I renamed the package to @yuhond/token-sift and the command to token-sift, and isolated its config as token-sift.config.json and .token-sift/ so it does not collide with the original.\n\nTry it on your longest prompt and see what it finds: [https://github.com/yhdhappy/TokenSift](https://github.com/yhdhappy/TokenSift)", "url": "https://wpnews.pro/news/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift", "canonical_source": "https://dev.to/yhdhappy/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenvtokensift-30o5", "published_at": "2026-10-31 10:35:00+00:00", "updated_at": "2026-10-31 10:50:03.952732+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-agents"], "entities": ["Token Sift", "Riten Vagadiya", "@yuhond/token-sift", "npm", "GitHub", "OpenAI", "Claude"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift", "markdown": "https://wpnews.pro/news/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift.md", "text": "https://wpnews.pro/news/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift.txt", "jsonld": "https://wpnews.pro/news/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenv-tokensift.jsonld"}}