<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: joyofish</title>
    <description>The latest articles on DEV Community by joyofish (@yhdhappy).</description>
    <link>https://dev.to/yhdhappy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4218783%2Fac4c18f0-9690-4156-805d-4401330c215f.png</url>
      <title>DEV Community: joyofish</title>
      <link>https://dev.to/yhdhappy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yhdhappy"/>
    <language>en</language>
    <item>
      <title>A linter that finds wasted tokens in your prompts (fork of ritenv/tokensift)</title>
      <dc:creator>joyofish</dc:creator>
      <pubDate>Sat, 31 Oct 2026 10:35:00 +0000</pubDate>
      <link>https://dev.to/yhdhappy/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenvtokensift-30o5</link>
      <guid>https://dev.to/yhdhappy/a-linter-that-finds-wasted-tokens-in-your-prompts-fork-of-ritenvtokensift-30o5</guid>
      <description>&lt;p&gt;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.&lt;br&gt;
I 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.&lt;br&gt;
Token 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.&lt;br&gt;
Install it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--global&lt;/span&gt; @yuhond/token-sift
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then point it at a prompt file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;token-sift prompts/support-ticket.md &lt;span class="nt"&gt;--model&lt;/span&gt; gpt-4o
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every 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.&lt;br&gt;
The 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:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;token-sift prompts/&lt;span class="k"&gt;*&lt;/span&gt;.md &lt;span class="nt"&gt;--model&lt;/span&gt; gpt-4o &lt;span class="nt"&gt;--update-baseline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;token-sift budget init prompts/&lt;span class="k"&gt;*&lt;/span&gt;.md &lt;span class="nt"&gt;--model&lt;/span&gt; gpt-4o
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;token-sift check prompts/&lt;span class="k"&gt;*&lt;/span&gt;.md &lt;span class="nt"&gt;--model&lt;/span&gt; gpt-4o
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two 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.&lt;br&gt;
Fork 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.&lt;br&gt;
Try it on your longest prompt and see what it finds: &lt;a href="https://github.com/yhdhappy/TokenSift" rel="noopener noreferrer"&gt;https://github.com/yhdhappy/TokenSift&lt;/a&gt;&lt;/p&gt;

</description>
      <category>promptengineering</category>
      <category>llm</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
