<?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: Egor Fedorov</title>
    <description>The latest articles on DEV Community by Egor Fedorov (@egorfedorov).</description>
    <link>https://dev.to/egorfedorov</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3812355%2F21f67be9-4b06-4001-bec7-44e70bd09d4f.png</url>
      <title>DEV Community: Egor Fedorov</title>
      <link>https://dev.to/egorfedorov</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/egorfedorov"/>
    <language>en</language>
    <item>
      <title>We optimize SQL queries, bundle sizes, API calls... but not how we talk to AI. Why?</title>
      <dc:creator>Egor Fedorov</dc:creator>
      <pubDate>Tue, 24 Mar 2026 14:08:12 +0000</pubDate>
      <link>https://dev.to/egorfedorov/we-optimize-sql-queries-bundle-sizes-api-calls-but-not-how-we-talk-to-ai-why-17mn</link>
      <guid>https://dev.to/egorfedorov/we-optimize-sql-queries-bundle-sizes-api-calls-but-not-how-we-talk-to-ai-why-17mn</guid>
      <description>&lt;p&gt;Here's a weird thing I noticed.                                                                                                                                                                                                                &lt;/p&gt;

&lt;p&gt;We spend hours shaving 200ms off a database query. We obsess over tree-shaking to save 12KB in a bundle. We cache API responses, debounce inputs, lazy-load images.&lt;/p&gt;

&lt;p&gt;But when it comes to AI coding tools — the thing that's literally billing us per token — we just... let it rip?                                                                                                                                &lt;/p&gt;

&lt;p&gt;I tracked everything for 107 sessions                                                                                                                                                                                                          &lt;/p&gt;

&lt;p&gt;I built a plugin for Claude Code that silently records every file read, every edit, every search. After 107 sessions, here's what I found:                                                                                                     &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;37% of all tokens went to files that were never edited or meaningfully used
&lt;/li&gt;
&lt;li&gt;Claude re-read page.tsx 189 times across my sessions. 60 of those were pure duplicates&lt;/li&gt;
&lt;li&gt;A single package-lock.json read? 45,000 tokens. Gone.
&lt;/li&gt;
&lt;li&gt;Total waste: ~1.9M tokens. At Opus pricing, that's roughly $28 I lit on fire in two weeks
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And I consider myself a fairly intentional Claude Code user.                                                                                                                                                                                   &lt;/p&gt;

&lt;p&gt;The question I keep going back to                                                                                                                                                                                                              &lt;/p&gt;

&lt;p&gt;Is this even a problem worth solving?                                                                                                                                                                                                          &lt;/p&gt;

&lt;p&gt;On one hand — $60/month in waste adds up. Especially if you're on a team of 10. That's $7,200/year just on files your AI read and forgot.                                                                                                      &lt;/p&gt;

&lt;p&gt;On the other hand — maybe the cognitive overhead of "optimizing" your AI workflow is worse than the waste itself. Maybe we should just let the model read whatever it wants and focus on the actual work.                                      &lt;/p&gt;

&lt;p&gt;I genuinely don't know. I built &lt;a href="https://github.com/egorfedorov/claude-context-optimizer" rel="noopener noreferrer"&gt;https://github.com/egorfedorov/claude-context-optimizer&lt;/a&gt; and I use it daily, but I catch myself wondering: am I solving a real problem or am I just scratching a developer's optimization itch?                 &lt;/p&gt;

&lt;p&gt;What the tool actually does (30-second version)                                                                                                                                                                                                &lt;/p&gt;

&lt;p&gt;It's a Claude Code plugin. Zero config. Runs silently via hooks.                                                                                                                                                                               &lt;/p&gt;

&lt;p&gt;The killer feature: Read Cache — a PreToolUse hook that blocks Claude from re-reading files it already has in context. Same file, same range, no changes on disk? Blocked. Claude adapts and works with what it has.                           &lt;/p&gt;

&lt;p&gt;Already loaded tracker.js this session (983 lines, ~9.3K tokens saved).&lt;br&gt;&lt;br&gt;
  File unchanged — no need to re-read!                                                                                                                                                                                                           &lt;/p&gt;

&lt;p&gt;It also does .contextignore (like .gitignore but for AI), token budgets with auto-compact, session replay, and a heatmap that shows where your tokens actually went.                                                                           &lt;/p&gt;

&lt;p&gt;Result: 30-60% fewer tokens per session from read deduplication alone.                                                                                                                                                                         &lt;/p&gt;

&lt;p&gt;But here's what I actually want to discuss                                                                                                                                                                                                     &lt;/p&gt;

&lt;p&gt;Three questions for the community:                                                                                                                                                                                                             &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Do you track your AI spending at all?&lt;br&gt;&lt;br&gt;
I'm genuinely curious. Do you know how much you spend per session? Per week? Or is it just a monthly credit card charge you don't think about?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is "token efficiency" going to matter in 6 months?&lt;br&gt;&lt;br&gt;
Prices are dropping. Context windows are growing. Maybe optimizing tokens today is like optimizing assembly in the age of high-level languages — technically correct but practically pointless.                                                &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Who should solve this — the user or the model?&lt;br&gt;
Should AI tools be smarter about what they read? Or is it on us to curate context? My plugin takes the "intercept and block" approach, but maybe the right answer is that models should just... stop being wasteful on their own.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The cynical take&lt;/p&gt;

&lt;p&gt;Someone will say: "you built a tool to save $60/month and spent 3 weeks building it." And yeah, fair. The ROI on my time is probably negative.                                                                                                 &lt;/p&gt;

&lt;p&gt;But I've learned more about how AI coding actually works by building this than from any blog post or documentation. Watching the token flow in real-time changes how you think about human-AI collaboration.                                   &lt;/p&gt;

&lt;p&gt;And maybe that's the real value — not the $60, but understanding what's actually happening under the hood.                                                                                                                                     &lt;/p&gt;




&lt;p&gt;&lt;a href="https://github.com/egorfedorov/claude-context-optimizer" rel="noopener noreferrer"&gt;https://github.com/egorfedorov/claude-context-optimizer&lt;/a&gt; | MIT | Zero telemetry | All data local&lt;/p&gt;

&lt;p&gt;Install: npx skills add &lt;a href="https://github.com/egorfedorov/claude-context-optimizer" rel="noopener noreferrer"&gt;https://github.com/egorfedorov/claude-context-optimizer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drop your answers in the comments. Especially #2 — I go back and forth on this daily.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Update: my Claude Code token optimizer now blocks redundant reads. Here's the data from 107 sessions.</title>
      <dc:creator>Egor Fedorov</dc:creator>
      <pubDate>Tue, 24 Mar 2026 10:09:41 +0000</pubDate>
      <link>https://dev.to/egorfedorov/update-my-claude-code-token-optimizer-now-blocks-redundant-reads-heres-the-data-from-107-27lj</link>
      <guid>https://dev.to/egorfedorov/update-my-claude-code-token-optimizer-now-blocks-redundant-reads-heres-the-data-from-107-27lj</guid>
      <description>&lt;p&gt;Two weeks ago I posted &lt;a href="https://dev.to/egorfedorov/i-tracked-where-my-claude-code-tokens-actually-go-37-were-wasted-2gll"&gt;I tracked where my Claude Code tokens actually go. 37% were wasted.&lt;/a&gt; — a plugin that tracks where your tokens go and shows you the waste.&lt;/p&gt;

&lt;p&gt;34 reactions. Great feedback. But one comment stuck with me:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The real unlock for me was getting a live counter visible all session instead of only doing post-mortems, because it changes behavior in the moment before waste happens." — @henrygodnick&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;He was right. Tracking is nice. &lt;strong&gt;Preventing&lt;/strong&gt; is better.&lt;/p&gt;

&lt;p&gt;So I built v3.1 — and the plugin now actively blocks wasted reads instead of just reporting them.&lt;/p&gt;

&lt;h2&gt;
  
  
  The big one: Smart Read Cache
&lt;/h2&gt;

&lt;p&gt;The #1 waste pattern I found in 107 sessions: &lt;strong&gt;Claude re-reads the same file multiple times.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;page.tsx&lt;/code&gt; — read &lt;strong&gt;189 times&lt;/strong&gt; across my sessions. 60 of those were pure duplicates. That's 130K tokens burned on a file Claude already had.&lt;/p&gt;

&lt;p&gt;So I added a &lt;code&gt;PreToolUse&lt;/code&gt; hook that intercepts every &lt;code&gt;Read&lt;/code&gt; call:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// First read? Always allow.&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;allow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// File changed on disk? Allow.&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentMtime&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mtime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;allow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Different section? Allow.&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isRangeCovered&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ranges&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;allow&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Same file, same range, unchanged. Block it.&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;decision&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;block&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;reason&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Already loaded — file unchanged.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When it blocks, Claude sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Already loaded tracker.js this session (983 lines, ~9.3K tokens).
File unchanged. Use offset/limit to read a specific section, or Edit to modify it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Claude &lt;strong&gt;adapts&lt;/strong&gt; — it stops trying to re-read and works with what it has.&lt;/p&gt;

&lt;h3&gt;
  
  
  It's not dumb about it
&lt;/h3&gt;

&lt;p&gt;Three edge cases that matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Compaction&lt;/strong&gt; — Claude actually lost the context. Cache clears. Re-reads allowed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edit/Write&lt;/strong&gt; — file content changed. That file's cache invalidates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partial reads&lt;/strong&gt; — tracks offset/limit ranges. Only blocks if the exact range was already covered.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Real numbers: 107 sessions analyzed
&lt;/h2&gt;

&lt;p&gt;I ran a retroactive analysis on all my existing sessions — what would Read Cache have saved?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Sessions analyzed:              107
Total tokens tracked:           23.5M
Redundant reads found:          1,225
Tokens that would have been saved: 1.9M (8.0%)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Top sessions by savings:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Session&lt;/th&gt;
&lt;th&gt;Saved&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;th&gt;%&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Football Slot&lt;/td&gt;
&lt;td&gt;247K&lt;/td&gt;
&lt;td&gt;362K&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;68%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;claude-context-optimizer&lt;/td&gt;
&lt;td&gt;62K&lt;/td&gt;
&lt;td&gt;210K&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;29%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Engine3.0&lt;/td&gt;
&lt;td&gt;63K&lt;/td&gt;
&lt;td&gt;329K&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;19%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DJ Beat Drop&lt;/td&gt;
&lt;td&gt;39K&lt;/td&gt;
&lt;td&gt;276K&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;14%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Top re-read offenders:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Total reads&lt;/th&gt;
&lt;th&gt;Blocked&lt;/th&gt;
&lt;th&gt;Tokens saved&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;page.tsx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;189&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;130.9K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GameInfoModal.svelte&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;23&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;56.8K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;variables.css&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;34&lt;/td&gt;
&lt;td&gt;26&lt;/td&gt;
&lt;td&gt;49.2K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;client.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;46&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;td&gt;48.8K&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;types.ts&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;41.6K&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That's &lt;strong&gt;1.9M tokens&lt;/strong&gt; I would have saved. At $15/M on Opus — roughly &lt;strong&gt;$28.50&lt;/strong&gt; over two weeks, or ~$60/month.&lt;/p&gt;

&lt;h2&gt;
  
  
  What else is new in v3.1
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project Anatomy&lt;/strong&gt; (&lt;code&gt;/cco-anatomy&lt;/code&gt;) — generates a one-file codebase map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project Anatomy: my-app&lt;/span&gt;
Generated: 2026-03-24 | 31 files | ~46K tokens if all read

| Path | Lines | ~Tokens | Type |
|------|-------|---------|------|
| src/tracker.js | 984 | 9.1K | source |
| src/export.js | 398 | 3.7K | source |
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude reads this instead of opening 20 files to understand your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;45 unit tests&lt;/strong&gt; — the plugin is now properly tested. &lt;code&gt;npm test&lt;/code&gt; runs in under 60ms.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest README&lt;/strong&gt; — I renamed "Interactive Dashboard" to "HTML Dashboard Export" because that's what it actually is. No more marketing fluff.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install / update
&lt;/h2&gt;

&lt;p&gt;First time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add https://github.com/egorfedorov/claude-context-optimizer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Already have it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude plugin update claude-context-optimizer@egorfedorov-plugins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero config. Zero telemetry. All data stays local.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://github.com/egorfedorov/claude-context-optimizer" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; — MIT licensed.&lt;/p&gt;

&lt;p&gt;The v2 post got 34 reactions. Let's see if blocking redundant reads is worth a star.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>I tracked where my Claude Code tokens actually go. 37% were wasted.</title>
      <dc:creator>Egor Fedorov</dc:creator>
      <pubDate>Mon, 09 Mar 2026 06:34:30 +0000</pubDate>
      <link>https://dev.to/egorfedorov/i-tracked-where-my-claude-code-tokens-actually-go-37-were-wasted-2gll</link>
      <guid>https://dev.to/egorfedorov/i-tracked-where-my-claude-code-tokens-actually-go-37-were-wasted-2gll</guid>
      <description>&lt;p&gt;Last month I hit $180 on my Claude Code bill. I use Opus daily — refactoring, bug fixes, code reviews, building features. But something felt off. Sessions were getting expensive, and I couldn't tell &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;So I did what any developer would do: I built a tool to find out.&lt;/p&gt;

&lt;p&gt;## The experiment&lt;/p&gt;

&lt;p&gt;I started manually logging which files Claude reads during a typical session. After a week of tracking, the pattern was clear:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Out of every 10 files Claude reads, only 6-7 actually matter.&lt;/strong&gt; The rest — configs, READMEs, lock files, type definitions — get loaded into context and never referenced again.&lt;/p&gt;

&lt;p&gt;Quick math:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;package.json&lt;/code&gt; read "just in case" → 120 tokens, every time&lt;/li&gt;
&lt;li&gt;A README for context → 2,400 tokens, used once, forgotten&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tsconfig.json&lt;/code&gt; → 400 tokens, never needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At ~$15/M tokens on Opus, &lt;strong&gt;30-50% of my bill was going to irrelevant context.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;## The plugin&lt;/p&gt;

&lt;p&gt;I built &lt;strong&gt;claude-context-optimizer&lt;/strong&gt; — a Claude Code plugin that silently tracks every file read, edit, and search. No configuration. No setup. Just install and forget.&lt;/p&gt;

&lt;p&gt;It hooks into Claude Code's tool pipeline (PostToolUse, SessionStart, SessionEnd) and records:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which files were read and how many times&lt;/li&gt;
&lt;li&gt;Which files were actually edited (high value)&lt;/li&gt;
&lt;li&gt;Which files were read once and never used (waste)&lt;/li&gt;
&lt;li&gt;Estimated token count per file (~4 tokens/line)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;## Context Heatmap&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;/cco&lt;/code&gt; and see exactly where your tokens went:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibciufzcwiwmcxp9rpn8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibciufzcwiwmcxp9rpn8.png" alt="Context Heatmap" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Green bars = files that were actually edited or referenced multiple times. Red bars = read once, never used. That README.md eating 2,400 tokens? Pure waste.&lt;/p&gt;

&lt;p&gt;## Efficiency Score&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;/context-digest&lt;/code&gt; for a weekly report card:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03os0dihh0739cekoylc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03os0dihh0739cekoylc.png" alt="Efficiency Score" width="800" height="365"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You get a grade (S through F) based on four metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Context Precision&lt;/strong&gt; — how many files you read were actually useful&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edit Efficiency&lt;/strong&gt; — ratio of edits to reads&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search Accuracy&lt;/strong&gt; — are your Grep/Glob searches finding the right files?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Focus Score&lt;/strong&gt; — are you re-reading files too often?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Plus real cost breakdowns: total spent, wasted, and saveable per month.&lt;/p&gt;

&lt;p&gt;## Token ROI Report&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/cco-report&lt;/code&gt; gives you the full picture across all tracked sessions:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3hqs1vvt3uhk7v633pef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3hqs1vvt3uhk7v633pef.png" alt="Token ROI Report" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Trends over time, top wasted files, top useful files, and specific recommendations.&lt;/p&gt;

&lt;p&gt;## How it works under the hood&lt;/p&gt;

&lt;p&gt;The architecture is simple — no build step, no dependencies, just Node.js scripts:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhm0tnl12v3wbomalsfv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhm0tnl12v3wbomalsfv.png" alt="How it works" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every session gets a JSON file tracking per-file reads, edits, and usefulness. When a session ends, the plugin updates a global patterns database that learns which files are &lt;em&gt;consistently&lt;/em&gt; useful or wasted across sessions.&lt;/p&gt;

&lt;p&gt;## The features I didn't expect to need&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token Budget&lt;/strong&gt; — &lt;code&gt;/cco-budget set 80000&lt;/code&gt; sets a token limit with real-time warnings at 50/70/85/95%. Knowing you're at 70% makes you think twice before reading another file "just in case."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Git-Aware Suggestions&lt;/strong&gt; — &lt;code&gt;/cco-git&lt;/code&gt; analyzes your current diff and suggests files you'll actually need. Combined with historical patterns, it knows that when you touch &lt;code&gt;auth-service.ts&lt;/code&gt;, you almost always need &lt;code&gt;user.model.ts&lt;/code&gt; too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Context Templates&lt;/strong&gt; — &lt;code&gt;/cco-templates create bug-fix&lt;/code&gt; saves a set of files you always need. Next time, &lt;code&gt;/cco-templates apply bug-fix&lt;/code&gt; loads exactly the right context.&lt;/p&gt;

&lt;p&gt;## Results after 2 weeks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Waste ratio dropped from ~40% to ~15%&lt;/li&gt;
&lt;li&gt;Average session cost decreased by roughly 25%&lt;/li&gt;
&lt;li&gt;Sessions feel faster — less context means faster responses&lt;/li&gt;
&lt;li&gt;I stopped reading README.md and package.json reflexively&lt;/li&gt;
&lt;li&gt;Created 3 templates that save ~5 minutes of setup per session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;## The meta part&lt;/p&gt;

&lt;p&gt;The entire plugin — 2,500+ lines of code, 8 slash commands, SVG visualizations, README — was built in a single Claude Code session using Opus. Claude built the tool that optimizes Claude. Make of that what you will.&lt;/p&gt;

&lt;p&gt;## Try it&lt;/p&gt;

&lt;p&gt;Install in one command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git clone https://github.com/egorfedorov/claude-context-optimizer.git ~/.claude/plugins/claude-context-optimizer&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;No npm install, no build, no config. MIT license. Zero telemetry — everything stays local.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/egorfedorov/claude-context-optimizer" rel="noopener noreferrer"&gt;egorfedorov/claude-context-optimizer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stars and PRs welcome.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What's your Claude Code bill looking like? I'm curious if others have noticed the same waste patterns.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I Built a Desktop Tamagotchi Cat with AI Brain in Swift - and It Lives on My macOS Doc</title>
      <dc:creator>Egor Fedorov</dc:creator>
      <pubDate>Sun, 08 Mar 2026 03:05:15 +0000</pubDate>
      <link>https://dev.to/egorfedorov/i-built-a-desktop-tamagotchi-cat-with-ai-brain-in-swift-and-it-lives-on-my-macos-doc-4e94</link>
      <guid>https://dev.to/egorfedorov/i-built-a-desktop-tamagotchi-cat-with-ai-brain-in-swift-and-it-lives-on-my-macos-doc-4e94</guid>
      <description>&lt;p&gt;You know that feeling when you're coding at 2 AM and wish someone was there with you?&lt;/p&gt;

&lt;p&gt;Meet &lt;strong&gt;Murchi&lt;/strong&gt; — a kawaii desktop cat that lives on your macOS dock, walks around your screen, reacts to your music, and now can actually &lt;em&gt;talk&lt;/em&gt; to you powered by Gemini AI.&lt;/p&gt;

&lt;p&gt;## What is this?&lt;/p&gt;

&lt;p&gt;Murchi is a desktop Tamagotchi for macOS. A tiny animated cat that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🐾 Walks on your Dock like it's a shelf&lt;/li&gt;
&lt;li&gt;🎵 Detects Apple Music / Spotify and dances (or hates your music 25% of the time)&lt;/li&gt;
&lt;li&gt;😿 Goes to the corner and cries if you punish it&lt;/li&gt;
&lt;li&gt;🖱️  Dangles from the scruff when you drag it&lt;/li&gt;
&lt;li&gt;💬 &lt;strong&gt;Chats with you via Gemini AI&lt;/strong&gt; — in character, as a cat&lt;/li&gt;
&lt;li&gt;🐟 Needs feeding, bathing, playing — classic Tamagotchi loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It sits in your menu bar as &lt;code&gt;=^.^=&lt;/code&gt; and just... lives there.&lt;/p&gt;

&lt;p&gt;The Tech Stack (it's cursed and I love it)&lt;/p&gt;

&lt;p&gt;The entire app is &lt;strong&gt;one Swift file&lt;/strong&gt;. 7000+ lines. No Xcode project. No storyboards. No SwiftUI.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Pure &lt;strong&gt;AppKit&lt;/strong&gt; — &lt;code&gt;NSPanel&lt;/code&gt;, &lt;code&gt;NSImageView&lt;/code&gt;, raw &lt;code&gt;CGContext&lt;/code&gt; drawing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SVG strings rendered to NSImage&lt;/strong&gt; — every animation frame is an SVG built in code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No sprites, no assets&lt;/strong&gt; — the cat is literally constructed from bezier paths and hex colors&lt;/li&gt;
&lt;li&gt;Gravity physics, dock detection via &lt;code&gt;CGWindowListCopyWindowInfo&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Music detection via &lt;strong&gt;AppleScript&lt;/strong&gt; (&lt;code&gt;tell application "Spotify" to player state&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;AI chat via &lt;strong&gt;Gemini 2.0 Flash&lt;/strong&gt; REST API with &lt;code&gt;URLSession&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Built and packaged with a 100-line &lt;code&gt;build-app.sh&lt;/code&gt; — no Xcode needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The AI Part&lt;/p&gt;

&lt;p&gt;The cat has personality. When you chat with it, Gemini knows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cat's name, level, and evolution stage&lt;/li&gt;
&lt;li&gt;Current mood, hunger, happiness stats&lt;/li&gt;
&lt;li&gt;It responds in 1-3 sentences with cat sounds ("mrrrow~!", "purrr")
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;  &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;systemPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"""
  You are Murchi, an adorable kawaii desktop cat.
  Your personality: playful, cute, a bit mischievous.
  Keep responses SHORT. Use cat sounds like "&lt;/span&gt;&lt;span class="n"&gt;mrrrow&lt;/span&gt;&lt;span class="s"&gt;", "&lt;/span&gt;&lt;span class="n"&gt;mew&lt;/span&gt;&lt;span class="s"&gt;".
  Current mood: &lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mood&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt;. Hunger: &lt;/span&gt;&lt;span class="se"&gt;\(&lt;/span&gt;&lt;span class="kt"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;stats&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hunger&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="s"&gt;%.
  """&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Users can plug in their own Gemini API key in settings, or it works out of the box.&lt;/p&gt;

&lt;p&gt;The Entire Thing Was Built with Claude Code&lt;/p&gt;

&lt;p&gt;I'm not going to pretend — this project was built almost entirely in conversation with Claude Code (Anthropic's CLI agent). I described what I wanted, it wrote the code, I tested, gave feedback, it fixed.&lt;/p&gt;

&lt;p&gt;The workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Me: "I want a cat that walks on the dock"&lt;/li&gt;
&lt;li&gt;Claude: writes 2000 lines of SVG renderer&lt;/li&gt;
&lt;li&gt;Me: "the cat is orange, it should be peach"&lt;/li&gt;
&lt;li&gt;Claude: rewrites entire renderer&lt;/li&gt;
&lt;li&gt;Me: "now make it talk with AI"&lt;/li&gt;
&lt;li&gt;Claude: adds Gemini integration in 15 minutes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Every commit in the repo is co-authored with Claude. This is what AI-assisted development actually looks like — not replacing the developer, but making ambitious side projects actually possible on a weekend.&lt;/p&gt;

&lt;p&gt;Try It&lt;/p&gt;

&lt;p&gt;It's free, open source, and works on any Mac (macOS 12+):&lt;/p&gt;

&lt;p&gt;⬇️ &lt;a href="https://github.com/egorfedorov/murchi/releases/latest" rel="noopener noreferrer"&gt;https://github.com/egorfedorov/murchi/releases/latest&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🐙 &lt;a href="https://github.com/egorfedorov/murchi" rel="noopener noreferrer"&gt;https://github.com/egorfedorov/murchi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⬇️ &lt;a href="https://murchi.pet" rel="noopener noreferrer"&gt;https://murchi.pet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No Xcode needed to build — just bash build-app.sh.&lt;/p&gt;




&lt;p&gt;If you've ever wanted a pet on your desktop that judges your music taste and occasionally poops on your screen — this is it.&lt;/p&gt;

&lt;p&gt;mrrrow~! 🐱&lt;/p&gt;

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