<?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: Alejandro Cavagna</title>
    <description>The latest articles on DEV Community by Alejandro Cavagna (@acs195).</description>
    <link>https://dev.to/acs195</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%2F4272522%2F56cf9d36-8df2-470e-8050-b4799579a0a1.png</url>
      <title>DEV Community: Alejandro Cavagna</title>
      <link>https://dev.to/acs195</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/acs195"/>
    <language>en</language>
    <item>
      <title>How I track what my coding agents actually cost</title>
      <dc:creator>Alejandro Cavagna</dc:creator>
      <pubDate>Sun, 29 Nov 2026 15:15:29 +0000</pubDate>
      <link>https://dev.to/acs195/how-i-track-what-my-coding-agents-actually-cost-2102</link>
      <guid>https://dev.to/acs195/how-i-track-what-my-coding-agents-actually-cost-2102</guid>
      <description>&lt;h1&gt;
  
  
  How I track what my coding agents actually cost
&lt;/h1&gt;

&lt;p&gt;For the last few months I've been using Pi and Claude Code for real work. The speed is great. The problem is that after a week I had two questions I couldn't answer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Is this actually done?&lt;/strong&gt; An agent would say "fixed" and the next day I'd find a skipped test or a broken type check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What did this feature cost?&lt;/strong&gt; Five sessions spread across Pi and Claude Code, and I had no idea if the total was $2 or $20.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I built &lt;a href="https://github.com/acs195/agent-kit" rel="noopener noreferrer"&gt;agent-kit&lt;/a&gt;, a small, provider-agnostic setup that solves both.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu5yb67ybd0zcgo7ky4xf.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu5yb67ybd0zcgo7ky4xf.png" alt="agent-kit overview" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The two ideas
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. One command decides "done"
&lt;/h3&gt;

&lt;p&gt;Every project gets an &lt;code&gt;AGENTS.md&lt;/code&gt; with the development cycle, definition of done, stop-and-ask list, and hand-off format. Then there is one verification script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scripts/verify
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent runs it after every change. A pre-push hook runs it before every push. CI runs the same thing.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frqiunettzjbg5ftghpnb.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frqiunettzjbg5ftghpnb.png" alt="scripts/verify passing" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No more "I think it's done". It's done when &lt;code&gt;scripts/verify&lt;/code&gt; says &lt;code&gt;PASS&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. One ledger tracks cost across agents
&lt;/h3&gt;

&lt;p&gt;A Pi extension and a Claude Code hook write to the same ledger file, &lt;code&gt;~/.agent-kit/ledger.jsonl&lt;/code&gt;. Each line is a delta of spend since the last write, tagged with project, branch, and a cost bucket (usually a ticket id).&lt;/p&gt;

&lt;p&gt;Then you can ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;agent-cost --projects
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ye5w3af7mu0yuvnw2o6.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ye5w3af7mu0yuvnw2o6.png" alt="agent-cost --projects" width="799" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Or see what a single ticket cost across multiple sessions and tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;agent-cost --bucket PROJ-123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7863f29gl9tbqptk89qc.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7863f29gl9tbqptk89qc.png" alt="agent-cost --bucket" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it this way
&lt;/h2&gt;

&lt;p&gt;I didn't want another dashboard. I wanted something that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Works in any directory, with or without a project.&lt;/li&gt;
&lt;li&gt;Doesn't force a specific agent. Pi and Claude Code are supported today; Codex can follow the same &lt;code&gt;AGENTS.md&lt;/code&gt; rules.&lt;/li&gt;
&lt;li&gt;Keeps the gate simple: one script, not a CI pipeline nobody runs locally.&lt;/li&gt;
&lt;li&gt;Stores data locally by default, in plain JSONL.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Quick start
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/acs195/agent-kit.git
&lt;span class="nb"&gt;cd&lt;/span&gt; agent-kit
./install.sh --user
./install.sh /path/to/your/project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then fill in the Project section of &lt;code&gt;AGENTS.md&lt;/code&gt;, set the &lt;code&gt;STEPS&lt;/code&gt; in &lt;code&gt;scripts/verify&lt;/code&gt;, and run it until it passes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's included
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt; / &lt;code&gt;CLAUDE.md&lt;/code&gt; templates&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scripts/verify&lt;/code&gt; + &lt;code&gt;scripts/lib/verify-runner.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.githooks/pre-push&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Pi extension with cost bucket picker&lt;/li&gt;
&lt;li&gt;Claude Code ledger hooks&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;agent-cost&lt;/code&gt; report&lt;/li&gt;
&lt;li&gt;TypeScript preset and example project&lt;/li&gt;
&lt;li&gt;GitLab and GitHub CI templates&lt;/li&gt;
&lt;li&gt;36 tests&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it or tear it apart
&lt;/h2&gt;

&lt;p&gt;The repo is open source under MIT:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/acs195/agent-kit" rel="noopener noreferrer"&gt;https://github.com/acs195/agent-kit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd especially love feedback on the &lt;code&gt;AGENTS.md&lt;/code&gt; format and what other presets would be useful (Python is next on my list).&lt;/p&gt;

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