<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anton Danilov</title>
    <description>The latest articles on DEV Community by Anton Danilov (@antondanv).</description>
    <link>https://dev.to/antondanv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4268451%2F81106d41-64b6-4292-a72a-d7bb2698816d.png</url>
      <title>DEV Community: Anton Danilov</title>
      <link>https://dev.to/antondanv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antondanv"/>
    <language>en</language>
    <item>
      <title>How to make Claude Code and Codex limits last: fewer redos, not shorter prompts</title>
      <dc:creator>Anton Danilov</dc:creator>
      <pubDate>Fri, 27 Nov 2026 08:28:42 +0000</pubDate>
      <link>https://dev.to/antondanv/how-to-make-claude-code-and-codex-limits-last-fewer-redos-not-shorter-prompts-ja8</link>
      <guid>https://dev.to/antondanv/how-to-make-claude-code-and-codex-limits-last-fewer-redos-not-shorter-prompts-ja8</guid>
      <description>&lt;p&gt;When your Claude Code limit runs out by midweek, the first instinct is to trim prompts. But the prompt is a small part of the bill. Limits are eaten by redos, when the agent misread the task and did it twice. They're eaten by a session that took on three more things “while it was at it”, by a top model fixing a typo, and by five agents where two would do.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/antondanv/treeyard" rel="noopener noreferrer"&gt;Treeyard&lt;/a&gt; is a free, open-source (Apache 2.0) terminal tool: you plan a project as a tree of goals and run Claude Code, Codex, Antigravity and OpenCode sessions right from its nodes. It plugs these leaks with the way the work is set up, not with willpower.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj8f80cq00x8ki0gyxynx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj8f80cq00x8ki0gyxynx.png" alt="treeyard in a terminal: a coffee shop's goal tree with milestones, tasks, a node waiting for the bank and two ideas" width="800" height="288"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;A planted tree: the goal at the top, the first milestone with its tasks, a branch for repeat orders, a node that waits for the bank and two ideas parked for later.&lt;/em&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;The most expensive work is work done twice. A criterion before the work and a plan before the code cost less than a second attempt.&lt;/li&gt;
&lt;li&gt;One task, one session: a long conversation gets pricier with every turn.&lt;/li&gt;
&lt;li&gt;Match the model and effort to the task, check with a command, cap parallelism.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Where the limit actually goes
&lt;/h2&gt;

&lt;p&gt;We covered a short session start &lt;a href="https://treeyard.ru/blog/fewer-tokens-in-claude-code/" rel="noopener noreferrer"&gt;separately&lt;/a&gt;: a session opened from a node starts at about 3 thousand tokens instead of 65 thousand for the whole plan. But most tokens go into the work itself. Here's where they leak:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Where it leaks&lt;/th&gt;
&lt;th&gt;How Treeyard plugs it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;The agent misread the task, so it starts over&lt;/td&gt;
&lt;td&gt;Every node has a “done when”, and the session starts with a plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One session for three tasks&lt;/td&gt;
&lt;td&gt;A node is one session; a new idea is a new node&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A top model fixing a typo&lt;/td&gt;
&lt;td&gt;Model and effort are picked for every launch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Check that everything works” — another agent turn&lt;/td&gt;
&lt;td&gt;The node's check is a command, no agent involved&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Five agents hit the window mid-task&lt;/td&gt;
&lt;td&gt;A queue with a cap that pauses when the window is full&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h2&gt;
  
  
  A redo is the most expensive line on the bill
&lt;/h2&gt;

&lt;p&gt;The agent takes a vague task, does its own thing, you explain, it redoes it. Every attempt pays for the whole context again. In Treeyard every node has a “done when”: one sentence you can see or run. Can't write it? The node menu has “Write a "done when"” and “Break into steps”: jobs for an agent without a session, read-only and offline.&lt;/p&gt;

&lt;p&gt;Then there's the “plan” start. Claude Code opens in its plan mode and edits nothing until you agree. Fixing a five-line plan is cheaper than rolling back code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw26seh0lsfcoaea20c1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw26seh0lsfcoaea20c1v.png" alt="The node's menu in treeyard: a new session of any CLI, and agent jobs without a session — break into steps, write a “done when”, run the check" width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The node's menu: start a session in plan mode, or let an agent break the node into steps or write its “done when” without opening a session.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Short sessions cost less than long ones
&lt;/h2&gt;

&lt;p&gt;Every new turn carries the whole conversation. A session that spends three hours finishing “just one more” neighbouring thing pays for its entire history at every step. Treeyard's rule: a node is one session or one PR. More than about ten items inside, or “just a bit more” after it's closed, means the node needs splitting.&lt;/p&gt;

&lt;p&gt;A new thought in the middle of the work becomes a node with the “idea” status, and the session goes back to its own node:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;treeyard add &lt;span class="s2"&gt;"Coffee quiz: find your roast"&lt;/span&gt; --parent &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --status idea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next session starts with a clean slate, but not from scratch: it gets &lt;a href="https://treeyard.ru/blog/pick-up-where-the-agent-left-off/" rel="noopener noreferrer"&gt;the node's journal&lt;/a&gt; by itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model and effort to fit the task
&lt;/h2&gt;

&lt;p&gt;A top model on high effort burns through the limit faster, and there's no point spending it on small stuff. In Treeyard the model and effort are picked for every launch: the agent menu shows each CLI's start, model and effort, and each CLI's last launch is remembered separately. Planning a tricky node goes to the top model; renaming a button goes to a smaller one or to low effort. &lt;code&gt;treeyard models&lt;/code&gt; lists the models and effort levels, and the project defaults are &lt;code&gt;model&lt;/code&gt; and &lt;code&gt;effort&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7cx5gnh2yuklojdneuri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7cx5gnh2yuklojdneuri.png" alt="The agent menu in treeyard on the “Checkout with Stripe (test mode)” node: Claude Code · plan · opus · high, with Codex, Antigravity and OpenCode below, each with its own settings" width="799" height="327"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The agent menu: every CLI shows how it starts (plan or do), its model and effort. The last launch, with the same settings, is on top.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Check with a command, not an agent turn
&lt;/h2&gt;

&lt;p&gt;“Check that everything works” is one more agent turn, and what you get back is its word. A node has a “check” field: the command that proves the result — tests, &lt;code&gt;curl&lt;/code&gt;, a script. The &lt;code&gt;t&lt;/code&gt; key runs it without an agent, so it costs nothing from your limit. When the agent finishes, it also shows the command and its output instead of writing “done”.&lt;/p&gt;

&lt;h2&gt;
  
  
  How many agents at once
&lt;/h2&gt;

&lt;p&gt;Parallel agents share one subscription window. Five at once drain it faster, and a session that hits the limit stops mid-task — until the window resets, you're left holding unfinished work.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qb2xzlq2tmmhc62b41h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qb2xzlq2tmmhc62b41h.png" alt="Three agents at once in treeyard: Claude Code writes the checkout in a pane next to the tree, Codex waits for an answer, Claude Code works in the background" width="799" height="367"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Three sessions: Claude Code in a pane next to the tree, Codex waiting for an answer, another Claude Code in the background. The header says “agents working: 2, waiting for you: 1”.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;treeyard queue &amp;lt;id&amp;gt; --parallel 2&lt;/code&gt; runs a branch's nodes in order, no more than two at a time. Before each launch the queue looks at the subscription window, using what the CLI saved itself, without a request to the model. If the window is 90% full (&lt;code&gt;--limit&lt;/code&gt;), new sessions wait for the reset.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Treeyard itself doesn't spend your limit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The tree, the queue and the node's check run without a model. Tokens are spent only when you launch an agent: a session, a tree review, or “Break into steps”.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Try it on your project
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install&lt;/strong&gt; — &lt;code&gt;npm install -g @antondanv/treeyard&lt;/code&gt;. You need Node.js 22 or newer and Claude Code, Codex, Antigravity or OpenCode.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plant a tree&lt;/strong&gt; — run &lt;code&gt;treeyard&lt;/code&gt; in the project folder. The wizard offers to plant it with an agent, which reads the code, docs and commit history itself, or from a template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open a session from a node&lt;/strong&gt; — &lt;code&gt;c&lt;/code&gt; on a node. The agent gets the node, its criterion and its journal, not the whole plan.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;treeyard models                                &lt;span class="c"&gt;# models and effort levels per CLI&lt;/span&gt;
treeyard add &lt;span class="s2"&gt;"…"&lt;/span&gt; --parent &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --status idea   &lt;span class="c"&gt;# the idea goes to the tree, not this session&lt;/span&gt;
treeyard queue &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;id&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; --pane --parallel 2        &lt;span class="c"&gt;# a branch in order, two sessions at a time&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Questions
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;When don't I need Treeyard?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the task is single and small — a script, a bug, a quick question. Plain &lt;code&gt;claude&lt;/code&gt; or &lt;code&gt;codex&lt;/code&gt; is simpler there: the tree would take longer than the task. The same goes for a one-evening prototype.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does it work with Codex too?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes. Claude Code, Codex, Antigravity and OpenCode launch from a node the same way, and each one's launch settings are remembered separately.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How much does it cost?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nothing: Treeyard is open source under the Apache 2.0 license and installs from npm.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Treeyard is open source&lt;/strong&gt; — &lt;a href="https://github.com/antondanv/treeyard" rel="noopener noreferrer"&gt;Treeyard on GitHub&lt;/a&gt;. &lt;code&gt;npm install -g @antondanv/treeyard&lt;/code&gt;, then &lt;code&gt;treeyard&lt;/code&gt; in your project folder.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was created with the help of AI.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>treeyard</category>
      <category>ai</category>
      <category>claude</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
