<?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: Andrii Tretiak | Swarmery</title>
    <description>The latest articles on DEV Community by Andrii Tretiak | Swarmery (@swarmery).</description>
    <link>https://dev.to/swarmery</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%2F4165552%2F40f6cd18-0aee-4efd-a82c-b6ef636d8457.png</url>
      <title>DEV Community: Andrii Tretiak | Swarmery</title>
      <link>https://dev.to/swarmery</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/swarmery"/>
    <language>en</language>
    <item>
      <title>You Can Stop Reading the Code. You Can't Stop Knowing What It Should Do</title>
      <dc:creator>Andrii Tretiak | Swarmery</dc:creator>
      <pubDate>Wed, 11 Nov 2026 19:40:09 +0000</pubDate>
      <link>https://dev.to/swarmery/you-can-stop-reading-the-code-you-cant-stop-knowing-what-it-should-do-4njm</link>
      <guid>https://dev.to/swarmery/you-can-stop-reading-the-code-you-cant-stop-knowing-what-it-should-do-4njm</guid>
      <description>&lt;p&gt;&lt;em&gt;A lot of people write that developers using AI no longer understand their own code. I barely read code myself, so here is what I have in place of reading it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For the last few weeks I keep running into articles about the same thing. Developers with AI write code much faster, but they no longer understand what they ship.&lt;/p&gt;

&lt;p&gt;There is even a name for it: &lt;strong&gt;comprehension debt&lt;/strong&gt;. In simple words, it is the gap between how much code there is in a system and how much of it any person actually understands.&lt;/p&gt;

&lt;p&gt;The worst part about this debt is that you can't see it. The tests are green, the code looks clean, and nobody can explain anymore why it works the way it does.&lt;/p&gt;

&lt;p&gt;So, have I lost control too?&lt;/p&gt;

&lt;p&gt;I have to be honest about one thing. For more than a year I've barely read the code my agents write. So on paper, I'm exactly the person these articles are about.&lt;/p&gt;

&lt;p&gt;I thought about it for a while and came to the conclusion that no, I haven't. Not because I'm special, but because over these two years a system slowly grew around my agents, and it does what reading code used to do.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The real question is not whether you read the code. It's whether someone in the system knows what that code is supposed to do.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That system is what this post is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  We have been here before
&lt;/h2&gt;

&lt;p&gt;In the early 1950s almost all programs were written in machine code or assembler. When Fortran appeared, people met it with a lot of distrust.&lt;/p&gt;

&lt;p&gt;John Backus, who created it, later remembered that programmers back then saw their work as an art that could not be automated.&lt;/p&gt;

&lt;p&gt;The arguments against it sound very familiar today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the code a compiler generates is worse than code written by hand&lt;/li&gt;
&lt;li&gt;you don't understand what it actually does&lt;/li&gt;
&lt;li&gt;so you won't be able to debug it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the end a simple thing won. Programmers stopped thinking about registers and memory addresses and started thinking about the problem itself.&lt;/p&gt;

&lt;p&gt;I think the same thing is happening now, just one level higher. Instead of functions and classes, I think about how payment should work, who is allowed to see what, and what happens if a client changes their mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  But an agent is not a compiler
&lt;/h2&gt;

&lt;p&gt;There is one important difference, and this is where the analogy breaks.&lt;/p&gt;

&lt;p&gt;A compiler always turns the same code into the same result. Once it matures, you can simply trust it.&lt;/p&gt;

&lt;p&gt;An agent doesn't work like that. It can do one thing today and another tomorrow. It fills gaps in the task with guesses, and sometimes it even bends a test to fit its code so the test goes green.&lt;/p&gt;

&lt;p&gt;If a person no longer reads the code, someone else has to do what reading used to do. And that someone can't be the same agent that wrote it.&lt;/p&gt;

&lt;p&gt;Here is what that someone looks like in my setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Write down the intent before the code
&lt;/h2&gt;

&lt;p&gt;The first thing is to write down what should be built before a single line of code exists.&lt;/p&gt;

&lt;p&gt;Why does it matter so much? The reason is simple. Understanding of a system used to live in the head of the developer who wrote it. Now the code is written by an agent that remembers nothing after its session ends.&lt;/p&gt;

&lt;p&gt;If the intent isn't written down anywhere, in a month nobody will tell you why payment works the way it does. That's no longer a code problem, it's a memory problem for the whole team.&lt;/p&gt;

&lt;h3&gt;
  
  
  Planning starts with an interview
&lt;/h3&gt;

&lt;p&gt;Every bigger task starts with an interview. A planner asks me questions one by one until nothing is left to guess.&lt;/p&gt;

&lt;p&gt;What comes out of it is a plan split into phases. For every phase it says not only what to do, but also how to tell it was done right.&lt;/p&gt;

&lt;p&gt;The tests are then written from these descriptions, from what the client does, and not from what the agent wrote. If a test is written after the code by the same agent, it will just confirm what the agent already believed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finished plans don't disappear
&lt;/h3&gt;

&lt;p&gt;This is the part people rarely talk about. Every finished plan goes into an archive: the plan, its phases and the reports on how they were done.&lt;/p&gt;

&lt;p&gt;When months later I need to understand why something was built a certain way, I don't dig into the code. I open the plan and see how the thinking went, what the options were and what was decided.&lt;/p&gt;

&lt;p&gt;Understanding of the system now lives not in someone's head and not in the code, but in these records.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Separate who writes from who checks
&lt;/h2&gt;

&lt;p&gt;The second solution grew out of a simple observation: an agent can't properly check itself.&lt;/p&gt;

&lt;p&gt;Not because it lies. It checks with the same blind spots it had while writing the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Auditors came first
&lt;/h3&gt;

&lt;p&gt;Funny enough, in my case this happened almost by itself, because auditors appeared before agents that write code.&lt;/p&gt;

&lt;p&gt;At first I wrote everything by hand and asked AI to review it and point out weak spots. Then I started letting agents apply those suggestions. First small fixes, then whole features, and now I delegate parts of the business logic.&lt;/p&gt;

&lt;p&gt;But the auditors always stayed separate from the ones who write.&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%2Fy6hjg79dyoqjbgs7h4ip.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%2Fy6hjg79dyoqjbgs7h4ip.png" alt="How my trust in agents grew" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;My trust grew step by step, and the auditors came first, not the agents that write code.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How it works now
&lt;/h3&gt;

&lt;p&gt;When an agent finishes its part, the work is checked by a separate agent that can't change anything, it can only read. It doesn't see the writer's reasoning, only the code changes and the plan.&lt;/p&gt;

&lt;p&gt;It checks not only whether the code works, but whether it does what the plan says.&lt;/p&gt;

&lt;p&gt;If something is wrong, the system creates a fix task by itself. But not forever: after three attempts it stops and waits for me. If it didn't work three times, the problem is most likely not in the code, but in the task.&lt;/p&gt;

&lt;p&gt;On top of that there is a security auditor that looks for typical holes and thinks about how this specific product could be broken. And an agent that simply runs the build, the linter and the tests and honestly reports what ran and what it said.&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%2Fmuokqcyib3j9dmqd54my.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%2Fmuokqcyib3j9dmqd54my.png" alt="A task's path: who writes and who checks" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The one who writes the code and the one who checks it are always different agents.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The numbers surprised me a bit. Over the last 30 days the agents that check ran almost as often as the agents that write, and checking cost about five times less.&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%2Fhnrgns985yhvm2i5ny7v.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%2Fhnrgns985yhvm2i5ny7v.png" alt="Who does the work: runs and cost over 30 days" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Agent runs across all my projects over the last 30 days, data from Swarmery. Cost is approximate, estimated from tokens.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  "Don't know" is a separate answer
&lt;/h3&gt;

&lt;p&gt;One more detail I didn't get right away. If a check couldn't give an answer, for example it timed out or couldn't read the changes, that is neither a fail nor a pass. It's a separate state: "don't know".&lt;/p&gt;

&lt;p&gt;I used to have "done", "not checked" and "the process just died" all showing the same green badge, and I was lying to myself a bit. When I split them, the dashboard got uglier, but honest.&lt;/p&gt;

&lt;p&gt;One thing in the data I didn't expect: in 8 cases out of 100 reviews the checker, which is only allowed to read, changed files anyway. The system caught it and didn't accept that verdict.&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%2Famedfupi49mqaimsvz5w.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%2Famedfupi49mqaimsvz5w.png" alt="What the separate checker says" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Verdicts of the separate checker: 100 reviews of phases and plans, Oct 10 to Nov 4.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you don't look at the code yourself anymore, an honest "don't know" is worth more than a pretty green badge.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  3. Check the product, not only the code
&lt;/h2&gt;

&lt;p&gt;For me this is probably the most important one. Tests have one problem: they only check what they were asked to check.&lt;/p&gt;

&lt;p&gt;In one of my earlier runs, the agents marked five phases as done, and the separate checker found serious problems in three of them. All the tests were green. Nobody lied, the problems were just exactly where the tests didn't look.&lt;/p&gt;

&lt;p&gt;And most often they don't look at the business logic: what happens when several people with different permissions use the product at the same time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agents as manual testers
&lt;/h3&gt;

&lt;p&gt;So I have manual testing done by agents. Let me show it on one of my projects, a platform where clients bid on cars from auctions and an operator places those bids on the real auction.&lt;/p&gt;

&lt;p&gt;There is a scenario for it that covers the whole path, from a client signing up to the invoice and delivery. Before a run, the system creates test people: an admin and three clients.&lt;/p&gt;

&lt;p&gt;The agents log in as each of them and go through the steps in a browser, like a real tester. Then they check the database and the logs to see whether what should have happened actually happened.&lt;/p&gt;

&lt;p&gt;They never touch real lots, the system makes copies just for the test. The real Telegram bot, email and payments are switched off during the run.&lt;/p&gt;

&lt;h3&gt;
  
  
  The rules for the tester matter more than the run
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The tester doesn't fix bugs. It only finds and describes them, because the one who fixes shouldn't be the one who checks.&lt;/li&gt;
&lt;li&gt;It doesn't stop at the first failure. It records it and moves on.&lt;/li&gt;
&lt;li&gt;No step can be skipped silently. Every step must have a status.&lt;/li&gt;
&lt;li&gt;Every failure needs proof. And a plain script checks that the proof exists, not another model.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end I get a report with the status of every step and a list of bugs with steps to reproduce them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Checks only see what you show them
&lt;/h3&gt;

&lt;p&gt;There is a limit here too, and I want to name it honestly. The run happens on a local environment, so it can't see how production is configured.&lt;/p&gt;

&lt;p&gt;When I was writing a handbook for the operator of this project, it turned out that payments and deposit top-ups were built and tested, but simply not switched on in the production settings.&lt;/p&gt;

&lt;p&gt;So the code was right, the tests were green, and the most important part of the business, money from the client, wouldn't have worked in production. It wasn't the tests that caught it. It was someone walking through the whole path with the eyes of the operator.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Checks only cover the part of the world you showed them. Production settings need to be shown too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  4. Check by risk, and fix the factory
&lt;/h2&gt;

&lt;p&gt;A fair question: if all of this exists, how often does it run? A full manual run is expensive, it takes the test environment for hours, so running it after every small change makes no sense.&lt;/p&gt;

&lt;p&gt;I ended up with two rhythms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sprints.&lt;/strong&gt; Development is split into two-week sprints. After each one I sum up the results, run full audits and run the manual tests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Risk.&lt;/strong&gt; If important business logic changed, or a new process appeared that many others depend on, I run the checks right away, without waiting for the sprint to end.&lt;/li&gt;
&lt;/ul&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%2F8snd0abm2wruc22zq69a.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%2F8snd0abm2wruc22zq69a.png" alt="When full checks run" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Full checks follow two rhythms: the calendar and the risk.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I think the second rule matters more. How often you check should depend on how much a mistake costs, not on the calendar.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I do with audit reports
&lt;/h3&gt;

&lt;p&gt;I said I barely read code, but it's more accurate to say I don't read it line by line.&lt;/p&gt;

&lt;p&gt;During an audit I skim the changes and carefully read what the auditor reports. If it found a problem, I go into the code on purpose, straight to that place, and try to trace the whole chain: not only where the bug is, but why it appeared at all.&lt;/p&gt;

&lt;p&gt;Often it turns out the agent didn't simply make a mistake, it was set up the wrong way. For example, I had an agent that kept reaching into files outside its own working copy. It still finished its tasks, so I wouldn't have noticed for a long time.&lt;/p&gt;

&lt;p&gt;The reason was simple: its instructions were written before agents started working in separate copies, and nobody ever updated them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fix the factory, not only the product
&lt;/h3&gt;

&lt;p&gt;So after that kind of review I don't just fix the bug. I fix the skill or the agent that let it happen, and make a new plan so the same mistake doesn't come back.&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%2F2ql94718u0xqx6kjb33f.jpeg" 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%2F2ql94718u0xqx6kjb33f.jpeg" alt="Fix the factory, not only the product" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;When an audit finds a problem, I fix not only the bug, but also what allowed it to appear.&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A regular developer fixes the product. I mostly fix the factory that makes it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That, I think, is the answer to whether you lose control. Control just moves from individual lines of code to how the whole system works.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the limit is
&lt;/h2&gt;

&lt;p&gt;It would be dishonest to say all this protects you from everything.&lt;/p&gt;

&lt;p&gt;All these checks share one limit: they catch code that doesn't match the intent, but they won't save you if the intent itself is wrong.&lt;/p&gt;

&lt;p&gt;If I write in the plan that the deposit is always returned to the client, and the business needs something else, the agents will honestly build it, the tests will honestly check it, and everything will be green.&lt;/p&gt;

&lt;p&gt;So my responsibility didn't get smaller. It got bigger, it just moved to a different place.&lt;/p&gt;

&lt;p&gt;I used to spend most of my time on code, and often there was no energy left for the details of the business. Now agents and auditors take the code, and I can calmly think about how payment should work, what to do with a client who won a lot and disappeared, or who exactly should see other people's bids.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, are developers losing attention?
&lt;/h2&gt;

&lt;p&gt;I think some are, and the articles about it are not written for nothing.&lt;/p&gt;

&lt;p&gt;The problem is not that people stopped reading code. It's that they didn't replace that reading with anything.&lt;/p&gt;

&lt;p&gt;When programmers moved from assembler to Fortran, attention didn't disappear, it moved one level up. The same is happening now. Only this time the compiler can make mistakes, so you have to build a system you can trust yourself.&lt;/p&gt;

&lt;p&gt;That takes time. It took me two years, and it's still not perfect.&lt;/p&gt;

&lt;p&gt;But I think this is now the main job of a developer: not writing code and not reading it, but knowing what it should do, and having a way to check that it does exactly that.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does it work for you?&lt;/strong&gt; Do you still read every line your agents write, or have you moved to checks too? I'd like to hear where you draw the line.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Sources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://addyosmani.com/blog/comprehension-debt/" rel="noopener noreferrer"&gt;Comprehension Debt&lt;/a&gt;, Addy Osmani&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alphaxiv.org/abs/2603.22106" rel="noopener noreferrer"&gt;From Technical Debt to Cognitive and Intent Debt&lt;/a&gt;, Margaret-Anne Storey&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.softwarepreservation.org/projects/FORTRAN/paper/p25-backus.pdf" rel="noopener noreferrer"&gt;The History of FORTRAN I, II, and III&lt;/a&gt;, John Backus&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.softwarepreservation.org/projects/FORTRAN/paper/Backus-ProgrammingInAmerica-1976.pdf" rel="noopener noreferrer"&gt;Programming in America in the 1950s&lt;/a&gt;, John Backus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://swarmery.substack.com/p/you-can-stop-reading-the-code-you" rel="noopener noreferrer"&gt;Swarmery on Substack&lt;/a&gt;, where I write about building with Claude Code agents in public. Swarmery itself is open source: &lt;a href="https://atretyak1985.github.io/swarmery/" rel="noopener noreferrer"&gt;atretyak1985.github.io/swarmery&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>testing</category>
      <category>programming</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>Why my weekly Claude Code limit ran out in the middle of the week, and what I did about it</title>
      <dc:creator>Andrii Tretiak | Swarmery</dc:creator>
      <pubDate>Fri, 06 Nov 2026 12:10:55 +0000</pubDate>
      <link>https://dev.to/swarmery/why-my-weekly-claude-code-limit-ran-out-in-the-middle-of-the-week-and-what-i-did-about-it-2jc4</link>
      <guid>https://dev.to/swarmery/why-my-weekly-claude-code-limit-ran-out-in-the-middle-of-the-week-and-what-i-did-about-it-2jc4</guid>
      <description>&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%2Fbt3jnslu59tci7xch6tg.jpeg" 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%2Fbt3jnslu59tci7xch6tg.jpeg" alt="I was looking for the problem among the agents, but it was sitting right next to me." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;I was looking for the problem among the agents, but it was sitting right next to me.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have two Claude Max 20x subscriptions, and both of them have a weekly limit. For a while it would run out somewhere around Thursday, and after that I either waited or worked through the paid API. At some point I got tired of this, and I decided to figure out where the tokens actually go.&lt;/p&gt;

&lt;p&gt;A bit of context first: &lt;a href="https://github.com/atretyak1985/swarmery" rel="noopener noreferrer"&gt;Swarmery&lt;/a&gt; is a program that runs on my computer next to Claude Code. Claude Code saves a full record of every session to disk, and Swarmery reads these records into its own database: every model response, how many tokens it took and which agent gave it. So I didn't have to guess, I could just look.&lt;/p&gt;

&lt;p&gt;In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hundreds of background sessions ate less than two percent of the tokens.&lt;/li&gt;
&lt;li&gt;One session in five went past 300 thousand tokens, and those sessions ate four fifths of everything.&lt;/li&gt;
&lt;li&gt;What helped was not a new tool but a habit: closing the session when a phase of work ends.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hundreds of sessions that cost almost nothing
&lt;/h2&gt;

&lt;p&gt;The first thing I thought of was background sessions. Swarmery starts some of them itself: there is a judge that evaluates how the agents did their work, there is a session that writes notes for handing work over, and a few more like that. I should say right away that these are not the subagents people usually argue about online, I will get to those later.&lt;/p&gt;

&lt;p&gt;These are small sessions that nobody started by hand, they just show up on their own, and there were hundreds of them on the dashboard. One day in July there were 305 of them, while my own sessions in projects that day were 28. The day before there were 30 background sessions, the day after there were 55, so that day was clearly not a normal one.&lt;/p&gt;

&lt;p&gt;And the reason turned out to be pretty funny: there was a bug where the judge was evaluating its own evaluation sessions, and then evaluating the sessions where it evaluated those, and so on in a circle.&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%2F2vu714dy0q7hz9antvly.jpeg" 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%2F2vu714dy0q7hz9antvly.jpeg" alt="The judge evaluated its own evaluations, and then evaluated those, and so on." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The judge evaluated its own evaluations, and then evaluated those, and so on.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I fixed the bug, and then out of curiosity I counted how much those 305 sessions ate. All together, less than two percent of the tokens that day. The rest, more than 98%, was eaten by my 28 sessions.&lt;/p&gt;

&lt;p&gt;So the number of sessions tells you nothing at all. And then I looked not at how many sessions there were, but at what kind of sessions they were.&lt;/p&gt;

&lt;h2&gt;
  
  
  Long sessions ate four fifths of the tokens
&lt;/h2&gt;

&lt;p&gt;I took eight weeks and sorted the working sessions by how big their context got. Context is everything the model has to read before it answers: the whole conversation, files, command output. The models I use accept up to a million tokens, so a session can grow for a very long time, and nothing stops it.&lt;/p&gt;

&lt;p&gt;The picture turned out very simple:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More than half of the sessions never went past 150 thousand tokens, and all together they cost almost nothing.&lt;/li&gt;
&lt;li&gt;One session in five went past 300 thousand, and those sessions ate four fifths of all the tokens.&lt;/li&gt;
&lt;li&gt;Such a session lives fourteen hours on average and has hundreds of model responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The problem was not how many sessions I had, but how long they lived.&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%2Frfsxvm6q0wz5ma5sb96d.jpeg" 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%2Frfsxvm6q0wz5ma5sb96d.jpeg" alt="The same question, but in the long session the model first has to read through everything that came before." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The same question, but in the long session the model first has to read through everything that came before.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why a long session is so expensive
&lt;/h2&gt;

&lt;p&gt;The model remembers nothing between responses. Every time, before it answers, it reads the whole conversation again from the start. Claude Code keeps this text in a cache, and one read from the cache is cheap. But it happens before every single response, and the conversation keeps growing.&lt;/p&gt;

&lt;p&gt;And when I measured it, it turned out that the same response in a session of 300 thousand tokens costs three times more than in a fresh one. And if you count tokens instead of cost, cache reads are 98% of everything that went through the system. What I actually type is a tenth of a percent.&lt;/p&gt;

&lt;p&gt;And here is the catch: the cost doesn't grow in a straight line. If the conversation is twice as long, every answer costs about twice as much, and there are also about twice as many answers, so the whole session costs not two but about four times more. That is why one session of fourteen hours can cost more than a whole day of short ones.&lt;/p&gt;

&lt;p&gt;Imagine a meeting where, before anyone says a new sentence, the secretary reads the whole protocol out loud from the first minute. In the first hour nobody notices, but by the evening nobody is working anymore, everyone is just sitting and listening to the protocol.&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%2Frtf38tr6oghge35boxx5.jpeg" 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%2Frtf38tr6oghge35boxx5.jpeg" alt="Before every new answer, the whole protocol is read again from the first minute." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Before every new answer, the whole protocol is read again from the first minute.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I checked subagents separately, because that is what people write about most as the thing that burns tokens. And yes, in sessions where the main agent hands out work for hours, they really do make up the bigger part. But half of my most expensive sessions are just me and one very long conversation, without any subagents.&lt;/p&gt;

&lt;p&gt;And both kinds ended up on the list for the same reason: they are long.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handoff notes in Swarmery
&lt;/h2&gt;

&lt;p&gt;First I did a simple thing: every session card now has a context badge, yellow from 150 thousand tokens and red from 300 thousand. Just to see it, instead of guessing.&lt;/p&gt;

&lt;p&gt;But the main thing is the handoff. When a session goes past 150 thousand, Swarmery writes a short note by itself:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the goal was;&lt;/li&gt;
&lt;li&gt;what state the work is in now;&lt;/li&gt;
&lt;li&gt;which files were changed;&lt;/li&gt;
&lt;li&gt;which decisions were made;&lt;/li&gt;
&lt;li&gt;what the next step is.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the session grows another 75 thousand, it writes a fresh one. It writes the note from its own database, not from the transcript, because reading a 400 thousand token transcript in order to save tokens is like treating a disease with something more expensive than the disease. Then I take this note, close the session and continue in a new one, where the context is small.&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%2Faz6twoeu36lukatkddr7.jpeg" 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%2Faz6twoeu36lukatkddr7.jpeg" alt="A short note is enough to carry the work over into a new session." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;A short note is enough to carry the work over into a new session.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And here I have to be honest: at first this didn't work. The note would show up on the card, and I kept working in the same session. I checked the data: in most cases, after the note was ready, the session lived for another hundred responses or more.&lt;/p&gt;

&lt;p&gt;I know the reason in myself. When the task is big, it feels like you will lose something important with a new session, and it's a pity.&lt;/p&gt;

&lt;p&gt;What helped was to stop tying the handoff to the size of the context and to tie it to the structure of the work instead. In Swarmery a big task is a plan split into phases, and each phase is a separate document with a list of items. The end of a phase is a natural place to stop: everything you need to know next is already written in the plan, not in the head of the session.&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%2F3a4p6adpkcsunox90tio.jpeg" 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%2F3a4p6adpkcsunox90tio.jpeg" alt="The end of a phase is a natural place to stop." width="800" height="533"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The end of a phase is a natural place to stop.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The reason this works is simple for me: a short session is not only cheaper, it is also smarter. A model that reads 100 thousand tokens keeps in its head what matters right now. A model that reads 500 thousand also keeps in its head all the wrong moves, old versions of files and command output that nobody has needed for a long time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to check this on your own machine
&lt;/h2&gt;

&lt;p&gt;If your limit also runs out in the middle of the week, I wouldn't start by counting agents. I would look for the few sessions that lived the longest. You don't need Swarmery for that: Claude Code keeps one file per session in &lt;code&gt;~/.claude/projects&lt;/code&gt;, and the biggest files are where it makes sense to start.&lt;/p&gt;

&lt;p&gt;After that the question is not about the tool but about the habit: stop when a part of the work is finished, not when the tokens are finished.&lt;/p&gt;

&lt;p&gt;The Swarmery code is open on &lt;a href="https://github.com/atretyak1985/swarmery" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, and the script that calculates all the numbers in this post is &lt;a href="https://github.com/atretyak1985/swarmery/tree/main/articles/substack/where-the-tokens-went/evidence" rel="noopener noreferrer"&gt;right next to the article&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This post was first published on &lt;a href="https://swarmery.substack.com/p/why-my-weekly-limit-ran-out-in-the" rel="noopener noreferrer"&gt;my Substack&lt;/a&gt;, where I write about building Swarmery, a local control plane for Claude Code agents. If you want the next posts, you can &lt;a href="https://swarmery.substack.com/subscribe" rel="noopener noreferrer"&gt;subscribe there&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>claudecode</category>
      <category>ai</category>
      <category>productivity</category>
      <category>devtools</category>
    </item>
  </channel>
</rss>
