<?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: hacksicilian</title>
    <description>The latest articles on DEV Community by hacksicilian (@hacksicilian).</description>
    <link>https://dev.to/hacksicilian</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%2F4200938%2F9b2823d6-182f-4ec4-b0f1-86680bb869e1.jpg</url>
      <title>DEV Community: hacksicilian</title>
      <link>https://dev.to/hacksicilian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hacksicilian"/>
    <language>en</language>
    <item>
      <title>I measured one AI agent session token by token. 5 of 20 turns ate 94% of the cost.</title>
      <dc:creator>hacksicilian</dc:creator>
      <pubDate>Thu, 22 Oct 2026 22:17:44 +0000</pubDate>
      <link>https://dev.to/hacksicilian/i-measured-one-ai-agent-session-token-by-token-5-of-20-turns-ate-94-of-the-cost-31li</link>
      <guid>https://dev.to/hacksicilian/i-measured-one-ai-agent-session-token-by-token-5-of-20-turns-ate-94-of-the-cost-31li</guid>
      <description>&lt;p&gt;Everyone talks about what AI agents can do. Almost nobody measures what they actually cost.&lt;/p&gt;

&lt;p&gt;I run a small fleet of agents. Last week I pointed a simple guard at one session's transcript and read the usage per turn - not estimated, measured. In a single 20-turn session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Effective (weighted) cost: ~934k tokens. (weighting: cache read 0.1x, cache write 2x, output 5x, input 1x)&lt;/li&gt;
&lt;li&gt;The floor per turn was 146k tokens - what you pay before anyone types anything. That's tools and plugins loaded every turn.&lt;/li&gt;
&lt;li&gt;5 of the 20 turns (25%) accounted for 94% of all cache-write cost.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The expensive turns weren't the hard ones. They lined up with the tool list changing - an MCP server disconnecting and reconnecting invalidated the cached prefix, so the whole context got rewritten, and a write costs 2x a read.&lt;/p&gt;

&lt;p&gt;Three takeaways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your per-turn floor is probably huge. Disconnect tools and plugins you're not using - you pay for them every single turn.&lt;/li&gt;
&lt;li&gt;The cost isn't repeating context, it's losing and rewriting it. Stabilizing your tool list beats shortening prompts.&lt;/li&gt;
&lt;li&gt;A "green" you didn't measure isn't green. Measure by effect, on the real run.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Caveat: this is one session, on one setup. Don't generalize my numbers - measure your own. The point is the bill hides this and the transcript doesn't.&lt;/p&gt;

&lt;p&gt;I packaged the doctrine, the lane templates, and the consumption guard (a small Python script that reads any session's transcript and prints this breakdown) into a kit: &lt;a href="https://spataro1.gumroad.com/l/ghjrgi" rel="noopener noreferrer"&gt;https://spataro1.gumroad.com/l/ghjrgi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How are you measuring your agents' cost? Curious what others are seeing.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>llm</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
