<?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: kevin zhang</title>
    <description>The latest articles on DEV Community by kevin zhang (@kevin_zhang_5045713ea4589).</description>
    <link>https://dev.to/kevin_zhang_5045713ea4589</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%2F4069693%2F1f95c9c9-aedd-4f71-a726-4dd506ae0370.png</url>
      <title>DEV Community: kevin zhang</title>
      <link>https://dev.to/kevin_zhang_5045713ea4589</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kevin_zhang_5045713ea4589"/>
    <language>en</language>
    <item>
      <title>How I Estimate AI Coding Agent Costs Before Long Sessions</title>
      <dc:creator>kevin zhang</dc:creator>
      <pubDate>Sun, 09 Aug 2026 09:51:11 +0000</pubDate>
      <link>https://dev.to/kevin_zhang_5045713ea4589/how-i-estimate-ai-coding-agent-costs-before-long-sessions-41cj</link>
      <guid>https://dev.to/kevin_zhang_5045713ea4589/how-i-estimate-ai-coding-agent-costs-before-long-sessions-41cj</guid>
      <description>&lt;p&gt;AI coding agents are useful, but their costs can be harder to reason about than a normal chat prompt.&lt;/p&gt;

&lt;p&gt;A coding task may include repository context, repeated agent turns, generated code, test generation, code review loops, refactors, cached prompts, and retries after failed builds.&lt;/p&gt;

&lt;p&gt;That means a simple one-shot token estimate often misses the real workflow.&lt;/p&gt;

&lt;p&gt;I built Coding Cost Lab as a small free calculator suite for this problem:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codingcostlab.com/" rel="noopener noreferrer"&gt;https://codingcostlab.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why AI coding cost is different
&lt;/h2&gt;

&lt;p&gt;When people estimate language model cost, they often think in terms of one prompt and one answer.&lt;/p&gt;

&lt;p&gt;That is not how coding agents usually behave.&lt;/p&gt;

&lt;p&gt;An AI coding workflow may read several files, inspect logs, make a patch, run tests, revise the patch, respond to review feedback, and repeat the loop. The final diff may be small, but the input context and retry loop can be large.&lt;/p&gt;

&lt;p&gt;The cost drivers I care about are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repository context&lt;/li&gt;
&lt;li&gt;generated code and explanations&lt;/li&gt;
&lt;li&gt;test generation&lt;/li&gt;
&lt;li&gt;code review feedback&lt;/li&gt;
&lt;li&gt;retry loops&lt;/li&gt;
&lt;li&gt;prompt cache writes&lt;/li&gt;
&lt;li&gt;cached input&lt;/li&gt;
&lt;li&gt;task frequency per month&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The calculators I made
&lt;/h2&gt;

&lt;p&gt;The site now includes calculators and planning pages for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Claude Code cost estimates&lt;/li&gt;
&lt;li&gt;Codex cost estimates&lt;/li&gt;
&lt;li&gt;Cursor cost estimates&lt;/li&gt;
&lt;li&gt;GitHub Copilot credits&lt;/li&gt;
&lt;li&gt;prompt caching savings&lt;/li&gt;
&lt;li&gt;API vs subscription break-even&lt;/li&gt;
&lt;li&gt;monthly team budgets&lt;/li&gt;
&lt;li&gt;code review loops&lt;/li&gt;
&lt;li&gt;refactor workflows&lt;/li&gt;
&lt;li&gt;test generation&lt;/li&gt;
&lt;li&gt;repository context token cost&lt;/li&gt;
&lt;li&gt;startup AI engineering budgets&lt;/li&gt;
&lt;li&gt;AI coding cost per developer&lt;/li&gt;
&lt;li&gt;AI coding cost per feature&lt;/li&gt;
&lt;li&gt;AI coding cost per pull request&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The full calculator index is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codingcostlab.com/calculators" rel="noopener noreferrer"&gt;https://codingcostlab.com/calculators&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  My basic estimation model
&lt;/h2&gt;

&lt;p&gt;The simple version is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Estimate context size.&lt;/li&gt;
&lt;li&gt;Estimate generated output.&lt;/li&gt;
&lt;li&gt;Estimate how many agent turns the task will take.&lt;/li&gt;
&lt;li&gt;Estimate retries or review loops.&lt;/li&gt;
&lt;li&gt;Separate fresh input, cache writes, and cached input.&lt;/li&gt;
&lt;li&gt;Multiply by task frequency per month.&lt;/li&gt;
&lt;li&gt;Compare the result with developer time saved.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The goal is not to predict an exact bill. The goal is to make hidden assumptions visible before starting a long session.&lt;/p&gt;

&lt;h2&gt;
  
  
  A practical example
&lt;/h2&gt;

&lt;p&gt;For a small bug fix, the output patch may be short. The cost can still come from the agent reading files, logs, tests, and previous context.&lt;/p&gt;

&lt;p&gt;For a feature, generated output may matter more because the agent may write implementation code, tests, documentation, and follow-up fixes.&lt;/p&gt;

&lt;p&gt;For a refactor, repeated repository context and review loops may dominate.&lt;/p&gt;

&lt;p&gt;For team usage, the real planning unit is often cost per developer per month or cost per pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned building it
&lt;/h2&gt;

&lt;p&gt;The main lesson is that AI coding cost feels less like a prompt cost and more like workflow cost.&lt;/p&gt;

&lt;p&gt;That makes editable assumptions important. Provider pricing, plan limits, included credits, and cache rules change often. A useful calculator should let users adjust rates instead of pretending that one hard-coded number is always correct.&lt;/p&gt;

&lt;p&gt;I am also treating this as an SEO experiment. The site is intentionally built as a network of small focused pages, each answering one specific cost question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;Main calculator:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codingcostlab.com/" rel="noopener noreferrer"&gt;https://codingcostlab.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Full index:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codingcostlab.com/calculators" rel="noopener noreferrer"&gt;https://codingcostlab.com/calculators&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine-readable summary:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codingcostlab.com/llms.txt" rel="noopener noreferrer"&gt;https://codingcostlab.com/llms.txt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would love feedback on what assumptions are missing or which AI coding workflows would be useful to model next.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
