<?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: Yahav Ohana</title>
    <description>The latest articles on DEV Community by Yahav Ohana (@yahav_ohana_10166c18e6df4).</description>
    <link>https://dev.to/yahav_ohana_10166c18e6df4</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%2F4022928%2F904a6abb-8c2e-4899-9be1-f7a3fffbd669.png</url>
      <title>DEV Community: Yahav Ohana</title>
      <link>https://dev.to/yahav_ohana_10166c18e6df4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yahav_ohana_10166c18e6df4"/>
    <language>en</language>
    <item>
      <title>Don’t Break the Agent: Lessons in Token Optimization</title>
      <dc:creator>Yahav Ohana</dc:creator>
      <pubDate>Thu, 20 Aug 2026 17:26:38 +0000</pubDate>
      <link>https://dev.to/yahav_ohana_10166c18e6df4/dont-break-the-agent-lessons-in-token-optimization-45np</link>
      <guid>https://dev.to/yahav_ohana_10166c18e6df4/dont-break-the-agent-lessons-in-token-optimization-45np</guid>
      <description>&lt;p&gt;By &lt;a href="https://jfrog.com/blog-author/shay-dahan/?_gl=1*93knic*_up*MQ..*_ga*MTY3MjY2MzkyOS4xNzg3MjQ1MTU0*_ga_SQ1NR9VTFJ*czE3ODcyNDUxNTMkbzEkZzAkdDE3ODcyNDUxNTMkajYwJGwwJGgxMDQ3MjU1MjUx" rel="noopener noreferrer"&gt;Shay Dahan&lt;/a&gt;, JFrog Boost Co-Founder &lt;a href="https://jfrog.com/blog-author/yahav-ohana/?_gl=1*93knic*_up*MQ..*_ga*MTY3MjY2MzkyOS4xNzg3MjQ1MTU0*_ga_SQ1NR9VTFJ*czE3ODcyNDUxNTMkbzEkZzAkdDE3ODcyNDUxNTMkajYwJGwwJGgxMDQ3MjU1MjUx" rel="noopener noreferrer"&gt;Yahav Ohana&lt;/a&gt;, JFrog Boost Co-Founder August 20, 2026&lt;/p&gt;

&lt;p&gt;This one is for the curious souls who wonder how somebody actually builds a harness optimizer — and, more to the point, how they know it works.&lt;/p&gt;

&lt;p&gt;When we &lt;a href="https://jfrog.com/blog/jfrog-boost-saves-ai-coding-tokens/?_gl=1*bwi574*_up*MQ..*_ga*MTY3MjY2MzkyOS4xNzg3MjQ1MTU0*_ga_SQ1NR9VTFJ*czE3ODcyNDUxNTMkbzEkZzAkdDE3ODcyNDUxNTMkajYwJGwwJGgxMDQ3MjU1MjUx" rel="noopener noreferrer"&gt;launched JFrog Boost into public preview&lt;/a&gt;, we told the story of the bill that broke us and the 100 billion tokens we clawed back across JFrog R&amp;amp;D. What that post didn’t cover is the question that consumed most of our engineering time: how do you measure any of this?&lt;/p&gt;

&lt;p&gt;Because it turns out that “we cut 84% of the output” and “we made your session better” are two completely different claims, and only one of them is easy to put on a dashboard.&lt;/p&gt;

&lt;p&gt;This is the first post in a series that opens up how JFrog Boost measures itself, then benchmarks it against the token-saving tools teams are already running. The next post will dig into RTK specifically: where its approach gets the category right, and where its measurement falls short. Everything below is the methodology those benchmarks are built on.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://join.slack.com/t/boost-0wl2605/shared_invite/zt-47e3gh6vo-aw15OzLVAmxpCZ5tkX8OGw" rel="noopener noreferrer"&gt;Join Token Saving Slack Community&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Manifest: Why Boost Exists
&lt;/h2&gt;

&lt;p&gt;The gap we set out to close. Input context is now the dominant line item in an agentic coding bill — by Cursor’s own accountingExternal link., roughly 70% of it. Your agent isn’t paying to think. It’s paying to re-read a pytest log it already understood four turns ago. The waste is real, it’s enormous, and it’s almost entirely invisible from inside the session.&lt;/p&gt;

&lt;p&gt;Why the obvious fix doesn’t work. Once you start looking, you find a shelf full of tools promising 60–90% reduction. We tried them, we borrowed from them, and we kept running into the same three gaps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;They measure the wrong boundary.&lt;/strong&gt; Compression measured at the wrong point in the pipeline flatters itself. More on this below — it’s the most subtle problem in the space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They optimize silently.&lt;/strong&gt; The agent doesn’t know it’s been handed a summary. So when it needs the part you dropped, it can’t ask for it. It guesses, or it re-runs the command, or it spirals.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;They have no runtime feedback loop.&lt;/strong&gt; A benchmark tells you a filter was safe on the tasks you thought to test. It tells you nothing about the 400th session on Tuesday afternoon in a repo nobody on your team has ever opened.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Our approach, in four commitments:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accuracy is the constraint; savings is the objective.&lt;/strong&gt; The goal was never minimal tokens. It was accurate agents that use fewer tokens. If a filter saves 90% and costs one correct answer, it’s a bad filter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimize last.&lt;/strong&gt; Boost is the final stage before output enters the context window — never an earlier one. This is a measurement decision as much as an architectural one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tell the agent what happened.&lt;/strong&gt; Every optimized output carries a marker and a way back. The agent understands the optimization layer instead of being quietly manipulated by it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat every recovery as data.&lt;/strong&gt; When an agent asks for the original, that’s not a failure to hide. It’s the highest-signal event in the system.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything below is what those commitments cost us to actually implement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why We Started Measuring in the First Place
&lt;/h2&gt;

&lt;p&gt;We didn’t set out to build a measurement stack. We set out to build filters.&lt;/p&gt;

&lt;p&gt;What sent us down this road was a period where the numbers stopped making sense. The savings percentages coming off our own dashboards looked fantastic. Meanwhile, sessions didn’t feel proportionally better. Developers weren’t reporting that they’d stopped hitting compaction. Some of the biggest reported wins came from commands where, when we sat down and read the actual output, there hadn’t been that much to cut.&lt;/p&gt;

&lt;p&gt;Something was off, and “the graph is up and to the right” was not an acceptable answer for a tool we were about to push to a thousand engineers.&lt;/p&gt;

&lt;p&gt;Pulling on that thread, we found two separate questions tangled together under one metric:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Am I breaking the agent?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Am I actually saving tokens?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They need completely different instruments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question 1: Am I Breaking the Agent?
&lt;/h2&gt;

&lt;p&gt;The first rule is that no external intervention of ours should make the agent worse — slower, dumber, or stuck. Which raises an awkward problem: how do you detect a confused agent, at runtime, across thousands of live sessions a day?&lt;/p&gt;

&lt;p&gt;You can’t A/B test a developer’s real workday. You can’t read the conversation — Boost collects only high-level telemetry like token counts and macro errors; we never see, store, or transmit code or conversations, and we weren’t about to start. And confusion doesn’t throw an exception. It looks like an agent quietly running ls six times to re-establish where it is.&lt;/p&gt;

&lt;p&gt;So we needed the agent itself to tell us. In band.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Boost suffix.&lt;/strong&gt; Every optimized output ends with a short marker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;Boost filtered 84% of the original output, get original content with boost retrieve 123]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The awareness rule.&lt;/strong&gt; That marker is useless if the agent doesn’t know what to do with it. So Boost ships a bundled skill — a minimal system prompt teaching the agent what the optimization layer is and that the full output is one command away.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The signal.&lt;/strong&gt; Now the interesting part. When an agent calls boost retrieve, it is telling us, unprompted and in production, that the filter we applied removed something it needed. That’s a filter which cost the agent focus instead of buying it focus.&lt;/p&gt;

&lt;p&gt;We emit telemetry on every retrieve. Aggregated across sessions, it becomes a ranked list of our own worst filters — by command, by repo type, by language. A retrieve rate that spikes after a filter change is a regression, and we treat it like one.&lt;/p&gt;

&lt;p&gt;This is the flywheel: the system surfaces its own failures, ranks them by frequency, and proposes where to loosen. Close to self-improving — with a human reviewing every change before it ships. We’re optimizing other people’s context windows. That’s not a place for full autopilot.&lt;/p&gt;

&lt;p&gt;The offline half. Runtime signal tells us where we hurt real users; it can’t tell us whether we’ve drifted on quality overall. For that we run &lt;a href="https://github.com/jfrog/boost" rel="noopener noreferrer"&gt;Terminal-Bench 2.0&lt;/a&gt;: identical task pass rate, roughly 12% lower cost. Same answers, less money. That’s the bar — a savings number that comes with a pass rate attached, or it doesn’t ship.&lt;/p&gt;

&lt;h2&gt;
  
  
  Question 2: Am I Actually Saving Tokens?
&lt;/h2&gt;

&lt;p&gt;Much of our CLI and MCP noise filtering was inspired by &lt;a href="https://github.com/rtk-ai/rtk" rel="noopener noreferrer"&gt;RTK&lt;/a&gt;, a genuinely clever open-source project that deserves credit for putting this problem on the map. But building on that idea surfaced a measurement trap that we think is underappreciated across the whole category.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where you stand in the pipeline determines what you can honestly claim.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A prefix-based optimizer wraps the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rtk git log | &lt;span class="nb"&gt;grep &lt;/span&gt;ABC-123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the shell carefully. The optimizer compresses git log‘s output — and then grep runs. Whatever grep was about to discard, the optimizer already claimed credit for discarding. The tokens it reports saving were never going to reach the context window in the first place. If you intercept output before a grep filter and take credit for what grep would have cut anyway, that isn’t savings. It’s arithmetic.&lt;/p&gt;

&lt;p&gt;Standing early has a second cost: you’re rewriting output before the pipeline that the developer actually designed has finished with it, which is exactly when you’re most likely to cut something downstream needed.&lt;/p&gt;

&lt;p&gt;So we chose the other end:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;git log | &lt;span class="nb"&gt;grep &lt;/span&gt;ABC-123&lt;span class="o"&gt;)&lt;/span&gt; | boost
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Boost runs last. What it sees is precisely what would have landed in the context window, byte for byte. Every token it reports is a token that was genuinely on its way in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Then multiply by turns.&lt;/strong&gt; Here’s the part most savings estimates miss entirely.&lt;/p&gt;

&lt;p&gt;Every time a user sends a new message in an existing session, all the previous tokens are sent again. Until the session hits compaction, every CLI command, every output, every MCP request and response stays in the window — and you’re billed for it on every single turn.&lt;/p&gt;

&lt;p&gt;So the value of trimming a command output isn’t the tokens you cut. It’s the tokens you cut, multiplied by the number of turns that output would have sat in context. A 3,000-token log removed at turn 4 of a 40-turn session isn’t a 3,000-token saving. Our per-session estimate accounts for this residency, which is why our numbers are calculated rather than extrapolated from a compression ratio.&lt;/p&gt;

&lt;p&gt;And it’s why the savings compound in both directions: fewer tokens per turn means a cheaper turn, and more turns before you hit compaction, and fewer compactions — each of which costs you real context fidelity.&lt;/p&gt;

&lt;h2&gt;
  
  
  If You’re Building One of These
&lt;/h2&gt;

&lt;p&gt;Four things we’d hand to anyone starting down this road:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pick your measurement boundary before you pick your filters.&lt;/strong&gt; It determines whether every number you produce afterward is real.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give the agent a way to disagree with you.&lt;/strong&gt; An optimizer the agent can’t override is an optimizer you can’t debug.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instrument the recovery path, not just the savings path.&lt;/strong&gt; Your retrieve rate is a more honest quality metric than your compression ratio will ever be.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never report a savings number without a correctness number next to it.&lt;/strong&gt; Compression without a pass rate is a claim, not a result.
Boost is free and in public preview. Try it at boost.jfrog.com. — and if you find a filter that makes your agent stupider, &lt;code&gt;boost retrieve&lt;/code&gt; will tell us before you have to.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the first post in a series benchmarking the approach behind JFrog Boost against the token-saving tools teams already run in production. Next up: a closer look at RTK, where its measurement boundary breaks down under real agentic sessions, benchmarked head-to-head against JFrog Boost.&lt;/p&gt;

&lt;p&gt;&lt;a href="//boost.jfrog.com"&gt;Try Boost today&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>claude</category>
      <category>tokens</category>
    </item>
    <item>
      <title>Why Model Routing Backfires and How to Build Agents That Don’t Burn Your Budget</title>
      <dc:creator>Yahav Ohana</dc:creator>
      <pubDate>Thu, 23 Jul 2026 21:20:34 +0000</pubDate>
      <link>https://dev.to/yahav_ohana_10166c18e6df4/why-model-routing-backfires-and-how-to-build-agents-that-dont-burn-your-budget-5h57</link>
      <guid>https://dev.to/yahav_ohana_10166c18e6df4/why-model-routing-backfires-and-how-to-build-agents-that-dont-burn-your-budget-5h57</guid>
      <description>&lt;h3&gt;
  
  
  By Shay Dahan, JFrog Boost Co-Founder Yahav Ohana, JFrog Boost Co-Founder | July 23, 2026
&lt;/h3&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%2Fw9az3km5k393359mwhhg.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%2Fw9az3km5k393359mwhhg.png" alt="Don't burn tokens" width="800" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Model routing promises to cut your AI agent spend by offloading routine tasks to cheaper models like Claude Haiku while reserving frontier models like Claude Sonnet for complex reasoning. In the right configuration, routing strategies can reduce inference costs by &lt;a href="https://proceedings.iclr.cc/paper_files/paper/2025/hash/5503a7c69d48a2f86fc00b3dc09de686-Abstract-Conference.html" rel="noopener noreferrer"&gt;40–85%&lt;/a&gt;. But if you implement routing incorrectly in a multi-turn agent, you can end up paying more than if you’d never routed at all. Here’s why and how to fix it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Token Costs Accumulate Across a Session
&lt;/h2&gt;

&lt;p&gt;Understanding why routing backfires requires understanding how agentic sessions accumulate costs. Each turn in a conversation compounds the token count, and that compounding is the engine behind both your savings and your risk.&lt;/p&gt;

&lt;p&gt;Every turn in an agent session carries a growing token payload. The table below shows how the distribution shifts across a typical three-turn session:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs59xk2sx1y8nx2qnlzpq.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%2Fs59xk2sx1y8nx2qnlzpq.png" alt=" " width="800" height="483"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By Turn 3, cached tokens make up the vast majority of your token payload. This is the efficiency you’re trying to protect. Switching models mid-session destroys that protection entirely.&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%2F633fmhnowngo1bosbqux.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%2F633fmhnowngo1bosbqux.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Switching Models Mid-Session Increase Your Costs?
&lt;/h2&gt;

&lt;p&gt;Switching LLM models mid-session wipes out accumulated prompt cache savings because every provider’s cache is model-specific — the new model has no access to the previous model’s stored history and must re-read the entire conversation from scratch at standard input token rates.&lt;/p&gt;

&lt;p&gt;Prompt caches operate on prefix matching. The LLM provider stores a hash of your message prefix. As long as the prefix stays stable and the model stays the same, every subsequent turn benefits from heavily discounted cached token pricing. &lt;a href="https://www.anthropic.com/claude/sonnet" rel="noopener noreferrer"&gt;Anthropic&lt;/a&gt;, for example, offers up to a 90% discount on cached input tokens. The moment you switch models, the new model starts with a cold cache. It processes the entire conversation history at full input token cost, as if Turn 1 never happened. For short sessions, this is a minor annoyance. For agentic coding workflows where context windows can stretch to 50,000 tokens or more, a single mid-session model switch can spike costs enough to eliminate all the savings routing was supposed to deliver.&lt;/p&gt;

&lt;h2&gt;
  
  
  What You Should Not Do
&lt;/h2&gt;

&lt;p&gt;Several common routing patterns look like optimizations but actively hurt your cost profile. These are the most frequent causes of unexpected cost increases in production agent systems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Switching models in the middle of a long conversation without summarization&lt;/strong&gt; — This forces the new model to reprocess the entire conversation history at full input token cost. The cache miss penalty for a 20,000-token session can cost more than the savings the switch was intended to generate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enabling auto-routing mid-session in LLM gateways&lt;/strong&gt; — LLM gateway tools like LiteLLM, OpenRouter, and Portkey support automatic routing based on query complexity. This is powerful for single-turn queries, but enabling it mid-session in an agentic loop invalidates your KV cache at every routing boundary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modifying tools or system prompts mid-session&lt;/strong&gt; — Tool definitions sit inside the cached prefix. Adding or removing a tool during a session invalidates the entire cache downstream from that change. Treat session tool configuration as immutable once started.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using compression calls with a separate model&lt;/strong&gt; — Many agents compress long history by spawning a summarization call with a cheap model. If that call uses a different model or a different system prompt, it generates its own cache miss and resets the main session cache on return.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Avoiding these patterns requires intentional session design, not just correct routing logic. Your routing strategy is only as good as your session architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to Do Instead
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5f31j27govh1tzhhlqxu.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%2F5f31j27govh1tzhhlqxu.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Effective model routing in agentic systems is a session-level concern, not a query-level one. The following practices let you capture the cost benefits of routing without sacrificing the prompt cache savings that make agentic AI economically sustainable:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Minimize turns per task and delegate early&lt;/strong&gt; — Keep individual agent sessions as short as possible. When you know a task requires extensive context (e.g., a complex multi-file refactor, a long-running compliance check) delegate it to a subagent at the start, before the session accumulates history. Short sessions mean small caches, which means a model switch costs less.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the subagent pattern for model diversity&lt;/strong&gt; — Instead of switching models within a single session, build an orchestrating agent that delegates subtasks to purpose-built subagents. Each subagent starts fresh with only the context it needs and runs on whatever model is best for its specific task. No cache invalidation. No accumulated history penalty. This pattern (sometimes called the orchestrator-subagent architecture) is the cleanest way to get cost-based model diversity without paying the mid-session switch penalty.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Summarize deliberately before any required model switch&lt;/strong&gt; — If a model switch mid-session is unavoidable, create a structured handoff: explicitly summarize the active context, the current task state, and any open decisions into a compact message. Start a fresh session with the new model using only that summary as input. You pay standard input costs on a small summary instead of cached costs on a 20,000-token history replay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lock your session configuration&lt;/strong&gt; — System prompts, tool definitions, and model selection should be fixed at session start. Treat them like a schema — changing them mid-session is a migration event, not a configuration tweak. If your agent framework allows dynamic tool loading, audit where and when those loads happen relative to your cache prefix boundary.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How JFrog Boost Protects Your Cache Efficiency Automatically
&lt;/h2&gt;

&lt;p&gt;While managing model routing logic is critical for agent sustainability, context bloat acts as a massive force multiplier for token waste. Every time an agent runs a build, executes a test suite, or pulls logs, hundreds of lines of repetitive terminal noise flood the conversation history.&lt;/p&gt;

&lt;p&gt;In a multi-turn session, this noise compounds rapidly. It turns what should have been a lean history into a 50,000-token payload within a few turns. This directly breaks your cost engineering: if your session is bloated with terminal noise, the “cache miss penalty” we discussed earlier becomes exponentially more expensive the moment a mid-session model switch occurs.&lt;/p&gt;

&lt;p&gt;When utilizing coding agents, developers shouldn’t have to manually curate terminal output just to prevent a noisy build step from inflating their LLM bill.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt; is designed to solve this context bloat directly within the developer workflow&lt;/strong&gt;. Boost is a lightweight CLI tool that intelligently compacts terminal output during agentic loops, stripping out repetitive boilerplate while perfectly preserving the critical signal, like exact error stack traces. Instead of sending thousands of tokens of raw build logs to your model, Boost trims the payload before it ever hits the agent.&lt;/p&gt;

&lt;p&gt;By keeping your session history lean, Boost drastically reduces the baseline tokens processed per turn. This minimizes the financial penalty of unavoidable model routing switches, extends the life of your context window, and maximizes the economic efficiency of your prompt caches.&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%2F93sx2k42k08jnicb1pny.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%2F93sx2k42k08jnicb1pny.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Designing for Sustainable Agent Economics
&lt;/h2&gt;

&lt;p&gt;Model routing delivers real cost savings, but only when it respects the underlying mechanics of provider prompt caches. To build sustainable agent workflows, treat your conversation history as a highly optimized asset: Keep your primary sessions lean, delegate heavy context to short-lived subagents, and ensure any necessary model transition is handled through a structured state summary rather than a raw history replay.&lt;/p&gt;

&lt;p&gt;Ultimately, engineering sustainable agentic systems requires treating token efficiency as a core constraint alongside speed and accuracy.&lt;/p&gt;

&lt;p&gt;To implement these session-level optimizations automatically and eliminate context waste in your development workflows, you can &lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;install Boost&lt;/a&gt; and start saving tokens today.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connect with us
&lt;/h2&gt;

&lt;p&gt;We would love to hear about your experiences, architectural patterns, and challenges with model routing. Feel free to reach out or follow our ongoing research into coding agents:&lt;br&gt;
→ &lt;strong&gt;X:&lt;/strong&gt; &lt;a href="https://x.com/ShayFrektman" rel="noopener noreferrer"&gt;https://x.com/ShayFrektman&lt;/a&gt;, &lt;a href="https://x.com/yahav_ohana" rel="noopener noreferrer"&gt;https://x.com/yahav_ohana&lt;/a&gt;&lt;br&gt;
→ &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/shay-dahan" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/shay-dahan&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/yahav-ohana" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/yahav-ohana&lt;/a&gt;&lt;br&gt;
→ &lt;strong&gt;Substack:&lt;/strong&gt; &lt;a href="https://substack.com/@yahavohana" rel="noopener noreferrer"&gt;https://substack.com/@yahavohana&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Published originally on: &lt;a href="https://jfrog.com/blog/why-model-routing-backfires/" rel="noopener noreferrer"&gt;https://jfrog.com/blog/why-model-routing-backfires/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>claude</category>
      <category>openai</category>
      <category>ai</category>
    </item>
    <item>
      <title>Stop Wasting AI Tokens: How to Slash LLM Costs with JFrog Boost [free --forever] 🚀</title>
      <dc:creator>Yahav Ohana</dc:creator>
      <pubDate>Thu, 09 Jul 2026 20:11:18 +0000</pubDate>
      <link>https://dev.to/yahav_ohana_10166c18e6df4/stop-wasting-ai-tokens-how-to-slash-llm-costs-with-jfrog-boost-free-forever-45gd</link>
      <guid>https://dev.to/yahav_ohana_10166c18e6df4/stop-wasting-ai-tokens-how-to-slash-llm-costs-with-jfrog-boost-free-forever-45gd</guid>
      <description>&lt;p&gt;&lt;strong&gt;🚀 TL;DR:&lt;/strong&gt; AI coding assistants (like Cursor, Claude Code, and Copilot) burn through tokens by sending massive, bloated context windows. We built &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt;&lt;/strong&gt; to intellectually trim context noise and slash your LLM costs without sacrificing code quality. Try it out, read our launch deep-dive, and &lt;strong&gt;&lt;a href="https://github.com/jfrog/boost" rel="noopener noreferrer"&gt;star us on GitHub&lt;/a&gt;&lt;/strong&gt; if you like saving budget!&lt;/p&gt;




&lt;p&gt;AI coding tools are an absolute game-changer—until you see the token bill. &lt;/p&gt;

&lt;p&gt;The reality is that context windows get bloated fast. Your LLM doesn't need to swallow half your repository just to fix a simple bug or refactor a function. Massive prompts don't just cost more; they introduce context drift, slow down response times, and occasionally make the AI hallucinate.&lt;/p&gt;

&lt;p&gt;To solve this, we built &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;JFrog Boost&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;It’s an open-source developer tool designed to optimize your prompt mechanics, strip out the noise, and drastically lower your token footprint.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠️ What it does under the hood:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Token Trimming:&lt;/strong&gt; Minimizes context bloat before it hits the LLM.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Cost Efficiency:&lt;/strong&gt; Maximizes the performance-to-cost ratio of your AI engineering workflows.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Faster Iterations:&lt;/strong&gt; Smaller, tighter contexts mean faster response times from your coding agents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We just dropped a &lt;strong&gt;&lt;a href="https://jfrog.com/blog/jfrog-boost-saves-ai-coding-tokens/" rel="noopener noreferrer"&gt;detailed launch blog post&lt;/a&gt;&lt;/strong&gt; breaking down the benchmarks, the architecture, and exactly how much token overhead you can save starting today.&lt;/p&gt;

&lt;h3&gt;
  
  
  🌟 Support the Project
&lt;/h3&gt;

&lt;p&gt;We are fully open-source! If you find the tool useful or want to contribute, please &lt;strong&gt;&lt;a href="https://github.com/jfrog/boost" rel="noopener noreferrer"&gt;give us a star on GitHub&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Give the tool a spin at &lt;strong&gt;&lt;a href="https://boost.jfrog.com" rel="noopener noreferrer"&gt;boost.jfrog.com&lt;/a&gt;&lt;/strong&gt; and let us know what you think in the comments! How are you currently managing your AI token budgets?&lt;br&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%2Fo512lncqfjh0a2nrnigt.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%2Fo512lncqfjh0a2nrnigt.png" alt="Chart showing JFrog Boost reducing AI context window size from 1.1M to 742K tokens" width="800" height="318"&gt;&lt;/a&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%2Fxcfzirv46jdimwperyf6.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%2Fxcfzirv46jdimwperyf6.png" alt="Screenshot of the JFrog Boost user interface" width="799" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>news</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
