<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andriy Tretyak on Medium]]></title>
        <description><![CDATA[Stories by Andriy Tretyak on Medium]]></description>
        <link>https://medium.com/@swarmery?source=rss-2efbd03804af------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SlBHZ-MZ3V7uXHefMYvATA.png</url>
            <title>Stories by Andriy Tretyak on Medium</title>
            <link>https://medium.com/@swarmery?source=rss-2efbd03804af------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 16:20:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@swarmery/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why my weekly limit ran out in the middle of the week, and what I did about it]]></title>
            <link>https://swarmery.medium.com/why-my-weekly-limit-ran-out-in-the-middle-of-the-week-and-what-i-did-about-it-700ffe9c1305?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/700ffe9c1305</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 19:20:29 GMT</pubDate>
            <atom:updated>2026-11-11T19:20:29.087Z</atom:updated>
            <content:encoded><![CDATA[<h3>I thought agents were eating my tokens. It turned out to be one habit, and that habit can be broken.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NG4vkx0i9Nn2IRdk.jpeg" /></figure><p>I was looking for the problem among the agents, but it was sitting right next to me.</p><p>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.</p><p>For those who haven’t read the previous posts: <a href="https://github.com/atretyak1985/swarmery">Swarmery</a> 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.</p><p><strong>In short:</strong></p><ul><li><strong>Hundreds of background sessions</strong> ate less than two percent of the tokens.</li><li><strong>One session in five</strong> went past 300 thousand tokens, and those sessions ate four fifths of everything.</li><li><strong>What helped</strong> was not a new tool but a habit: closing the session when a phase of work ends.</li></ul><h3>Hundreds of sessions that cost almost nothing</h3><p>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.</p><p>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 <strong>305 of them</strong>, while my own sessions in projects that day were <strong>28</strong>. The day before there were 30 background sessions, the day after there were 55, so that day was clearly not a normal one.</p><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*k3xs8EZk6y3OOpWd.jpeg" /></figure><p>The judge evaluated its own evaluations, and then evaluated those, and so on.</p><p>I fixed the bug, and then out of curiosity I counted how much those 305 sessions ate. <strong>All together, less than two percent of the tokens that day.</strong> The rest, more than 98%, was eaten by my 28 sessions.</p><p>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.</p><h3>Long sessions ate four fifths of the tokens</h3><p>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.</p><p>The picture turned out very simple:</p><ul><li><strong>More than half of the sessions</strong> never went past 150 thousand tokens, and all together they cost almost nothing.</li><li><strong>One session in five</strong> went past 300 thousand, and those sessions ate four fifths of all the tokens.</li></ul><p>Such a session lives fourteen hours on average and has hundreds of model responses.</p><p>The problem was not how many sessions I had, but how long they lived.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8_bN6FRrRTeZxsUC.jpeg" /></figure><p>The same question, but in the long session the model first has to read through everything that came before.</p><h3>Why a long session is so expensive</h3><p>The model remembers nothing between responses. <strong>Every time, before it answers, it reads the whole conversation again from the start.</strong> 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.</p><p>And when I measured it, it turned out that the same response in a session of 300 thousand tokens costs <strong>three times more</strong> 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.</p><p>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.</p><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xx57Vf1qv7hbOjw5.jpeg" /></figure><p>Before every new answer, the whole protocol is read again from the first minute.</p><p>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.</p><p>And both kinds ended up on the list for the same reason: <strong>they are long.</strong></p><h3>Handoff notes in Swarmery</h3><p>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.</p><p>But the main thing is the handoff. When a session goes past 150 thousand, Swarmery writes a short note by itself:</p><ul><li>what the goal was;</li><li>what state the work is in now;</li><li>which files were changed;</li><li>which decisions were made;</li><li>what the next step is.</li></ul><p>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.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2pwAWSnZTk_1xaoE.jpeg" /></figure><p>A short note is enough to carry the work over into a new session.</p><p>And here I have to be honest: <strong>at first this didn’t work.</strong> 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.</p><p>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.</p><p>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. <strong>The end of a phase is a natural place to stop:</strong> everything you need to know next is already written in the plan, not in the head of the session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4G5Hs001U_vQ2B_Y.jpeg" /></figure><p>The end of a phase is a natural place to stop.</p><p>The reason this works is simple for me: <strong>a short session is not only cheaper, it is also smarter.</strong> 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.</p><h3>How to check this on your own machine</h3><p>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 ~/.claude/projects, and the biggest files are where it makes sense to start.</p><p>After that the question is not about the tool but about the habit: <strong>stop when a part of the work is finished, not when the tokens are finished.</strong></p><p>The post about lessons and predictions that I promised is still coming next. The Swarmery code is open on <a href="https://github.com/atretyak1985/swarmery">GitHub</a>, and the script that calculates all the numbers in this post is <a href="https://github.com/atretyak1985/swarmery/tree/main/articles/substack/where-the-tokens-went/evidence">right next to the article</a>.</p><p>Previous post: <a href="https://swarmery.substack.com/p/why-i-dont-believe-an-agent-when">Why I don’t believe an agent when it says “done”</a></p><p><em>Originally published on </em><a href="https://swarmery.substack.com/p/why-my-weekly-limit-ran-out-in-the"><em>Swarmery</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=700ffe9c1305" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Agent Wasn’t Wrong. My Task Was]]></title>
            <link>https://swarmery.medium.com/the-agent-wasnt-wrong-my-task-was-bba5c5a010d9?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/bba5c5a010d9</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 13:03:54 GMT</pubDate>
            <atom:updated>2026-11-17T08:35:56.905Z</atom:updated>
            <content:encoded><![CDATA[<h4>How I moved from small tasks on a board to a plan with phases, and why every plan I make now starts with an interview</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h7twWI9a_sFwPOer.jpeg" /><figcaption>The agent does not read my mind, it reads only what I wrote to it.</figcaption></figure><p>Probably everyone who works with Claude Code has seen this at least once: you write the agent a short task that seems perfectly clear to you, it works happily for half an hour; then it says “done”, and you look at the result and see that it did something perfectly logical, but not at all what you meant.</p><p>The most annoying part is that, formally, the agent made no mistake, because the task description had nothing in it that told it not to do it exactly that way.</p><p>For a long time I thought the problem was the agent, but then I realized the problem was a poorly described task.</p><p>The reason is simple: I have the whole picture of the project in my head, I know what is already done, what is planned for next week, where the old decisions are that must not be touched, and the agent starts every task from zero and sees only the text I gave it. So everything I didn’t write fills in by itself, and it fills it in the way an average person on the internet would, not the way my project needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KR25tJcCQ4qDY2OR.png" /><figcaption>A short description covers only part of the picture, and the agent fills in the rest by guessing.</figcaption></figure><p>I already wrote a little about how I got here in <a href="https://swarmery.medium.com/how-swarmery-came-to-be-part-2-why-i-replaced-the-kanban-board-with-plans-ebe6f30e0923">the second part of the Swarmery story</a>, but there it was short, and now I want to tell in detail how it works in practice and what came out of it.</p><h3>Why small tasks on a board did not work</h3><p>At first I went the most obvious way. Well, how do people work in a team? There is a board, there are small tasks on it, each one is taken by one person and done. So I brought a kanban board into Swarmery, cut the work into small cards and handed them to agents one by one. It looked very right: the task is small, it is easy for the agent, and it is easy to check too.</p><p>But in practice every single card was done fine, and together they did not fit. One agent made the API a bit its own way, the second made the interface for the API it imagined, the third wrote tests for behaviour nobody had agreed on.</p><p>Why? I will explain. A person in a team who takes a small task still keeps the general context in their head: they were at the meeting, they saw the discussion, they remember why all this is being done. And the agent has none of that context at all, it has only the text of the card, and a small task without the big picture turned out to be not easier for the agent but harder, because it has even more gaps that have to be filled with guesses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZvRLkklLMU43gfz_.png" /><figcaption>A small task without the general context worked worse than a big task split into phases.</figcaption></figure><h3>A plan with phases and a planner that interviews me</h3><p>Agents did much better when they had a detailed plan of a big task, split into small phases. So the task is the same big one, but every agent that takes its phase sees the goal of the whole plan, the decisions already made, and what exactly is expected from it.</p><p>And here a question came up: who is going to write this plan? If I write it myself, that is an hour or two of work for every task, and I would quickly stop doing it. So my plans are written by a separate agent, the planner.</p><p>But before writing the plan, the planner interviews me, and this is probably the most important part of the whole process. First it quietly reads the project code, so that it does not ask me about things it can see by itself.</p><p>Then it asks one question at a time, and for every question it gives two to four answer options with pros and cons, and it marks one option as recommended and says why, and the last one is always “other”, where I can write my own. Next to it on the screen the plan is visible all the time as it comes together: after each answer the planner rebuilds it around the decision I made and asks the next question, one level deeper.</p><p>Why so complicated, why not just give it a long description? Because I myself do not know which details are missing from my description until someone asks me about them. The interview pulls out of me exactly the things I consider obvious and therefore never write in a task.</p><h3>A real example: sending phases to GitHub</h3><p>Let me show it on a fresh example. Recently I got tired of the fact that a plan phase the agent finished on its branch could not go anywhere from the dashboard: to send it to GitHub and open a PR I had to go to the terminal and do it all by hand, and the next phase that depended on it was just waiting the whole time.</p><p>I described this to the planner in a few sentences, and after the interview the plan had five locked decisions: for example, that sending to GitHub works through one shared mechanism for cards on the board and for plan phases, not through two different ones, that the GitHub access token is stored separately from the agents, and that when I return a phase to the agent with a comment, the comment is written straight into the phase document.</p><p>And with the fifth decision there was a funny story. On the last question I pressed “continue” without answering, and the planner did not quietly invent something of its own, it took its recommended option and wrote right in the plan that this decision was made without my answer. I liked that, because later I knew exactly which decision was worth checking once more.</p><h3>What is inside a plan</h3><p>Now about what exactly the planner writes. First a general description: the goal, the decisions from the interview, the real files in the code it will touch, the risks, and what counts as fully done.</p><p>Then it splits the task into phases and for every phase separately it thinks about how complex it is, and that decides which agent and which model gets it, whether it needs a strict check, and whether it needs a separate reviewer. For every phase it writes a separate document, and it has everything an agent needs to start from zero and ask nothing: what to do, which files to change, how code is written here, what must not be done, and the main thing, the acceptance criteria.</p><p>The criteria need a separate word. A criterion from the planner cannot be “works correctly”, because that cannot be checked. A criterion is always something you can check with a command or with your eyes in a second: the tests pass, the file appeared, the button is on the screen. And at the end of every phase document there is an empty section for the report the agent fills in when it finishes.</p><p>And the phases do not just stand in a queue one after another. Some phase can go only after another one, and some can go in parallel. The GitHub plan ended up with nine phases, and after the first one, which laid the foundation, the work split into several parallel branches, which then came together again at the end. All of this is visible on the dashboard, and you can see which phase is waiting for which.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IpUEzY_bS5gVY_sR.png" /><figcaption>Nine phases, several of them ran in parallel, and the last one waited for all the others.</figcaption></figure><h3>How a phase gets checked</h3><p>Then an agent takes the phase and works on its own separate branch, so it does not get in the way of the others. When it says it is finished, the phase is not considered done yet.</p><p>First the criteria are checked, and then the code is looked at by a separate reviewer agent, which did not write this code and cannot change anything in it, only read. Why I don’t take an agent’s word for it, I wrote in detail in <a href="https://swarmery.medium.com/why-i-dont-believe-an-agent-when-it-says-done-fe888e0dc0d0">an earlier post</a>, here I will only say that in this plan the reviewer asked for changes in every one of the first six phases, and almost every time it found something the phase’s own tests did not catch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OHtavNgfvCB5aF1s.png" /><figcaption>The reviewer sent phases back more often than it approved them, and that is a good thing.</figcaption></figure><p>A phase becomes “done” only when all its criteria are met, and at that moment the agent writes the report: what was done, how, which commits, how it checked it, and separately, where reality went a different way from the plan.</p><p>And this last point turned out to be almost the most useful for me. For example, in the fourth phase the planner assumed that a returned phase could simply continue in its old working folder, and it turned out that this folder is removed after every run, and the agent honestly wrote in the report that the assumption did not hold and how it worked around it. Without the report I would have found out about this only when something broke.</p><h3>What this plan built</h3><p>Now, actually, about what this plan built. After a phase is finished, it gets a review tab on the dashboard, where you see all the changes, the verdict of the check and three buttons. The first one just sends the branch to GitHub. The second one sends it and opens a PR right away, it can be a draft. And the third one returns the phase to the agent with my comment: the comment is written into the phase document, and the agent restarts on the same branch, already knowing what I did not like.</p><p>The PR description is put together from the phase document automatically: the goal, the agent’s report, and the list of what was checked. Then every ten minutes Swarmery looks at what is happening with that PR, whether the tests pass, whether there is a review, and when the PR is merged, the phase that was waiting for it can finally start by itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l2oOkJ42lZXZgyyE.png" /><figcaption>A phase goes through checks, review and a PR, and the next phase starts only after the merge.</figcaption></figure><p>And one more detail I had to add along the way. Some criteria are not the agent’s to close at all: for example, “PR merged” or “checked by hand in production”.</p><p>Before, the agent either got stuck on such items or, worse, marked them done without doing anything. Now the planner marks such criteria with a separate label, and the agent knows it is not its job: it does not push, does not open a PR and does not go to production, it just says it has done its part.</p><p>The first run came out interesting too. The first PR Swarmery opened from this new tab was a PR into the Swarmery repository itself: a small phase that added one line to the documentation saying this is the first PR opened this way. It was merged, Swarmery noticed it by itself, and the second phase that depended on it started without me touching anything. So the feature was tested on itself.</p><h3>What is not perfect yet</h3><p>I have to say honestly that not everything here is perfect. Pushing to a fork is not done yet. The reviewer in the fifth phase ran into its turn limit and did not look at everything, and after the fixes in several phases there was no second review round.</p><p>So a plan does not make agents flawless. But it makes the mistakes visible earlier, they are cheaper, and I know exactly where I need to look with my own eyes.</p><p>To sum up, I stopped giving agents poorly described tasks. Now I spend a few minutes on an interview with the planner, and those minutes pay off with the hours that used to go into redoing what the agent did “correctly, but not the right thing”.</p><p>In the next post I will finally talk about lessons and forecasts: how agents predict before every phase how long the work will take and what will break, and what came out when I compared the forecasts with reality. I promised this post twice already, so this time for sure.</p><p>All of Swarmery’s code is open on GitHub: <a href="https://github.com/atretyak1985/swarmery">github.com/atretyak1985/swarmery</a></p><p>Previous post: <a href="https://swarmery.medium.com/why-my-weekly-limit-ran-out-in-the-middle-of-the-week-and-what-i-did-about-it-700ffe9c1305">Why my weekly limit ran out in the middle of the week, and what I did about it</a></p><p><em>Originally published on </em><a href="https://swarmery.substack.com/p/why-the-agent-does-the-wrong-thing"><em>Swarmery</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bba5c5a010d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I Don’t Believe an Agent When It Says “Done”]]></title>
            <link>https://swarmery.medium.com/why-i-dont-believe-an-agent-when-it-says-done-fe888e0dc0d0?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe888e0dc0d0</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Tue, 29 Sep 2026 19:19:58 GMT</pubDate>
            <atom:updated>2026-09-29T19:34:05.225Z</atom:updated>
            <content:encoded><![CDATA[<h4>Before lessons and forecasts, the one thing it all stands on: a model’s work has to be checked from the outside, not taken on its own word.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*33esqAL5x_OBoXcg.jpeg" /><figcaption>The agent says “done” and the check mark looks solid, but only a look from the outside finds the crack.</figcaption></figure><p><em>After </em><a href="https://swarmery.substack.com/p/how-swarmery-came-to-be-part-1-from"><em>the story of how Swarmery came to be</em></a><em>, I promised to write about lessons and forecasts, and I will, but first I need to tell you about one thing that all of it stands on: a model’s work has to be checked from the outside, not taken on the model’s own word.</em></p><p>Probably everyone who works with agents has seen this picture: the agent finishes a task and writes that everything is done, all tests pass, and everything really does look fine. In the second part of the Swarmery story I told how, after I reworked my team of agents, the report said “all done”, and in reality there were four problems.</p><p>Back then I thought maybe I just needed a stronger model, or to explain the task to it longer, and then it would stop making mistakes. But over time I understood that the problem is not which model it is, but who gives the grade.</p><blockquote>The problem is not which model it is, but who gives the grade.</blockquote><p>Let me explain why. When a model checks its own work, both the mistake and the check come from the same source. What it didn’t notice while writing the code, it most likely won’t notice while checking that code either, because it thinks in the same way and looks from the same side.</p><p>And there is one more unpleasant thing: the phrase “already fixed” sounds equally confident when it’s true and when it isn’t, so from the answer alone you can never tell one from the other. A plain test, on the other hand, doesn’t depend on the model at all, it doesn’t care how confidently the model writes, it just passes or fails.</p><p>The comparison I like most here is a student at an exam whom we can’t teach. We can’t change the model itself: it belongs to the company that made it, and it remembers nothing between runs.</p><p>But around it we control quite a lot of things. We can let it retake the exam, meaning run the task again. We can show exactly where the mistake is, and then the second attempt is not blind anymore but aimed at a specific problem. We can take a different student for hard tasks, meaning a different model. We can write lessons down, because the model doesn’t remember, but the system does.</p><p>And most important, we can refuse to let into the work anything that didn’t pass the check. But in all these cases the grade is given by the examiner, not by the student.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fsLkBlSr15Fi5zuBoELDEg.png" /></figure><p>Nobody changes the model here: only what it gets as input changes, and what we accept from its work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c0lTHeg-wxGVgpKqYCGHfw.png" /></figure><p>This is a theoretical picture, just to show the idea: if the check tells right from wrong exactly, then even a model that handles a task only half the time gives a correct result in 87.5% of cases after three attempts.</p><p>In reality attempts are not fully independent, because the model often repeats the same mistake, so the second attempt, where the model sees the error text, matters much more than a third blind one.</p><p>Recently I read three reviews in “<a href="https://claudescorner.substack.com/">Claude’s Corner</a>” where one and the same idea kept coming back from different angles: how reliable agent work is depends not on which model you picked, but on which checks stand around it.</p><p>And I got curious how much Swarmery is already built this way and what it’s still missing. So I broke those articles down into concrete requirements that can be checked in code, and I got fourteen. Half of them Swarmery already had, for example the agents’ work is graded by a separate model, and results are accepted by ordinary checks, not by the agent’s own words. But four things were missing completely.</p><p>For example, when a session ran out of context and the work had to be handed to a new one, the model retold the state from memory, and there was neither the commit where we stopped nor the list of changed files. Or a run would start even when I had two percent of my limit left, and the work would break off in the middle.</p><p>Or when a new model came out, I compared it on different live tasks, so the grade depended a lot on which tasks happened to get into the sample. And also two sessions could edit the same file, and this got recorded somewhere, but nobody saw it.</p><p>For these gaps I wrote a plan and ran it through Swarmery itself. Each phase was done by one agent and checked by another, separate agent, which didn’t see the executor’s train of thought, only the code changes and the criteria of what exactly had to be done. If the check found a serious problem, the phase was not accepted and went to another round of fixes and then to the check again.</p><p>And this is where the most interesting part came. Out of five phases that the executors had already marked as done, in three the checking agent found serious problems, six in total.</p><p>A run that was waiting for the limit really did wait, but nowhere on the board could you see why it was waiting, so the card just sat there silently. The warning that two sessions are editing the same file could, under load, never update at all. And in the task set for comparing models, one task could be passed with a wrong solution: just commit something and say that everything is already done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3cQmMWV7EGv13-TrryXlg.png" /></figure><p>Most problems were found in the task set, and those are exactly the checks that the grading of new models depends on later.</p><p>And it’s important that none of the executors lied. They honestly wrote that all their tests were green, and the tests really were green.</p><p>The problems just sat exactly in what those tests didn’t check, because the tests were written by the same agent that wrote the code, and it looked at the task from the same side. So this is exactly what I wrote about above, only now on a live example from my own project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D2aQbyR2Dzw0HIS-27vgow.jpeg" /><figcaption>All the lights were green, and the problem leaked out exactly where the tests didn’t look.</figcaption></figure><p>One more thing I took from this: the most useful check doesn’t ask “does this work?”, it asks “how could a wrong solution get through?”. Exactly this question, in one of the phases, found three ways to get around the check that neither the executor nor its tests had thought about.</p><p>And it seems to me that how the question is phrased matters more here than how strong the checking model is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixqlXjOTzkRzsLlRFfiIWw.jpeg" /><figcaption>The most useful check doesn’t ask whether it works, it asks where a wrong solution could slip through.</figcaption></figure><p>So how much does it cost? The check took almost forty percent of the tokens compared to what went into the work itself. That’s not little, and I understand someone will say it’s expensive.</p><p>But each of those six problems would have reached the code: the card would have waited silently, and the task set would have given wrong grades to new models, and I would later have used those grades to decide which model to use. So for changes that other decisions depend on later, this kind of check pays off the fastest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eF7C-GG2jBzRlWFBBRYaLg.png" /></figure><p>In every phase the review cost about a third or a bit more of the executor’s work, so it’s not a one-off surcharge but a steady price for not taking things on faith.</p><p>To be fair, checks make mistakes too, and I saw it in the same run. At the end one more agent ran the same set of checks on every branch, and on two branches it showed a failure, although the cause was an old test that sometimes fails under load, and those branches didn’t touch it at all. If I had blindly trusted that check, two normal changes would have been blocked for no reason.</p><p>That’s why the task set got a separate check of the checks themselves: for each task there is a known correct solution that must pass, a stub that does nothing and must fail, and a few deliberately tricky variants, for example that same “committed and said it’s already done”.</p><p>It sounds a bit funny, checking the check, but without it you just swap faith in the model for faith in the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYBYB_NzHSp9NaVLqhc3iQ.jpeg" /><figcaption>A real solution must pass and an empty stub must be stopped, otherwise the check itself can’t be trusted.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9-eGZEHmAzrSLB17DjOMA.png" /></figure><p>This is theory too, but it shows well why an inaccurate check is dangerous: even if it lets through only one wrong solution in ten, with a model that is right half the time 9% of what gets accepted is already junk, and you won’t know about it.</p><p>And I have to say honestly that the checking agent is also a model, maybe even from the same family, so the independence here is not complete: a different session and a different context, but a similar way of thinking.</p><p>That’s why I try to make sure the final decision is made not by a model but by a plain test or script that always gives the same result for the same input, and the check by another model is an extra layer, not the only one.</p><p>The same idea worked for choosing the model too. A bit earlier I built complexity routing into Swarmery: when the system starts a task from the board or a plan phase, it estimates how hard the task is by itself and picks the model and how much effort the model should put in, so easy tasks go to a cheaper model and hard ones to a stronger one.</p><p>Before that the choice was almost random: one default model for everything, and the planner’s forecast about the task’s size and risks didn’t affect anything.</p><p>But I didn’t switch this choice on right away, because that would be the same taking it on faith, only now not the model’s word but my own router’s. So right now it works in shadow mode: it records which model it would have picked but changes nothing, and then the system compares that with how each run ended, how much it cost and whether the check passed.</p><p>I will switch it on for real only when every complexity level has at least twenty runs and it’s clear that the cheaper model on easy tasks fails no more often than the one it replaces. And if something goes wrong, it can simply be turned off and everything works as before, and there is a separate test for exactly that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQ18yGUMCNi6igteUBbzOw.jpeg" /><figcaption>The router already picks the track, but for now it only writes its choice down and changes nothing.</figcaption></figure><p>And this work also showed nicely what this whole post is about. In one of the phases the executor couldn’t run the check command the way it was written in the plan, because that command simply didn’t exist in the project, and it honestly left that item unticked instead of putting a checkmark.</p><p>And at the end the agent that ran the whole thing re-checked every item again on the merged branch, and its notes say exactly that: re-verified, not taken on the executor’s word.</p><p>And the review before merging still found two medium problems, for example the cost of a multi-stage task was counted only for the first stage, and they were fixed before the code got into main.</p><p>The model in this run was the same from start to finish, it didn’t get any smarter. The only thing that changed was what reached the code. And I think that’s the main idea: you can’t make the model better, but you can build around it an environment where its mistakes don’t go any further.</p><p>The lessons and forecasts I promised last time will be the next post, because they are built on the same idea: don’t take it on faith, measure it. Swarmery’s code is open on <a href="https://github.com/atretyak1985/swarmery">GitHub</a>, so if you’re curious how it’s done, you can look there.</p><p>Previous post: <a href="https://swarmery.substack.com/p/how-swarmery-came-to-be-part-3-how">How Swarmery Came to Be. Part 3: How the Agent System Stopped Being a Black Box</a></p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/why-i-dont-believe-an-agent-when"><em>https://swarmery.substack.com</em></a><em> on September 29, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe888e0dc0d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Swarmery Came to Be. Part 3: How the Agent System Stopped Being a Black Box]]></title>
            <link>https://swarmery.medium.com/how-swarmery-came-to-be-part-3-how-the-agent-system-stopped-being-a-black-box-523c56440ed0?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/523c56440ed0</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 12:38:53 GMT</pubDate>
            <atom:updated>2026-09-28T16:38:18.559Z</atom:updated>
            <content:encoded><![CDATA[<h4>How I started to see what my agents are really doing, and how the system learns from its own work.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v-NlhowsTKD9vtVa.jpeg" /><figcaption>The agent system used to be a black box that only said “ready”. Now I can see what happens inside.</figcaption></figure><p><em>This is a three-part series: </em><a href="https://medium.com/p/8c8cbd06d52c"><em>Part 1</em></a><em> · </em><a href="https://medium.com/p/ebe6f30e0923"><em>Part 2</em></a><em> · </em><strong><em>Part 3</em></strong></p><p>This is the last part of the Swarmery story. In the first one I told how I went from the ChatGPT chat to Claude Code, in the second one about the planner that hands out work to agents. Today is about how to see what these agents are really doing, and how to make them work better over time.</p><p>When the planner started working, I got a new problem that at first I did not even notice. I launched a plan, a few hours later I got a result and a report, but what happened inside, how the agents behaved, where they got stuck, how much it cost, and why one phase passed on the first try while another took five, I could not see.</p><p>In the second part I told how the report about reworking the agents said “everything is done”, while in fact there were four problems there. And that is not because agents lie, but because I only saw the final report, and everything that led to it stayed inside a black box.</p><p>And how can you improve something you cannot see? You can’t. So around the plans Swarmery started to grow features that let me first see all of this, then measure it, and only then improve it.</p><blockquote>And how can you improve something you cannot see? You can’t.</blockquote><p>I will start with how this works technically, because there is one simple but important thing here. Swarmery is a small program on my computer, with no cloud and no accounts, and it does not build anything into the agents themselves.</p><p>Claude Code already saves a full record of every session into files on disk, it is just that few people read them. Swarmery reads exactly those, so the moment I turned it on for the first time, I immediately saw my whole history of working with agents over the past months, and I did not have to set anything up.</p><p>The first thing that appeared was the sessions feed. All sessions across all projects are visible in one place, live: what the agent is doing right now, which commands it runs, which files it changes, how much it costs, which helpers it called and where errors happened.</p><p>There is a separate timeline that shows how the tech lead handed out work to other agents, what they did and what verdict the reviewer gave. So instead of one report at the end, I see the whole path that led to it.</p><p>The second is permissions. Anyone who has worked with Claude Code knows the feeling: five sessions are open in three projects, one of them has been standing still for half an hour because it is waiting for you to allow it to run a command, and you do not know about it, because that terminal tab is somewhere at the back.</p><p>So now all permission requests come into one queue, and I answer from there. And if the same request keeps repeating, one click turns it into a rule, and the agent will not ask anymore.</p><p>Later this queue grew into one inbox for everything that is waiting for my decision: permissions, suggestions from the system, proposed changes to agents, and new lessons, which I will talk about below.</p><p>The reason is simple: <strong>in a system like this I am the slowest part</strong>, so everything that waits for me has to be in one place and not scattered across a dozen screens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VQXPYuQJ8Y7GqNXchpGDOw.jpeg" /><figcaption>While I was busy, sessions stood still waiting for my permission. Now everything that waits for me comes into one queue.</figcaption></figure><p>The third is numbers. There is analytics: how much the work costs by project and by model, how often agents had to stop and ask me, how much one task costs.</p><p>And there is a retrospective, where every agent has its own report card: how many runs, how many successful ones, how many errors, and how this changed compared to the previous period. There you can also see which tools were denied to agents most often, which errors repeat the most, and how much time agents just spent waiting for my answer.</p><p>Though you have to be careful with numbers too, because a nice chart does not mean at all that it is true. I already wrote about how my own dashboard once showed something different from what was really happening in the post “The Dashboard That Lied”, so I will not repeat it here.</p><p>But seeing is only half of the job. A dashboard by itself does not improve anything, it just nicely shows that everything is bad or everything is good.</p><p>So on top of all of this there is an advisor. It is a set of rules that look at the collected data and suggest concrete improvements, for example to allow an agent a command that I approve by hand every single time anyway, or to rewrite an agent whose error count suddenly went up.</p><p>And the important part is that <strong>every suggestion carries the data it came from</strong>, so I do not have to take it on trust. I can accept it or reject it, and an accepted suggestion goes from “proposed” to “accepted”, then to “adopted” and finally to “verified”.</p><p>Why so complicated? Because otherwise accepted suggestions quietly go stale in a list, and nobody checks whether the change actually improved anything.</p><p>If a suggestion means that some agent needs to be rewritten, I get that rewrite as a set of changes that I review myself first, and no agent file changes without my approval.</p><p>And so that these improvements reach all projects, the agents do not live in each project separately, but in one place, as plugins with versions. I wrote in my very first post about why copying agents between projects is a bad idea, but here is a good example of why all of this matters: when I reworked the team from 42 agents into 13 (I told that story in the second part), the change reached all my projects simply by updating to the new version, and I did not have to carry it over into each one by hand.</p><p>And there is also a page that shows all agents, skills and settings on the computer, where they came from and how they changed over time, because when you have dozens of agents in different places, the question “which agent is actually going to run right now?” stops being simple.</p><p>And the last thing I am actively developing now is lessons. Before a phase runs, the system records a forecast of how long it will take and how hard it will be, and after the run it compares the forecast with what really happened.</p><p>If the difference is big, the system tries to understand the reason: whether the plan was wrong, whether the code turned out different from what we thought, whether the task grew, or whether the tools failed.</p><p>Such cases produce lesson candidates, I review them, and accepted lessons then automatically go into the instructions for the agents that will next work in the same part of the project. So an agent that goes into the same folder tomorrow will already know what yesterday’s one ran into.</p><p>The idea itself, that the system should learn from its own mistakes because models stop learning after training, deserves a separate post, and I will definitely write it, but not now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vByUa3PmJ2fcut94FKPZcw.jpeg" /><figcaption>The forecast said it would be easy, reality said otherwise, and the system turns that into a lesson for the next agents.</figcaption></figure><p>So today Swarmery is not just a tool for agents to solve tasks anymore. It is more like a place where my team of agents works, reports and learns, and I act not as a programmer who writes every line, but as a manager who sets tasks, sees what is happening and decides what to change in the team itself.</p><p>The home page now shows exactly that: plan, run, measure, learn, change, and around again, and next to each step one number and one sentence about what happened this week.</p><p>And the longer this system works, the more it knows about my projects and the less it needs to ask me, and that is probably exactly what I wanted back when I was copying functions into the ChatGPT chat.</p><p>This is where the story of how Swarmery came to be ends, but Swarmery itself is far from finished. The code is open on <a href="https://github.com/atretyak1985/swarmery">GitHub</a>, so if you also work with Claude Code and want to see what your agents are doing, try it and write to me about how it went.</p><p>And the next post will be exactly about lessons and forecasts.</p><p>Previous part: <a href="https://medium.com/p/ebe6f30e0923">How Swarmery Came to Be. Part 2: Why I Replaced the Kanban Board with Plans</a></p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/how-swarmery-came-to-be-part-3-how"><em>https://swarmery.substack.com</em></a><em> on September 28, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=523c56440ed0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Swarmery Came to Be. Part 2: Why I Replaced the Kanban Board with Plans]]></title>
            <link>https://swarmery.medium.com/how-swarmery-came-to-be-part-2-why-i-replaced-the-kanban-board-with-plans-ebe6f30e0923?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebe6f30e0923</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 12:21:00 GMT</pubDate>
            <atom:updated>2026-09-28T16:35:47.596Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why cards on a board did not work for my agents, and how the planner became the heart of Swarmery.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9dtiJP7gqNDRxKSM.jpeg" /><figcaption>On the left, agents fight over cards on a board. On the right, a plan where every step knows about its neighbours.</figcaption></figure><p><em>This is a three-part series: </em><a href="https://medium.com/p/8c8cbd06d52c"><em>Part 1</em></a><em> · </em><strong><em>Part 2</em></strong><em> · </em><a href="https://medium.com/p/523c56440ed0"><em>Part 3</em></a></p><p>This is the second part of the Swarmery story. In the first one I told how I went from the ChatGPT chat to Claude Code and why I started building my own system on top of it. Today is about how to give agents tasks in a way that they actually get them done.</p><p>Once I already had a team of agents in Claude Code, the first question that came up was very simple: how do I give them work? It is one thing when you sit in one session and lead the agent by the hand, and a completely different thing when you want to hand off a big task, go do something else and come back to a finished result.</p><p>Right now I see that a lot of people answer this question with kanban boards for agents and orchestrate them through cards: you create a card, an agent takes it, does it, and moves it to “done”.</p><p>I tried this approach too, and Swarmery still even has a board with three columns, but as the main way of working it did not click for me. I will explain why.</p><p>A card on a board is a separate piece of work that knows nothing about the neighbouring cards. The agent that takes a card does not see the whole picture: why this task exists, what was done before it, what comes after it and what it depends on. And as a result either the cards are very small, and then the agent does its little piece without understanding the whole, or the cards are big, and then the agent drowns in them.</p><p>On top of that, I ended up being the dispatcher myself, constantly moving cards around and deciding what to take next, which means the bottleneck was me again. In the end it all came down to building plans. Maybe I will come back to the kanban board some day, but for now I noticed that it is much more effective to plan the task first and only then hand it to the agents.</p><p>That is how the planner appeared in Swarmery, and I will tell how it works, because it is the heart of the whole system.</p><p>Everything starts with me describing in my own words what I want to do. Then the planner agent does not rush to write the plan right away, it first interviews me: it asks questions one at a time, usually with answer options, and each of my answers narrows the solution.</p><p>While it is asking, the right side of the screen shows what the plan looks like at that moment, so at any point I can fix something or say “enough questions, write it”. All of this is stored in a database, so even if I close the tab, the interview is not lost.</p><p>Why so complicated if you can just write a long task description? The reason is simple: when I write the task myself, I always forget something, and when the agent asks me, it finds the places where there is a choice on its own, and I make that choice, not the agent at its own discretion halfway through the work.</p><p>When the questions are over, the planner writes the plan, and the important thing here is that <strong>it writes documents, not code</strong>.</p><p>A plan is a folder of files. The main file describes the goal, the risks, what counts as a finished result, and a table of phases: which phase goes after which and which depends on which.</p><p>And each phase is a separate document that can be executed on its own: it has a description of the solution, a ready instruction for the agent that you can just copy and run, a list of acceptance criteria as checkboxes, and an empty section for the report that the agent fills in at the end.</p><p>Why separate documents and not one big instruction? Because this way each phase becomes a clear task with clear boundaries, but the agent can still always look at the overall plan and understand where it is now and why all of this exists. So it is the same card from the board, only one that knows about its neighbours.</p><p>And one more important thing: the plan lives not in the project code but in a separate working folder, and these are ordinary text files, so I can open any phase and fix it by hand before it runs.</p><p>Then the plan is launched. The work does not happen in my working folder but in a separate copy of the project on a separate branch (in git this is called a worktree), so the agent never touches what I am working on by hand, and if something goes wrong, the branch stays and nothing gets lost.</p><p>The run is managed by a main agent, let’s call it the tech lead. It gets the plan and the list of all phases with their dependencies and decides how to execute them: some things it does itself, and some it delegates to other agents. I have thirteen of them now, and each has its own role: planner, architect, executor, an agent for the interface, an agent for finding bugs, an agent for tests, a reviewer, a security agent and so on.</p><p>The model is also picked for the task: the strongest model works on hard decisions and reviews, a simpler model on ordinary execution, and the cheapest one on mechanical checks.</p><p>And even if I turn off the computer in the middle of a run, nothing terrible happens: a second run skips the phases where all checkboxes are already ticked and continues from where it stopped.</p><p>The most interesting part is how it checks that a phase is really done. Progress is not counted from the agent saying “done”, but from those same checkboxes in the document: the system counts how many criteria are ticked and how many are not. And the next phase, which depends on the previous one, will not start until all criteria of the previous one are ticked.</p><p>After each phase a separate reviewer, who did not see how the code was written, looks at the changes and gives a verdict: passed, failed or unclear. And for runs from the board there is also a separate verifier that runs the build, the type checks, the linter and the tests and gives the same kind of verdict.</p><p>And if an agent sees that it cannot honestly go further, for example the plan contradicts what is really in the code, it has to stop and write that the plan is blocked at such and such phase, and not make up a different design on the fly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWUsxiVCsAVxC4Z4jrrlJg.jpeg" /><figcaption>How the planner works: an interview, a plan, a separate branch, a team of agents, and a reviewer who checks every phase.</figcaption></figure><p>Sounds nice, but what does it look like in practice? I will explain with a real example, and it is quite symbolic, because this plan reworked the team of agents itself.</p><p>At the beginning of September my agent system went through an external audit, and it showed an unpleasant thing: over a year I had collected 42 agents, many of them differed from each other only in wording, and their instructions were written for older models that needed every step spelled out. And this is not a one-hour task, it is hundreds of files, so I ran it through the planner.</p><p>The result was a plan of seven phases: first fix what was plainly broken, then merge the agents, then rework the skills, the commands and so on. The agents went through all seven phases, ticked all the checkboxes, wrote the reports, and in the end instead of 42 agents there were 13, and the text in their instructions became roughly ten times shorter.</p><p>But the most interesting thing happened after that. The report said everything was done, and when I sat down to review the result myself, I found four problems.</p><p>For example, the reviewer and the security agent were marked as agents that only read code and change nothing, but in fact they still had access to the terminal, and through the terminal you can change any file.</p><p>And one of the goals I had set at the very beginning was simply not reached, even though all the checkboxes in the phases were ticked. How did that happen? The reason is simple: the criteria in the phases did not cover that goal, meaning <strong>the agents honestly did everything that was written, but not everything was written</strong>.</p><p>I fixed all of this in the next version, and one of the mistakes even turned into an automatic check that now catches this kind of thing before changes get into the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmAFXGy8vwd5gm6O9XGuQw.jpeg" /><figcaption>All the checkboxes were ticked, but not everything I wanted was written in the criteria.</figcaption></figure><p>So the conclusion I made is this: the checkboxes are exactly as honest as the criteria are written. The planner takes a big part of the work off me, but the criteria need to be checked already at the planning stage, before the run, and the last word after the run is still mine. In fact it is no different from working with people: if you set the task badly, even a good developer will build the wrong thing.</p><blockquote>The checkboxes are exactly as honest as the criteria are written.</blockquote><p>Recently one more thing was added to the planner, and I am testing it now: a local model that runs right on my computer. Why do I need it? The system has a lot of small questions where the answer is one word, and paying the most expensive model for them is just a waste of money.</p><p>For example, an agent finished its work, but some checkboxes are not ticked, and we need to understand whether it is just reporting and knows the next step, whether it is stuck, whether it has a question for me, or whether actually everything is done. This answer decides whether the system continues the run by itself or stops and calls me.</p><p>Questions like this are answered by a small model through LM Studio or Ollama, it is shown only a small piece of data, and it can only choose from a ready list of answers. And if there is no local model, everything else works as before.</p><p>And one more experiment that runs next to it: before each phase run, the system estimates how complex the task is (the size of the instruction, how many files it touches, whether there are risky places, how similar tasks ended before) and suggests which model and how much “thinking” to give it. For now it only records its choice and compares it with what actually ran and how it ended. I will turn it on when there is enough data to see that it chooses no worse than I do.</p><p>And all of this started working. But if you read the story about the 42 agents carefully, you probably noticed the main problem: until I sat down and checked it myself, I did not know what really happened there. The agent system remained a black box, and how I deal with that will be the third part.</p><p>And if you want to see what a plan looks like from the inside, the plan format and the full report about that agent rework are in the open repository on <a href="https://github.com/atretyak1985/swarmery">GitHub</a>.</p><p>Previous part: <a href="https://medium.com/p/8c8cbd06d52c">How Swarmery Came to Be. Part 1: From ChatGPT to Claude Code</a></p><p>Next part: <a href="https://medium.com/p/523c56440ed0">How Swarmery Came to Be. Part 3: How the Agent System Stopped Being a Black Box</a></p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/how-swarmery-came-to-be-part-2-why"><em>https://swarmery.substack.com</em></a><em> on September 28, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebe6f30e0923" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Swarmery Came to Be. Part 1: From ChatGPT to Claude Code]]></title>
            <link>https://swarmery.medium.com/how-swarmery-came-to-be-part-1-from-chatgpt-to-claude-code-8c8cbd06d52c?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c8cbd06d52c</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 12:05:10 GMT</pubDate>
            <atom:updated>2026-09-28T16:33:15.564Z</atom:updated>
            <content:encoded><![CDATA[<h4>From copying functions into the ChatGPT chat to building my own system on top of Claude Code.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KbaN5UPDOH6SnTHU.jpeg" /><figcaption>Swarmery: I give an idea, a team of agents does the work, and I see the result in one place.</figcaption></figure><p><em>This is a three-part series: </em><strong><em>Part 1</em></strong><em> · </em><a href="https://medium.com/p/ebe6f30e0923"><em>Part 2</em></a><em> · </em><a href="https://medium.com/p/523c56440ed0"><em>Part 3</em></a></p><p>I have already written a few posts about separate pieces of Swarmery, but I never actually told where it came from and how it works as a whole. So I decided to go back and tell the story in order, and since the story turned out long, I split it into three parts. This is the first one.</p><p>Right now the market is full of all kinds of systems that are really just wrappers around ChatGPT or Claude. The model and the chat stay the same, and someone builds their own interface, their own rules and their own buttons around them and sells it as a new product. Almost every week a new wrapper shows up and promises that agents will now write the code by themselves and all you have to do is drink coffee.</p><p>So the natural question is: why one more of these, and how is it any different? I will explain, but I have to start from far away, because Swarmery did not appear in one evening. It grew out of several years of my work with AI.</p><blockquote>Swarmery did not appear in one evening. It grew out of several years of my work with AI.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r5haC8lGu0htoUk6Xe0Gow.jpeg" /><figcaption>A new wrapper appears every week, and inside most of them is the same chat.</figcaption></figure><p>When OpenAI opened ChatGPT to everyone at the end of 2022, I got interested right away and started trying it in my everyday work on projects. At first everything happened inside the chat. Sessions were small, and giving the model the context of a whole project was simply impossible, because it could only “keep in its head” a small amount of text.</p><p>So the tasks I gave it were small too: fix a function or write a new one. I described what the function should take, what it should return and how exactly it should work, copied a piece of code into the chat, got an answer and moved it back into the project. It already helped, but it still felt like talking to a very smart person who had never seen your project and only sees the piece you showed them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1kReUKt4yLg2Wy3xWGrIQ.jpeg" /><figcaption>2022: I pushed small pieces of code through the chat, and the model never saw the whole project.</figcaption></figure><p>Over time more interesting plugins appeared for WebStorm and Visual Studio Code. By the way, I have preferred WebStorm since the Eclipse days, but that is a separate story I might tell some day, not now.</p><p>These plugins also did not see the whole project, but working became more convenient, because the AI lived right inside the editor. You could already select a whole class and ask it to check it, find problems or add something new, and you did not have to copy code back and forth all the time.</p><p>And then Augment Code appeared, and for me it was a real breakthrough. The reason is simple: <strong>Augment was the first tool that kept the context of the whole project</strong>.</p><p>How did it work? It indexed the entire repository, meaning it went through all the files and built something like a map of the code, where you can see what is connected to what, which function is called from where, and where similar things live. When I gave it a task, it did not try to push the whole project into the model. It used this map to find exactly the pieces that mattered for the task and worked with those. And the index kept updating while I was writing code, so it never fell behind the real state of the project.</p><p>As a result you could say something like “add one more payment method here the way we did it for the others”, and it found by itself how we did it for the others. For big projects this was a completely different quality of work, and while Augment was on plans limited by the number of messages, everything was great.</p><p>Then everything changed. At the time I thought investors had pushed them to switch to paying for tokens, but when I started digging, it turned out a bit differently. In autumn 2025 Augment itself announced that from October 20 it was moving from paying per message to paying with credits, which are counted from how much it actually costs to process a request.</p><p>Their explanation was this: one message can be a simple question, or it can be a task where the agent reads code for an hour and runs dozens of commands, and you cannot charge the same for both. They even gave an example of a user on the $250 plan who sent 335 requests every hour for a whole month and cost the company almost $15,000 a month.</p><p>So the real reason was the economics of the models themselves, not investors. But for me the result was the same: with how intensively I worked, Augment became unjustifiably expensive, and a lot of users reacted the same way back then.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxgE-9PNC2OAR_GtXJCOWg.jpeg" /><figcaption>Augment found the right pieces of code through its map of the project, until the new pricing emptied my wallet.</figcaption></figure><p>Luckily, by that time there were already other options. OpenAI released Codex, and Anthropic released Claude Code, and both worked right in the terminal, inside the project folder, which means they saw all of it. I tried both, and I liked working with Claude more. Why? There are several reasons.</p><p>The first is the quality of the code and how it follows instructions: when I describe a task with constraints, Claude more often does exactly what I asked and makes targeted changes instead of rewriting half the file.</p><p>The second, and for me probably the main one, is that <strong>Claude Code was never just a chat in the terminal, it was a construction kit from the very beginning</strong>. You can describe your own agents with different roles, give them separate instructions and sets of tools, attach your own scripts to certain events (for example, right before an agent runs something), connect external services, and later plugins appeared that you can share between projects. So with it you can build your own system, not just use a ready one.</p><p>It is interesting that opinions online split in roughly the same way. Developers who choose Claude Code most often write about the quality and carefulness of the changes, that it understands big projects better, and about the rich set of features around it. Those who choose Codex most often praise the limits: for the same $20 you can work almost a whole day on Codex, while on Claude the limits run out much faster, and they also say Codex spends tokens more economically.</p><p>And honestly, that is true, Claude Code limits stopped me more than once too. Many people now simply use both and split tasks between them. But for what I wanted to build, the ability to put together my own system mattered more, so I stayed with Claude.</p><p>And what exactly did I want to build? Well, here everything comes back to Augment. Back when agent systems were not yet hyped, I started, together with Claude, to take apart little by little how Augment worked, what exactly it did with context and how it split tasks, and to try to put together something similar with my own hands on top of Claude Code. At first it was just agents and instructions that I copied from project to project (I wrote in my first post about how that ended), but that is exactly how Swarmery started to be born.</p><p>And so I don’t leave you without any answer to what Swarmery is now, I’ll say it briefly. It is a small program that runs on my computer next to Claude Code: it helps plan a task, hand it out to a team of agents, check what they did, and see everything that is happening in one place.</p><p>But how exactly it got there does not fit into one post, so I split the story into three parts. In the second one I will tell why I tried kanban boards for agents and gave them up, and how the planner appeared in Swarmery. And in the third, how the agent system stopped being a black box for me and started learning from its own work.</p><p>If you want to peek ahead, the code is open on <a href="https://github.com/atretyak1985/swarmery">GitHub</a>.</p><p>Next part: <a href="https://medium.com/p/ebe6f30e0923">How Swarmery Came to Be. Part 2: Why I Replaced the Kanban Board with Plans</a></p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/how-swarmery-came-to-be-part-1-from"><em>https://swarmery.substack.com</em></a><em> on September 28, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c8cbd06d52c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What a Book from 2004 Taught Me About My Agents]]></title>
            <link>https://swarmery.medium.com/what-a-book-from-2004-taught-me-about-my-agents-206470dd84b1?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/206470dd84b1</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 12:57:30 GMT</pubDate>
            <atom:updated>2026-09-28T16:48:24.959Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to tell if an agent really understood the task, and how a system can learn when the model can’t</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ATyV_sXhoLBfj9mV.jpeg" /><figcaption>Before the work starts, the agent writes down its forecast. When it is done, Swarmery compares it with what actually happened.</figcaption></figure><p>When I was writing the previous post about the retrospective, I thought that the main thing in an agent system is to be able to count errors and learn from them. And it really works: the advisor finds an agent that makes mistakes often, suggests changing its instruction, and a week later checks by itself whether it became better. But lately one question did not leave me alone, and it has nothing to do with error counts. How do you understand that an agent really understood the task, and did not just somehow push it through to green tests?</p><p>The answer came from an unexpected place, and to explain where from, I need to go a bit back. Even before Claude, ChatGPT and this whole wave appeared, I was studying data science and building my own local models.</p><p>At that time somebody recommended me a book which, as I was told, every person who starts working with artificial intelligence and models has to read. It is “On Intelligence” by Jeff Hawkins, the same person who founded Palm. The book came out back in 2004, and at that time it really fascinated me, I remember that for several days I was walking around and thinking only about it.</p><p>But with time there was work, projects, other technologies, and it was simply forgotten.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NwcBRksDw1eGvTX0.jpeg" /><figcaption>“On Intelligence” by Jeff Hawkins, 2004: the brain is a machine that constantly predicts.</figcaption></figure><p>And recently I remembered it again. The reason is simple: I was doing a big audit of Swarmery for the new model, Opus 5.5, I was looking at how agents finish their work, and at some moment I thought that all of this looks very similar to what Hawkins wrote about. So I decided to figure out whether his ideas can somehow be connected with Swarmery.</p><p>So what is in that book? If very simply, Hawkins says that the brain is not a computer that calculates something, but a machine that constantly predicts.</p><p>You walk into your room and you notice nothing, because everything is as you expected. But if somebody moved a chair, you notice it immediately, even if you were not looking for it. So the brain is always making a forecast of what it is going to see or hear, and while the forecast matches, no attention is needed. But when it does not match, this is exactly where the attention goes, and this is exactly what the brain learns from.</p><p>Hawkins believed that understanding is the ability to predict correctly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3hFYdcRoQuDs1Nu1.jpeg" /><figcaption>While the forecast matches, no attention is needed. When it doesn’t, this is where we look and what we learn from.</figcaption></figure><p>It is interesting that twenty years later it turned out he was right about a lot. Modern language models in essence do exactly this: they predict the next word, and everything we see now grew out of that. But in one place he was wrong, he thought that we need to copy the structure of the brain, and what won in the end was ordinary neural networks, a lot of data and a lot of compute. One can talk about this for a long time, but this post is not about that.</p><p>What caught me was something else. Hawkins describes two things that agents do not have now.</p><p>The first one: an agent does not predict anything before it starts the work. It gets a task, does it, and at the end we only see the result, whether the tests passed or not. We never know if it expected it to go exactly this way.</p><p>The second one: a model does not learn after it was trained. Everything an agent found out today in my code disappears together with the session, and tomorrow another agent steps on the same rake.</p><blockquote>Hawkins believed that understanding is the ability to predict correctly.</blockquote><p>And here I thought, what if we do it the way Hawkins describes, only not in the brain but in Swarmery?</p><p>The idea looks like this. Before an agent starts changing code, it shortly writes down its forecast: which parts of the code it will touch, roughly how much work it will be, how much time it will take, what risks it sees and how sure it is about all this. This is not a plan and not a limit, and I will explain why this matters. If the forecast becomes a fence, the agent will start bending the work to match its own forecast, and I need the opposite: I want it to do everything the task needs, and the forecast should just show how it understood the task at the beginning.</p><p>Then, when the agent has finished, Swarmery itself counts what actually happened: which files changed, how much code, how much time, how much money, whether the tests passed. There is no artificial intelligence here, only exact data from git and from the session logs, because if you measure the result with a model, it is not clear anymore who is checking whom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_-R2BBlrscGeedoE.jpeg" /><figcaption>Surprise is the difference between the forecast and the fact: files, time, money, tests.</figcaption></figure><p>And then comes the most interesting part: Swarmery compares the forecast with the fact, and from this comes what I called surprise. If the agent thought it would change two files in one part of the code in half an hour, but in reality it also touched three more modules and worked for three hours, this is a big surprise. And even if all the tests are green, this is a signal that the agent understood the task badly, or that in the code there is something nobody expected. This is exactly where I want to look first, and not at everything in a row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ypn_jEkxEhlSoQQq.jpeg" /><figcaption>I look first at the runs with a big surprise, even if all the tests are green, and not at everything in a row.</figcaption></figure><p>To make it clearer, I was explaining this idea with an example of a renovation. A foreman looks at a kitchen and says that in one day they will replace the wiring and they will only touch the kitchen.</p><p>But in reality they had to open the wall in the bathroom and worked for three days, because in this house the kitchen wiring goes through the bathroom. The work itself is done, but the difference is big, and a conclusion can be made from it. If this conclusion is written down, then the next crew in this house will already know about the bathroom in advance.</p><p>And this is exactly the second part, about the model not learning. The model weights are frozen and I cannot change them, but <strong>the system around the model can learn</strong>.</p><p>So from every big surprise that the agent was able to explain, Swarmery will make a short lesson: one sentence, which part of the code it is about, and the evidence, which run it came from. A lesson does not turn on by itself, I turn it on. And after that it comes only to the agents that, according to their forecast, are going to work in the same part of the code, and not to everybody.</p><p>I deliberately do not want to put lessons into the common project memory, because it is loaded into every session and it is already too big.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zAvkJNJshR4VJqpg.jpeg" /><figcaption>The model weights are frozen, but the system around the model can learn through short lessons.</figcaption></figure><p>And one more thing I took from Hawkins: the brain does not only remember, it also forgets what does not help. So a lesson lives only while it works. If after the lesson started going to agents there are not fewer surprises in this part of the code, or the code there changed a lot, or nobody used the lesson for two months, Swarmery will suggest removing it. I think that without this, any memory like this would turn into a garbage dump in half a year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3JOTH_-1_5Sw7anv.jpeg" /><figcaption>What an agent found out disappears with the session. Only lessons from explained surprises are kept, and only while they help.</figcaption></figure><p>To be honest, for now this is a plan and not a finished thing. I split it into seventeen steps, and first I need to finish the preparation for the new model, because without an exact count of the money and without a correct way to know when an agent really finished the work, there is no sense in comparing a forecast with a fact.</p><p>In parallel I want to add a small local model on my own server, which will quickly answer simple questions like “did the agent finish, or did it just stop to report”, and there will be a separate post about it. And at the end I put a separate step where, after thirty phases with forecasts, I will look at real numbers: does surprise really show problems earlier than I find them myself, and do lessons reduce these surprises. If not, I will remove it and I will write exactly that.</p><p>I like that an idea from a book which I read even before this whole boom, and which was lying somewhere in my memory for a long time, suddenly found its place in a very practical thing. Maybe sometimes it is worth coming back to old books, because some of them were written about things we only now came to.</p><p>The repository is open: <a href="https://github.com/atretyak1985/swarmery">github.com/atretyak1985/swarmery</a>. If you also thought about how to make agents learn from experience and not start from zero every time, I am really curious how you solved it.</p><p>This is the third post. The previous ones were <a href="https://swarmery.substack.com/p/swarmery-how-i-stopped-copy-pasting">How I Stopped Copy-Pasting Agents Between Projects</a> and <a href="https://swarmery.substack.com/p/retro-the-agent-system-that-improves">Retro: The Agent System That Improves Itself</a>.</p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/what-a-book-from-2004-taught-me-about"><em>https://swarmery.substack.com</em></a><em> on September 23, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=206470dd84b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retro: The Agent System That Improves Itself]]></title>
            <link>https://swarmery.medium.com/retro-the-agent-system-that-improves-itself-1a24737ff59e?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a24737ff59e</guid>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 09:10:14 GMT</pubDate>
            <atom:updated>2026-09-28T16:47:04.538Z</atom:updated>
            <content:encoded><![CDATA[<p>After the first post, I turned my attention to Swarmery and started using it heavily in my own projects. Finishing tasks got easier, and planning new ones got faster. In an agent system, the most important thing is setting the task up correctly: when you break work into stages, and each stage says not only what to do but who it goes to, how it should be done, and what counts as success, the outcome changes completely. That deserves a separate post, and it is not what this one is about.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JcNBnzmXWKpirHnWLNanQ.jpeg" /></figure><p>The agents work and do what I ask. But I wanted to audit them.</p><p>How well did they actually complete the task? How often did they fail? Should a different agent have taken this one instead?</p><p>That is what this post is about: a retrospective for the agent system.</p><p>For those who didn’t read the first post, a quick reminder of what Swarmery is. It lives on my laptop and watches over my Claude Code agents. It reads the session logs Claude Code writes to disk anyway and collects statistics from them.</p><p>It also carries a set of plugins that put the same set of agents into every one of my projects. Nothing is sent anywhere; everything stays on my machine.</p><p>So, the retrospective.</p><p>When I first started working with agents, there was a problem I couldn’t put my finger on for a long time. An agent would finish a task, I’d look at the result, approve it or send it back for revision — and that was the end of it. The next day the same agent got another task and made the same mistake, because nobody had told it it was wrong the day before.</p><p>A few times I caught this and edited the agent’s instructions by hand. But I couldn’t cover every case: there were too many tasks each day, and I no longer remembered which agent had made which mistake.</p><blockquote>The system worked, but it didn’t learn. Every day started from the same place.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J8ydjc2bj4UVq6MyBnv_Tw.png" /></figure><p>Retrospective was supposed to fix that. The idea is simple: when the work is done, look back, understand what got in the way, and make sure it doesn’t happen again. Teams of people do this every two weeks. Here, the system had to do it itself — and not every two weeks, but all the time.</p><p>Here’s how it came out. Every agent leaves a trace as it works: which tools it called, where it hit an error, how many times it retried, what it cost.</p><p>When a task is finished, the agent writes a short report on what it did and what didn’t work. Separately, there are tests for the agents themselves.</p><p>Retrospective gathers all of this and shows a card for each agent: how it performs, and where it stumbles most often. And there is a separate list of what’s getting in the way of work in general — not for one agent, but for the whole system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rbZ2gcJXsE5TjqCX9mw7Og.png" /></figure><p>The first thing I had to stop and admit: <strong>showing a card is not a retrospective</strong>. I looked at the cards, nodded, and went back to work — and nothing changed.</p><p>A retrospective only means something when it produces a concrete change. So the next thing I added was an advisor. It looks at the collected data and says: here is what hurts, here is why, and here is what I suggest changing.</p><p>I should explain why I didn’t just let it make the changes itself. Advice from a neural network is also just text, and text is very easy to write convincingly even when there is nothing behind it.</p><p>The first pieces of advice I got were exactly that: beautifully written, and when I tried to find out what they were based on — nothing. So the advisor now has a rule: every piece of advice must reference specific data from the retrospective.</p><p>If there are no references, or the references are invented, the advice is rejected and I can see why. It mattered to me that advice with evidence and advice without evidence should not look the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJhr6IrsOYYVimG3tCybmQ.png" /></figure><p>This is the one place in the whole loop where a human is required. I look at the advice, and if I agree, I accept it. From that moment it stops being advice and becomes an ordinary plan, like any other task in Swarmery: clarifying questions, phases, cards on the board.</p><p>Improving the system runs through the same machinery as any other work. The agents pick up the phases and carry them out. I didn’t have to build a special mechanism for this — everything needed was already in place.</p><p>Here is why I call this self-improvement and not just reporting. The moment I accept a piece of advice, the system records what the metric looked like then — that metric is the reason the advice existed in the first place.</p><p>When the agents make the change, and it lands in the repository, the system notices that the file with the agent’s instructions has changed and moves the advice to “implemented”. I don’t have to tell it.</p><p>A week later it compares the current number with the one it remembered and decides whether the advice actually helped. If it did, it closes the advice. If not, it comes back — and the next retrospective already knows the first attempt failed.</p><p>And there was one case I liked most of all. One piece of advice was about a certain class of errors, and while it sat waiting for me, those errors stopped happening — I had changed something elsewhere. Before, advice like that would have hung around forever. Now the system saw that the reason was gone and closed it on its own.</p><p>The repo is open: <a href="https://github.com/atretyak1985/swarmery">github.com/atretyak1985/swarmery</a>.</p><p>This is post no. 2. The first one is <a href="https://swarmery.substack.com/p/swarmery-how-i-stopped-copy-pasting">How I Stopped Copy-Pasting Agents Between Projects</a>.</p><p><em>Originally published at </em><a href="https://swarmery.substack.com/p/retro-the-agent-system-that-improves"><em>https://swarmery.substack.com</em></a><em> on August 31, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a24737ff59e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swarmery: How I Stopped Copy-Pasting Agents Between Projects]]></title>
            <link>https://swarmery.medium.com/swarmery-how-i-stopped-copy-pasting-agents-between-projects-04c54aab9c3a?source=rss-2efbd03804af------2</link>
            <guid isPermaLink="false">https://medium.com/p/04c54aab9c3a</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[Andriy Tretyak]]></dc:creator>
            <pubDate>Fri, 24 Jul 2026 12:24:44 GMT</pubDate>
            <atom:updated>2026-09-28T16:49:08.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUFs-OyDyNxaxPph-xa2aA.jpeg" /></figure><p>Syncing agents was the easy part — and mostly a solved one. The interesting problems started after: seeing what 15 agents across 6 projects actually do, measuring whether they’re any good, and finally letting a board drive them. It got to the point where my own dashboard confidently told me two agents were 80–90% broken — and the most valuable insight wasn’t “fix the agent,” it was “fix the way you measure it.”</p><p>But that’s the payoff. Let me rewind to where this actually started — with a file I kept opening by accident.</p><p>I noticed the problem the fourth time in one week I opened the same commit-message.md file — and couldn’t remember which project held its “correct” version.</p><p>It was an ordinary subagent for generating commit messages. Nothing fancy. But I’d tweaked it in one repo — taught it to understand conventional commits with project-specific scopes — and suddenly realized three other projects were still running older, dumber copies of it.</p><p>Classic copy-paste rot. Except now I wasn’t copy-pasting a utility. I was copy-pasting an assistant’s behavior.</p><p>That tiny, almost stupid annoyance is where Swarmery came from. But — spoiler — it’s also the least interesting problem I ended up solving. Stick around past it.</p><figure><img alt="Diagram showing four identical agent files across four different projects, out of sync with each other, with a question mark over which version is correct." src="https://cdn-images-1.medium.com/max/1024/1*6xj1wbsHyPBmfX-dBKEXBw.jpeg" /><figcaption>One agent, four projects, four different versions. Multiply by 15 agents.</figcaption></figure><h3>How it started: agents as a way to improve my own experience</h3><p>When I first got serious with Claude Code, it wasn’t code generation that hooked me. It was the idea that I could describe a role — “you’re a tech-lead who breaks a task into phases,” or “you’re a security-auditor hunting the OWASP Top 10” — and get predictable behavior out of it.</p><p>So I started building those agents for myself. One or two at first. Then skills on top of them. Then hooks that guard sensitive files. Then commands like /dashboard and /land.</p><p>Each of them solved a concrete pain in my daily development loop. And each was born locally — right in the .claude/ of whatever project I happened to be sitting in.</p><p>That worked exactly as long as there was one project. My first fix, before any of this grew up, was the boring one everyone reaches for: a shared folder of agents, pushed to a repo and symlinked into each project. Hold that thought — it matters in a minute.</p><h3>The moment it broke</h3><p>There were many projects now.</p><p>And that surfaced a bit of math I’d underestimated. With 6 projects and 15 agents, that’s 90 copies that are supposed to stay in sync. In practice, they never are.</p><p>I’d fix a routing bug in tech-lead in one place — and forget about the five others. A week later I’d catch myself thinking, “why is this agent dumber than I remember?” — because it was a three-month-old version of itself.</p><blockquote>We spent years learning to hate code duplication. But duplicated agents slipped in unnoticed — because hey, it’s “just markdown,” not code.</blockquote><p>I needed one source of truth. Not for libraries. For assistants.</p><p>“But Claude Code already has global agents — just use ~/.claude/agents/.”</p><p>That’s the first thing every experienced Claude Code user says when they hear this story. It’s a fair objection, and it was literally my step one.</p><p>Global agents — and that shared folder symlinked into each repo — get you exactly as far as “every project runs the identical agent.” They fall apart the moment that stops being true. And it stops being true fast:</p><p>Version divergence is the whole problem, and “global” doesn’t solve it. The day tech-lead needs conventional-commit scopes here but not there, one global copy is no longer an option. You either fork it back down into the project — and drift is back — or you cripple it for everyone else to keep them identical.</p><p>Specialized agents accumulate per project. Over time each repo grows agents that are meant to be local to it. A single global bucket has no notion of “core vs. this-project-only” — it just flattens everything into one namespace and hopes.</p><p>There’s no lifecycle. Global agents have no semver, no changelog, no /plugin update, no controlled rollout. For one dev on one machine that’s fine. The moment you want to share behavior across projects — or across people — it’s the exact same “which copy is correct?” question, just moved up one directory.</p><p>So the symlinked global folder isn’t wrong — it’s just the bottom rung. Global-vs-project is a false binary.</p><p>The real problem was never where the file lives. It’s versioning and promotion. And that’s a thing a plain folder, global or not, will never give you.</p><h3>First real fix: a plugin marketplace, not a shared folder</h3><p>So Swarmery became a plugin marketplace for Claude Code.</p><p>The architecture landed like this:</p><ul><li>One vendor-neutral core plugin—everything every project needs.</li><li>Optional domain packs on top: web-pack, infra-pack, uav-pack, iot-pack, lsp-pack, graphify-pack, architecture-pack.</li><li>A project enables what it needs through its own .claude/settings.json, and injects its “flavor” (app names, scopes, domain) at runtime via .claude/project.json.</li></ul><p>The one rule that saved me from chaos I call the graduation rule — flow goes UP only:</p><ol><li>A new component is born local, in one project’s .claude/.</li><li>When a second project needs it — it graduates into a domain pack.</li><li>When everyone needs it — it graduates into core.</li></ol><p>Never the other way. Framework files don’t trickle down into projects. And if a project happens to have a local component with the same name — it overrides the plugin one. That’s not a fork, it’s the intended override mechanism.</p><p>That’s how “90 copies that are never in sync” turned into “one component + /plugin update.”</p><figure><img alt="Three-tier graduation-rule diagram: components rise from project level to domain pack to core, with copy-down explicitly forbidden." src="https://cdn-images-1.medium.com/max/1024/1*yWVKAOP0Rlpkcv63IKpNYw.jpeg" /><figcaption>The rule that kept the chaos out: flow goes up only.</figcaption></figure><h3>Second pain: I couldn’t see what my agents were even doing</h3><p>I’d fixed syncing. But a new blind spot opened up.</p><p>When you’ve got many agents running in background sessions, you literally can’t see the picture. How many sessions are running? Which one is stuck? How many tokens did that particular subagent burn? What went wrong in yesterday’s run?</p><p>Claude Code stores session transcripts in ~/.claude/projects/ as .jsonl. The data is there — it’s just unreadable for a human.</p><p>So the next chunk of Swarmery became a control plane: a single Go daemon with an embedded (via go:embed) React dashboard, which indexes those transcripts into a local SQLite and serves a dashboard on <a href="http://localhost:7777.">http://localhost:7777.</a></p><p>No cloud. No shipping transcripts anywhere. Everything stays on my machine — for a tool that sees every prompt I write, that wasn’t up for debate.</p><p>What it does today:</p><ul><li>Session management — running / stuck / done, with the ability to stop a stuck one.</li><li>Search over everything — full-text, Cmd+K.</li><li>Cost per agent — not “what did the session cost,” but how much a specific subagent burned across its turns.</li><li>Notifications and auto-approve for routine approvals.</li><li>Plugin toggles right on the project card — flip a pack on without hand-editing configs.</li></ul><p>So what started as “a folder of markdown agents” grew its own app for supervising them.</p><figure><img alt="Screenshot of the Swarmery control plane dashboard showing agent session states and cost per agent." src="https://cdn-images-1.medium.com/max/1024/1*Jdek1FFVVAa609Y0JaC0Ag.jpeg" /><figcaption>A local daemon on :7777 turns raw transcripts into a readable picture of every agent session.</figcaption></figure><h3>Third pain — the most interesting one: are my agents any good?</h3><p>This is where I first felt I was building a system, not a tool.</p><p>Seeing sessions is nice. But the real question is different: are my agents getting better over time, or am I just accumulating technical debt in prompts?</p><p>That’s how the retro section was born. It builds scorecards for each agent from real run artifacts. And it hands me things that changed how I look at them:</p><ul><li>Failed-run share per agent.</li><li>An advisor that suggests what specifically to tweak.</li><li>Raw, sometimes unpleasant numbers.</li></ul><p>Here’s an honest example from my own data. The metric showed implementation-agent at a 90% failed-run share, and code-auditor at 80%. First reaction: “everything’s broken, the agents are toast.”</p><p>Then I dug in — and it turned out the metric itself was noisy. It was counting as failures things that weren’t. The most valuable insight from retro wasn’t “fix the agent,” it was “fix the way you measure the agent.”</p><blockquote>The most dangerous dashboard is the one confidently showing the wrong number. Retro isn’t there to admire green charts — it’s there to catch the lying red ones.</blockquote><h3>The next step: from watching to driving</h3><p>Here I have to admit something uncomfortable.</p><p>Despite all of this — marketplace, dashboard, retro — I still launch every task by hand. Open a terminal, start a session, wait. Swarmery sees everything, but does nothing itself. It observes.</p><p>The next big step, the one I’m building now, is to turn it into a tool that drives the work.</p><p>The mechanics are simple to state: an active task board (kanban: Triage → Todo → In Progress → In Review → Done), and on top of it — a dispatcher in the daemon. It takes the top task from Todo, creates an isolated git worktree swarm/&lt;task-id&gt;, and spawns a real headless session — claude -p — inside it. The session ends, automatic verification stamps a verdict.</p><p>To be honest about where this actually stands: the board, the dispatcher, headless spawn with gates, isolated worktrees, and auto-verification are already merged and running against my own repo — I’m dogfooding them daily. Routines-on-cron and the embedded terminal are the parts still landing. I’m telling you what shipped, not just what I sketched.</p><p>And here’s the single most important engineering decision of the whole project.</p><p><strong>I am deliberately NOT building my own execution engine.</strong></p><p>I looked closely at how other open-source projects and teams building agent orchestrators solve this in practice. And I spotted a pattern that repeats over and over: they write their own executor from scratch — their own sessions, their own tools, their own permission engine. The price of that road is enormous: thousands of commits, the lion’s share of which aren’t features but patching the edge cases of that very engine. I took their best ideas — the contracts, the guardrails, the discipline — but deliberately didn’t take their burden.</p><p>Swarmery rides on real Claude Code. Subscription, auth, plugins, skills, the whole core pack — all of it works for free, because it’s the same Claude I use every day. The dispatcher only spawns sessions, it doesn’t simulate them. It’s the same reuse principle as the graduation rule, one level up.</p><p>What makes this loop fit for real life rather than a demo:</p><ul><li>PASS / FAIL / INCONCLUSIVE verdict. The last one is a first-class, separate status: “verification couldn’t reach a conclusion.” Not FAIL. An honest “I don’t know” beats a confident lie.</li><li>File-scope overlap gate. Two tasks touching the same files never run concurrently. Without it, parallel worktrees are a guaranteed merge hell.</li><li>Guardrails against runaway spend: maxConcurrent=2, a global kill-switch, and dispatch only ever triggered by an explicit user action — no auto-claiming tasks behind my back.</li><li>A Swarm-Task-Id: trailer on every commit — deterministic task↔commit attribution instead of fragile time-and-folder heuristics.</li></ul><figure><img alt="Swarmery orchestration diagram: a board task runs as a headless Claude Code session in an isolated git worktree and ends with a PASS, FAIL, or INCONCLUSIVE verdict." src="https://cdn-images-1.medium.com/max/1024/1*FpJxL7cFCFr6U-3RcALA6A.jpeg" /><figcaption>The dispatcher doesn’t fake an agent — it spawns a real Claude Code session and waits for an honest verdict.</figcaption></figure><p>The board also drags in the things that were missing: Planning Mode (idea → clarifying questions through the same approvals channel → a plan in the workspace → tasks on the board), routines on cron (a nightly advisor re-run, a weekly security-audit), and an embedded terminal right in the dashboard.</p><p>A side effect, but an important one: my workspace of plans stops being a place I poke by hand. Files stay the storage medium — but the platform becomes the only interface.</p><h3>What Swarmery is right now</h3><p>Put it all together, and a tiny annoyance — “I’m sick of copy-pasting agents” — grew into a full system for working with agents:</p><ul><li>Distribution — a marketplace of core + packs with semantic versioning and /plugin update.</li><li>Management — sessions, projects, agents in one dashboard.</li><li>Observability — cost, search, state, notifications.</li><li>Reflection — retro analysis, scorecards, advisor.</li><li>Orchestration (in progress) — board, dispatcher, worktrees, auto-verification, routines.</li></ul><p>And most importantly — it self-hosts. Swarmery is itself a Swarmery consumer: this repo enables core@swarmery like any other project. I eat my own dog food every day, and it’s the best bad-decision detector I know.</p><p>The whole thing is open-source, if you want to see how the pieces above actually fit together:<a href="https://github.com/atretyak1985/swarmery"> github.com/atretyak1985/swarmery</a></p><h3>What I took away from this</h3><p>The biggest lesson isn’t about Claude, and it isn’t about Go.</p><p>It’s that an agent system is not a collection of prompts. It’s a product with its own lifecycle. It has distribution, versioning, observability, quality feedback — and, eventually, execution. Exactly what we demand from any serious piece of software.</p><p>The second lesson, expensive to learn firsthand: the strongest engineering decision is the one about what NOT to build. Your own agent execution engine looks tempting right up until the moment you’re patching its edge cases instead of doing actual work.</p><p>I started out wanting to get rid of four copies of one commit agent. Then I taught the system to tell me which of my agents is dumb today, and why. And now I’m steering it toward not just telling me — but actually taking a task, running it in an isolated worktree, and honestly reporting back: PASS, FAIL, or “I don’t know.”</p><p>Without building yet another engine I’d have to babysit.</p><p>Now over to you. How many copies of the exact same agent are scattered across your projects right now? And do you even roughly know which one does its job worst?</p><p>And if you’ve already tried to drive agents from a board, not just watch them — tell me in the comments where it hurt most: runaway spend, merge conflicts across parallel worktrees, or trusting auto-verification. I’m genuinely curious who’s already stepped on the same rakes. If this lands, I’ll write up the “board → dispatcher → verification” loop as its own piece, with real numbers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04c54aab9c3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>