<?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: Felix Wang</title>
    <description>The latest articles on DEV Community by Felix Wang (@wjddidi1).</description>
    <link>https://dev.to/wjddidi1</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%2F4243204%2Fb935d14e-b2f7-40d7-a3b9-d734aec984c6.png</url>
      <title>DEV Community: Felix Wang</title>
      <link>https://dev.to/wjddidi1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wjddidi1"/>
    <language>en</language>
    <item>
      <title>Your AI agent is reading the wrong 25 million tokens</title>
      <dc:creator>Felix Wang</dc:creator>
      <pubDate>Fri, 13 Nov 2026 15:27:42 +0000</pubDate>
      <link>https://dev.to/wjddidi1/your-ai-agent-is-reading-the-wrong-25-million-tokens-m8</link>
      <guid>https://dev.to/wjddidi1/your-ai-agent-is-reading-the-wrong-25-million-tokens-m8</guid>
      <description>&lt;p&gt;I built a small CLI, dev-diagnosis, that answers one question about a repo:&lt;br&gt;
&lt;strong&gt;what is my coding agent reading that it shouldn't be — and what does that&lt;br&gt;
cost in tokens?&lt;/strong&gt; Then I pointed it at 10 of the most-starred JavaScript and&lt;br&gt;
TypeScript repos on GitHub. The results are below. Every number comes from a&lt;br&gt;
real run of the published tool (v0.2.2), not from my head.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx dev-diagnosis-cli all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One command, no install, no config. It walks the repo, flags the files an&lt;br&gt;
agent should not read — build output, lockfiles, logs, oversized files — and&lt;br&gt;
prints a 0–100 score, the noisy files, and the token cost ("Estimated tokens&lt;br&gt;
wasted on this noise", noise bytes ÷ 4, the tool's own label). &lt;code&gt;dev-diagnosis&lt;br&gt;
all --fix&lt;/code&gt; writes the suggested &lt;code&gt;.aiignore&lt;/code&gt; entries and re-scores.&lt;/p&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Repo&lt;/th&gt;
&lt;th&gt;Stars&lt;/th&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Tokens wasted / turn&lt;/th&gt;
&lt;th&gt;Biggest waste&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;nodejs/node&lt;/td&gt;
&lt;td&gt;123,693&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;~24.8M&lt;/td&gt;
&lt;td&gt;11.3 MB ICU data blob + generated OpenSSL asm&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vercel/next.js&lt;/td&gt;
&lt;td&gt;143,505&lt;/td&gt;
&lt;td&gt;91&lt;/td&gt;
&lt;td&gt;~7.4M&lt;/td&gt;
&lt;td&gt;3.4 MB dev-overlay PNG, 2.7 MB GIF, 2.6 MB webpack bundle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;denoland/deno&lt;/td&gt;
&lt;td&gt;108,871&lt;/td&gt;
&lt;td&gt;92&lt;/td&gt;
&lt;td&gt;~6.9M&lt;/td&gt;
&lt;td&gt;One 10.4 MB test fixture (&lt;code&gt;registry.json&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;microsoft/TypeScript&lt;/td&gt;
&lt;td&gt;111,798&lt;/td&gt;
&lt;td&gt;95&lt;/td&gt;
&lt;td&gt;~3.0M&lt;/td&gt;
&lt;td&gt;A 4.0 MB Go test file in a TypeScript repo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;react/react&lt;/td&gt;
&lt;td&gt;252,576&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;td&gt;~2.1M&lt;/td&gt;
&lt;td&gt;46 &lt;code&gt;yarn.lock&lt;/code&gt; files (6.4 MB) + a 1.9 MB test video&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vitejs/vite&lt;/td&gt;
&lt;td&gt;83,906&lt;/td&gt;
&lt;td&gt;93&lt;/td&gt;
&lt;td&gt;~1.3M&lt;/td&gt;
&lt;td&gt;Docs announcement images (1.8 + 1.6 + 1.3 MB)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;vuejs/vue&lt;/td&gt;
&lt;td&gt;212,527&lt;/td&gt;
&lt;td&gt;98&lt;/td&gt;
&lt;td&gt;~59k&lt;/td&gt;
&lt;td&gt;One &lt;code&gt;pnpm-lock.yaml&lt;/code&gt; (9.3% of the repo)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tailwindlabs/tailwindcss&lt;/td&gt;
&lt;td&gt;98,594&lt;/td&gt;
&lt;td&gt;99&lt;/td&gt;
&lt;td&gt;~56k&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;pnpm-lock.yaml&lt;/code&gt; + a 28 KB build dir&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sveltejs/svelte&lt;/td&gt;
&lt;td&gt;88,755&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;~37k&lt;/td&gt;
&lt;td&gt;One &lt;code&gt;pnpm-lock.yaml&lt;/code&gt; — the only noise&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;expressjs/express&lt;/td&gt;
&lt;td&gt;69,679&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Nothing to flag&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Star counts were fetched from the GitHub API on 2026-11-13 (the React repo now lives at react/react).&lt;/p&gt;

&lt;p&gt;Across all ten repos that's &lt;strong&gt;~45.7M tokens wasted per full read&lt;/strong&gt;. Median&lt;br&gt;
score 95.5. And four of the ten (Node, Next.js, Deno, TypeScript) hit the&lt;br&gt;
tool's 10,000-file scan cap, so their numbers are lower bounds — the real&lt;br&gt;
waste is higher.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things I didn't expect
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. The biggest waste is stuff nobody wrote.&lt;/strong&gt; Node's top item is an 11 MB&lt;br&gt;
ICU data file. Deno's is a 10 MB JSON test fixture. TypeScript's is a 4 MB Go&lt;br&gt;
test file. These aren't source code anyone reviews — they're vendored data and&lt;br&gt;
test fixtures. But a naive "read the repo" prompt feeds all of it to the&lt;br&gt;
agent, every turn, at full price.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. React's problem is 46 copies of the same file.&lt;/strong&gt; Nearly every fixture&lt;br&gt;
directory carries its own &lt;code&gt;yarn.lock&lt;/code&gt; — 6.4 MB, 15.7% of the repo's bytes.&lt;br&gt;
The fix is three lines in &lt;code&gt;.aiignore&lt;/code&gt;. I ran it on a copy of the repo to check:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;React&lt;/th&gt;
&lt;th&gt;Before&lt;/th&gt;
&lt;th&gt;After&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Score&lt;/td&gt;
&lt;td&gt;96&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tokens wasted / turn&lt;/td&gt;
&lt;td&gt;~2.1M&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Bytes the agent sees&lt;/td&gt;
&lt;td&gt;40.5 MB&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;32.0 MB&lt;/strong&gt; (−21%)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The waste is structural (monorepo fixtures), the fix is trivial. That's the&lt;br&gt;
whole point of the tool: it finds the three lines worth writing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Small, disciplined repos don't have this problem at all.&lt;/strong&gt; Express scored&lt;br&gt;
100 with zero noise across 216 files. Svelte's entire waste is one lockfile.&lt;br&gt;
This is a scale problem: the bigger and more monorepo-shaped the project, the&lt;br&gt;
more an agent pays for files it will never use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the tool can't do (honest limitations)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The token numbers are estimates, not bills.&lt;/strong&gt; Noise bytes ÷ 4 is a rough
rule of thumb. Real tokenizers differ, minified files tokenize differently,
and your agent may not read the whole repo anyway. Treat the numbers as
comparable across repos, not as exact costs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The scan stops at 10,000 files.&lt;/strong&gt; Node, Next.js, Deno and TypeScript all
hit the cap, so their scores and token counts cover only the first 10,000
files. Their real waste is higher than the table says.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Noise" is the tool's judgement.&lt;/strong&gt; A lockfile is noise when an agent is
writing code; a bundled &lt;code&gt;.d.ts&lt;/code&gt; might be exactly what a human wants to
inspect. The tool flags by size and category — you decide what to exclude.
Nothing is deleted or changed unless you run &lt;code&gt;--fix&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It only measures the repo on disk.&lt;/strong&gt; It doesn't know what your agent
actually read, and it can't diagnose a remote CI run without logs. The
&lt;code&gt;path&lt;/code&gt;, &lt;code&gt;cache&lt;/code&gt; and &lt;code&gt;flakes&lt;/code&gt; checks cover commands, build caches and flaky
tests, but they need their inputs passed in.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx dev-diagnosis-cli all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;GitHub: &lt;a href="https://github.com/WJDdidi-1/dev-doctor" rel="noopener noreferrer"&gt;https://github.com/WJDdidi-1/dev-doctor&lt;/a&gt; —&lt;br&gt;
npm: &lt;a href="https://www.npmjs.com/package/dev-diagnosis-cli" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/dev-diagnosis-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you run it on your own repo, I'd genuinely like to know what it finds —&lt;br&gt;
especially if the numbers look wrong. That's the fastest way to make the tool&lt;br&gt;
better.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>javascript</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
