<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="rss.xsl"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>My Site Blog</title>
        <link>https://hythaam.github.io/blog/</link>
        <description>My Site Blog</description>
        <lastBuildDate>Sat, 30 May 2026 16:17:54 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[theory-building-as-programming]]></title>
            <link>https://hythaam.github.io/blog/theory-building-as-programming/</link>
            <guid>https://hythaam.github.io/blog/theory-building-as-programming/</guid>
            <pubDate>Sat, 30 May 2026 16:17:54 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Boundaries of Agentic Work]]></title>
            <link>https://hythaam.github.io/blog/ai-agent-boundaries/</link>
            <guid>https://hythaam.github.io/blog/ai-agent-boundaries/</guid>
            <pubDate>Fri, 15 May 2026 01:43:37 GMT</pubDate>
            <description><![CDATA[In Progress]]></description>
            <content:encoded><![CDATA[<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>In Progress</p></div></div>
<!-- -->
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="hypothesis">Hypothesis:<a href="https://hythaam.github.io/blog/ai-agent-boundaries/#hypothesis" class="hash-link" aria-label="Direct link to Hypothesis:" title="Direct link to Hypothesis:" translate="no">​</a></h3>
<ul>
<li class="">AI agents are not good at all aspects of engineering work.</li>
<li class="">How can we optimize their strengths while keeping humans in the loop for weaknesses?</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="questions">Questions:<a href="https://hythaam.github.io/blog/ai-agent-boundaries/#questions" class="hash-link" aria-label="Direct link to Questions:" title="Direct link to Questions:" translate="no">​</a></h3>
<ul>
<li class="">What are agents good at?</li>
<li class="">What are agents bad at?</li>
<li class="">What does engineering SDLC currently look like?</li>
<li class="">Where do agents fit into that loop?</li>
<li class="">Where can agents bridge gaps</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="notes">Notes:<a href="https://hythaam.github.io/blog/ai-agent-boundaries/#notes" class="hash-link" aria-label="Direct link to Notes:" title="Direct link to Notes:" translate="no">​</a></h3>
<ul>
<li class="">Where should agentic work start and stop?</li>
<li class="">I think using agents for a "first pass" is a mistake. It will introduce unexamined assumptions<!-- -->
<ul>
<li class="">PRs are hard to review, particularly from agents</li>
<li class="">Context gathering is the most critical piece that needs a human -- someone needs a theory of software!</li>
</ul>
</li>
<li class="">HITL work needs humans at the start and end of any process.<!-- -->
<ul>
<li class="">Agents should accelerate single-human tasks</li>
</ul>
</li>
<li class="">That doesn't mean we should maintain current role boundaries<!-- -->
<ul>
<li class="">Expanding/adjusting roles may be necessary</li>
</ul>
</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="references">References:<a href="https://hythaam.github.io/blog/ai-agent-boundaries/#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:" translate="no">​</a></h3>
<hr>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Skills are not Workflows]]></title>
            <link>https://hythaam.github.io/blog/skills-are-not-workflows/</link>
            <guid>https://hythaam.github.io/blog/skills-are-not-workflows/</guid>
            <pubDate>Fri, 15 May 2026 01:43:37 GMT</pubDate>
            <description><![CDATA[In Progress]]></description>
            <content:encoded><![CDATA[<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>In Progress</p></div></div>
<!-- -->
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="notes">Notes:<a href="https://hythaam.github.io/blog/skills-are-not-workflows/#notes" class="hash-link" aria-label="Direct link to Notes:" title="Direct link to Notes:" translate="no">​</a></h3>
<ul>
<li class="">AI Agent skills should not be thought of as workflows</li>
<li class="">Instead they should be considered context injectors</li>
<li class=""><em>Procedures</em> are acceptable in a skill</li>
<li class=""><em>Workflows</em> (defined as deterministic event sequences) are agent harnesses<!-- -->
<ul>
<li class="">Harnesses are code that manages agentic conversations</li>
</ul>
</li>
</ul>
<blockquote>
<p>Specifically, skills should not define strict requirements. They're too flakey to be relied on for critical rules.</p>
</blockquote>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="references">References:<a href="https://hythaam.github.io/blog/skills-are-not-workflows/#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:" translate="no">​</a></h3>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="necessary-research">Necessary research:<a href="https://hythaam.github.io/blog/skills-are-not-workflows/#necessary-research" class="hash-link" aria-label="Direct link to Necessary research:" title="Direct link to Necessary research:" translate="no">​</a></h3>
<ul>
<li class="">I need to figure out how agentic hooks work</li>
<li class="">I suspect workflows need more than just subagents, but I don't know yet.</li>
</ul>
<hr>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adversarial Agents: Generators and Judges]]></title>
            <link>https://hythaam.github.io/blog/adversarial-agents/</link>
            <guid>https://hythaam.github.io/blog/adversarial-agents/</guid>
            <pubDate>Tue, 05 May 2026 18:58:39 GMT</pubDate>
            <description><![CDATA[In Progress]]></description>
            <content:encoded><![CDATA[<div class="theme-admonition theme-admonition-warning admonition_xJq3 alert alert--warning"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 16 16"><path fill-rule="evenodd" d="M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"></path></svg></span>warning</div><div class="admonitionContent_BuS1"><p>In Progress</p></div></div>
<!-- -->
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="notes">Notes:<a href="https://hythaam.github.io/blog/adversarial-agents/#notes" class="hash-link" aria-label="Direct link to Notes:" title="Direct link to Notes:" translate="no">​</a></h3>
<ul>
<li class="">Why does the generator/judge split work?<!-- -->
<ul>
<li class="">Naive approaches: multiple models<!-- -->
<ul>
<li class="">Can reduce per-token costs, but not necessarily task cost</li>
</ul>
</li>
<li class="">Separate out context<!-- -->
<ul>
<li class="">Task executions poison context. It's much harder to ask an agent "is this correct" when it just went through the reasoning process to justify it.</li>
</ul>
</li>
<li class="">Prompt differences.<!-- -->
<ul>
<li class="">Unique prompts can help isolate the actual intent from incidental requirements present in each prompt</li>
</ul>
</li>
</ul>
</li>
<li class="">How to implement<!-- -->
<ul>
<li class="">Orchestration layer</li>
<li class="">Context isolation</li>
</ul>
</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="references">References:<a href="https://hythaam.github.io/blog/adversarial-agents/#references" class="hash-link" aria-label="Direct link to References:" title="Direct link to References:" translate="no">​</a></h3>
<ul>
<li class="">Addy Osmani <a href="https://addyosmani.com/blog/long-running-agents/" target="_blank" rel="noopener noreferrer" class="">Long Running Agents</a></li>
</ul>
<hr>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Context is King: Harnesses, Cost, and Output Quality in Agentic LLM Workflows]]></title>
            <link>https://hythaam.github.io/blog/context-is-king/</link>
            <guid>https://hythaam.github.io/blog/context-is-king/</guid>
            <pubDate>Fri, 01 May 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Just a few years ago, "Prompt Engineering" was the fastest growing career in tech. (Probably; I have no data for this at all) Today, it's all but disappeared from conversation. So what happened? Models got smarter, agentic workflows were introduced, and recently, AI fluency has become a defacto requirement in the professional world instead of a niche role.]]></description>
            <content:encoded><![CDATA[<p>Just a few years ago, "Prompt Engineering" was the fastest growing career in tech. (Probably; I have no data for this at all) Today, it's all but disappeared from conversation. So what happened? Models got smarter, agentic workflows were introduced, and recently, AI fluency has become a defacto requirement in the professional world instead of a niche role.</p>
<p>Having smarter models means that a lot of the weird tricks that were shared ("You are a brilliant software engineer. Have fun while completing this task") are no longer applicable. At the same time, the more serious research has moved on to solving the general problem of context hydration. (LongRoPE context within LLMs, and RAG hydration in agentic systems).</p>
<p>While models and agents may be better, that doesn't mean prompting strategy is irrelevant. As AI use is becoming more central to professional work, it's more important than ever to know how the get the most out of them.</p>
<!-- -->
<p>This post is intended to provide practical guidance for engineers and other AI agent users who already understand software systems but haven't yet built a strong mental model for how agentic LLM workflows actually function. The goal isn't to memorize vocabulary or give research-level insights, it's to help you reason about context tradeoffs in your own workflow so you can get better results more consistently.</p>
<p>If there's anything to take away from this post, it's that <strong>the model is only one part of the system.</strong> The agent harness shapes your interacting with the model, and the model context is the working memory that makes LLM inference both useful and expensive.</p>
<p>Before talking about cost or quality, though, lets briefly define the harness around the model.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="harnesses-the-runtime-around-the-model">Harnesses: the runtime around the model<a href="https://hythaam.github.io/blog/context-is-king/#harnesses-the-runtime-around-the-model" class="hash-link" aria-label="Direct link to Harnesses: the runtime around the model" title="Direct link to Harnesses: the runtime around the model" translate="no">​</a></h2>
<p>When people talk about using an AI agent, they usually focus on the model — Claude, GPT, Gemini, or whichever brand-name is in play. The application that actually enables users to do useful work with the model is the <strong>harness</strong>: the control layer that assembles context, exposes functional capabilities, and defines the mode of interaction between the user and model.</p>
<p>All of the concepts related to model context that we'll discuss later (tools, skills, pruning, compaction) live inside this layer.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-standard-loop">The standard loop<a href="https://hythaam.github.io/blog/context-is-king/#the-standard-loop" class="hash-link" aria-label="Direct link to The standard loop" title="Direct link to The standard loop" translate="no">​</a></h3>
<p>The interaction between you and the model follows an incredibly simple cycle:</p>
<ol>
<li class="">Your request enters the harness.</li>
<li class="">The harness assembles the context window with system instructions, available tool definitions, and the conversation history,.</li>
<li class="">The harness sends this assembled context to the model via a provider API call.</li>
<li class="">The model processes the context and either answers directly, spends time thinking through a reasoning chain, or requests a tool call.</li>
<li class="">If a tool call is requested, the harness executes the tool and feeds the result into the conversation history for another turn of the loop.</li>
<li class="">The loop ends when the model produces a final answer or the harness stops it (due to turn limits, token budgets, or other constraints).</li>
</ol>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>How does the model signal that it's done? If no tool call is requested by the model in an API response, the harness will interpret it as the final call in the loop. Some harnesses will allow you to inject requests in-between API calls to provide guidance to the model as well.</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="tools">Tools<a href="https://hythaam.github.io/blog/context-is-king/#tools" class="hash-link" aria-label="Direct link to Tools" title="Direct link to Tools" translate="no">​</a></h3>
<p>Tools are advertised extensions that the model can invoke through the harness. Models are simple text prediction systems; things like searching a codebase, reading and writing files, executing code, querying a database, or making calls to an <a href="https://modelcontextprotocol.io/docs/getting-started/intro" target="_blank" rel="noopener noreferrer" class="">MCP server</a> require the model to produce a formatted <em>tool call block</em> to request the harness to perform an action on it's behalf.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>There are a few tool calling standards used by models under the hood. Models are trained to output a specific format, but the API layer usually handles extracting the call into a separate part of the API response. It isn't 100% accurate, so a lot of harnesses will also have some recovery code in case a malformed tool call gets passed as part of the conversation instead.</p></div></div>
<p>For the purpose of this discussion, the most important piece is that <strong>tool definitions and outputs become part of the working context.</strong> Every tool the model is given access to, and the resulting search, file read, or API response the model requests gets appended to the conversation, consuming tokens and bringing more information to compete for the model's attention with everything else in the context window.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="context-management">Context management<a href="https://hythaam.github.io/blog/context-is-king/#context-management" class="hash-link" aria-label="Direct link to Context management" title="Direct link to Context management" translate="no">​</a></h3>
<p>As the loop runs, the conversation grows and tool results accumulate. The context continues to fill with each call and response. Harnesses manage this growth through two primary mechanisms:</p>
<ul>
<li class=""><strong>Pruning</strong> removes stale or low-value context. The harness may discard old tool outputs, trim earlier turns of conversation, or drop information that it decides is no longer relevant to the current task.</li>
<li class=""><strong>Compaction</strong> replaces a long history with a shorter retained state. Rather than keeping every turn of a long-running conversation, the harness can <a href="https://platform.claude.com/docs/en/build-with-claude/compaction" target="_blank" rel="noopener noreferrer" class="">summarize the conversation so far</a> into a condensed block that preserves the most important information while discarding the raw back-and-forth.</li>
</ul>
<p>We'll return to these mechanisms in more detail later; harnesses have a few options for managing context when it grows beyond the model limits, but there are quality implications to both strategies.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-it-matters">Why it matters<a href="https://hythaam.github.io/blog/context-is-king/#why-it-matters" class="hash-link" aria-label="Direct link to Why it matters" title="Direct link to Why it matters" translate="no">​</a></h3>
<p>The harness is the layer that controls what the model sees and what it can do; how the harness manages the context impacts the cost and quality of the result almost as much as the underlying model being used. Context is the entire working set of information that is processed on every turn of the loop, and its size, shape, and freshness determine both how much you pay for each request and the quality of the returned response.</p>
<p>Every LLM provider has more than one harness for use with their models, and there are hundreds of third-party options. They all have slightly different strategies for managing context, tooling, and interaction. These nuances can lead to significantly different cost and quality differences even when the workflow and underlying model remains the same.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="costs-context-discipline-matters-even-when-subscriptions-hide-it">Costs: context discipline matters even when subscriptions hide it<a href="https://hythaam.github.io/blog/context-is-king/#costs-context-discipline-matters-even-when-subscriptions-hide-it" class="hash-link" aria-label="Direct link to Costs: context discipline matters even when subscriptions hide it" title="Direct link to Costs: context discipline matters even when subscriptions hide it" translate="no">​</a></h2>
<p>Model selection is the most apparent cost when using an AI model. Small or old models are cheaper, while large frontier models are expensive. Rates change depending on the model, but the read driver of billing is token usage. Most providers make token usage feel invisible, but understanding what drives cost helps you reason about efficiency, which directly informs how far your workflow can stretch.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="tokens-the-billing-unit">Tokens: the billing unit<a href="https://hythaam.github.io/blog/context-is-king/#tokens-the-billing-unit" class="hash-link" aria-label="Direct link to Tokens: the billing unit" title="Direct link to Tokens: the billing unit" translate="no">​</a></h3>
<p>Every interaction with an LLM is measured in <strong>tokens</strong>; the atomic units the model reads and writes.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>A token is not quite a word and not quite a character. Depending on the model, one token averages roughly three-quarters of a word in prose. Code, logs, JSON, and structured outputs are often less token-efficient: a line of code that looks short may consume significantly more tokens than an equivalent-length sentence of natural language.</p></div></div>
<p>Long-running agent loops don't just send a prompt once. Each turn of the harness loop resends the accumulated context — system prompt, conversation history, tool definitions, and all prior tool outputs. It then appends whatever new information was added on the last turn. The model processes the full context on every turn, and you (mostly) pay for it each time.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="token-pricing">Token pricing<a href="https://hythaam.github.io/blog/context-is-king/#token-pricing" class="hash-link" aria-label="Direct link to Token pricing" title="Direct link to Token pricing" translate="no">​</a></h3>
<p>Most provider APIs charge less for <strong>input tokens</strong> (what you send to the model) and more for <strong>output tokens</strong> (what the model generates back). Pricing also varies by capability tier. A frontier reasoning model costs more per token (both input and output) than a smaller, faster model.</p>
<p>The practical consequence is that a "cheap" model can still become expensive if you feed it bloated, undisciplined context on every turn that leads to low-quality, verbose output. Conversely, a more capable and expensive model used with lean, well-shaped context can end up costing less per task than a cheaper model drowning in noise.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>It's not always huge difference, but how a model converts text into tokens can impact costs in ways that aren't immediately obvious. Anthropic's Opus 4.7 has the same per-token cost as Opus 4.6, but it actually uses ~35% more tokens for the same text.</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="prompt-caching">Prompt caching<a href="https://hythaam.github.io/blog/context-is-king/#prompt-caching" class="hash-link" aria-label="Direct link to Prompt caching" title="Direct link to Prompt caching" translate="no">​</a></h3>
<p>Provider APIs offer <strong>prompt caching</strong> to reduce cost and latency when the leading portion of the prompt (which includes your system prompt and conversation history) stays stable across requests. When you send a request, their system checks if a prefix of your prompt matches something already cached from a recent call. If it does, the cached portion is reused at a <a href="https://platform.claude.com/docs/en/build-with-claude/prompt-caching" target="_blank" rel="noopener noreferrer" class="">significantly reduced cost — often 90% cheaper than processing it fresh</a>.</p>
<p>Cache reuse rewards <strong>stable prefixes</strong>. Harnesses can take advantage of this by keeping your system prompt, tool definitions, and other often-repeated context at the front of the prompt where they can be matched across requests. Some will even allow you to fork a conversation so you can return to an earlier version with an already-cached prompt. Caching can significantly reduce the cost of long-running conversations, where early parts of the context remain unchanged every round.</p>
<p>When building custom agentic systems, this means prompt construction isn't just about what information the model needs. It's also about structuring that information so the expensive parts stay cached. For harness users, understanding prompt caching can help optimize cost if you're able to re-use the same conversation context for multiple tasks.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><h4 class="anchor anchorTargetStickyNavbar_Vzrq" id="subsidized-inference">Subsidized Inference<a href="https://hythaam.github.io/blog/context-is-king/#subsidized-inference" class="hash-link" aria-label="Direct link to Subsidized Inference" title="Direct link to Subsidized Inference" translate="no">​</a></h4><p>If you're using an AI agent through a higher-tier subscription plan, inefficient token usage might not feel like an urgent issue. The current flat-rate pricing and massive token limits encourage experimentation getting agents to perform low-value tasks without optimization.</p><p>Even so, cost-awareness is still a useful skill to build now. The current economics of inference are being shaped by competition and market-building. Long-term inference pricing will likely look different from the present moment. Understanding what drives cost means you'll be prepared to optimize when and where it matters, and you'll get better results in the meantime because the same decisions that reduce cost also tend to improve output quality.</p></div></div>
<p>While prompt caching significantly reduces the cost of maintaining large contexts, that can hide another issue: large or irrelevant information in the context can degrade a model's ability to reason about the problem at hand, which can result in <em>more</em> output tokens being used to reach a quality output.</p>
<p>That brings us to the second half of the story. The same context decisions that drive token cost also affect whether the model can reliably use the information you give it, which can further drive up costs if more prompting is required to produce a satisfactory output.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="output-quality-how-context-impacts-performance">Output quality: how context impacts performance<a href="https://hythaam.github.io/blog/context-is-king/#output-quality-how-context-impacts-performance" class="hash-link" aria-label="Direct link to Output quality: how context impacts performance" title="Direct link to Output quality: how context impacts performance" translate="no">​</a></h2>
<p>It's tempting to assume that more context means better answers, but research and practice both show that isn't the case. The larger available context windows in the latest frontier models haven't automatically solve retrieval, salience, or reasoning problems even when all of the needed information is technically present.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="fact-retrieval-degrades-with-context-length">Fact retrieval degrades with context length<a href="https://hythaam.github.io/blog/context-is-king/#fact-retrieval-degrades-with-context-length" class="hash-link" aria-label="Direct link to Fact retrieval degrades with context length" title="Direct link to Fact retrieval degrades with context length" translate="no">​</a></h3>
<p>Models perform best when relevant facts are easy to locate in the prompt. In a short, focused prompt, the signal-to-noise ratio is high and the model can quickly find and use the information it needs.</p>
<p>As context grows, more competing noise is introduced. Long contexts create competition among instructions, examples, tool outputs, and retrieved documents. The model's attention (the mechanism it uses to determine which tokens are relevant to which) gets stretched across more and more material. <a href="https://www.trychroma.com/research/context-rot" target="_blank" rel="noopener noreferrer" class="">Research indicates</a> that even on intentionally simple retrieval tasks, models are less able to identify relevant answers within the context as length increases, often in non-uniform and surprising ways. Information can be present but not effectively usable.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-missing-middle">The missing middle<a href="https://hythaam.github.io/blog/context-is-king/#the-missing-middle" class="hash-link" aria-label="Direct link to The missing middle" title="Direct link to The missing middle" translate="no">​</a></h3>
<p>One of the most well-documented patterns in long-context behavior is the <strong>"lost in the middle"</strong> effect. <a href="https://aclanthology.org/2024.tacl-1.9/" target="_blank" rel="noopener noreferrer" class="">It was found</a> that language models tend to pay the most attention to information near the <strong>beginning</strong> and <strong>end</strong> of their input context, with significantly degraded performance for information placed in the middle, even for models explicitly designed for long contexts.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>The "lost in the middle" effect is an area of active research. Newer models show some improvement, but the fundamental pattern remains relevant in practice, especially for the long agent traces and verbose tool outputs common in agentic workflows.</p></div></div>
<p>Long agent workflows naturally accumulate material in the middle of the context. Early system instructions sit at the top. The most recent user message sits at the bottom. All of the prior turns, tool results, and intermediate reasoning pile up in exactly the region where the model is least likely to attend to it carefully.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="context-rot">Context rot<a href="https://hythaam.github.io/blog/context-is-king/#context-rot" class="hash-link" aria-label="Direct link to Context rot" title="Direct link to Context rot" translate="no">​</a></h3>
<p>Beyond positional effects, there is a broader phenomenon called <strong>context rot</strong>: the gradual decline in context quality over a long interaction. Context rot isn't just about raw length, it's the accumulation of low-value information (old assumptions, verbose tool outputs, contradictory instructions left over from previous turns).</p>
<p><a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" target="_blank" rel="noopener noreferrer" class="">Anthropic has observed</a> that context must be treated as a finite resource with diminishing marginal returns. Every new token introduced depletes the model's "attention budget" by some amount.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-upshot">The upshot<a href="https://hythaam.github.io/blog/context-is-king/#the-upshot" class="hash-link" aria-label="Direct link to The upshot" title="Direct link to The upshot" translate="no">​</a></h3>
<p>These are all context-construction problems, and there are solutions to all of them available to users. So if long context can weaken retrieval and reasoning, the question becomes: how do you construct context so the right information stays salient? More broadly, how do you get the most useful output from an agent with the lowest cost?</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="context-building-keeping-the-working-set-useful">Context building: keeping the working set useful<a href="https://hythaam.github.io/blog/context-is-king/#context-building-keeping-the-working-set-useful" class="hash-link" aria-label="Direct link to Context building: keeping the working set useful" title="Direct link to Context building: keeping the working set useful" translate="no">​</a></h2>
<p>Context building is how you respond to the problems described above. The goal is not to fill the agent's context, it's to add only <strong>useful context</strong>: a working set small enough to keep the model focused and rich enough provide the information necessary for the task at hand.</p>
<p>Think of context building as an engineering activity. It's the process of designing the information environment the model will operate in, and the quality of that environment directly determines the quality of the output.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="system-prompt">System prompt<a href="https://hythaam.github.io/blog/context-is-king/#system-prompt" class="hash-link" aria-label="Direct link to System prompt" title="Direct link to System prompt" translate="no">​</a></h3>
<p>The system prompt is a durable instruction layer provided by whatever agent is being run by the harness. It defines the model's behavior, identity, and constraints across every turn of the conversation. The system prompt remains stable at the front of the context window, where it benefits from both positional salience (due to the "missing middle") and prompt caching.</p>
<p>A well-crafted system prompt preserves key rules even as the rest of the context drifts. It's where you define the persona, safety constraints, output format expectations, and the behavioral boundaries that define the role of the agent as a tool for the user.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>The system prompt for most agent harnesses is hardcoded by the developer. However, some tools and platforms allow you to modify it — for example, through files like <code>CLAUDE.md</code> in Claude Code, custom instructions in ChatGPT, or system message fields in API-based applications. If your harness supports it, this is one of the highest-leverage points for improving output quality.</p><p>Most of the larger commercial applications will only allow you to append new sections to the system prompt, but some smaller open source projects allow it to be overwritten entirely.</p></div></div>
<p>The worst quality issues happen when the system prompt is misaligned with the task at hand, e.g. asking a marketing agent for a bash script, or asking a planner to write tests. At best the agent will fail. At worst, it may struggle against the restrictions in the system prompt and complete the task with a significant token spend and extremely low quality.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="tools-1">Tools<a href="https://hythaam.github.io/blog/context-is-king/#tools-1" class="hash-link" aria-label="Direct link to Tools" title="Direct link to Tools" translate="no">​</a></h3>
<p>Tools expand what the model can <em>do</em> — search, read, write, compute, query. Less obviously, tools pull targeted information <em>into</em> context. Tool calls allow the model to pull more data into the context on-the-fly, which enables agents to perform long-running tasks independantly.</p>
<p>Tool design matters for output quality. A well-designed tool returns scoped, well-shaped output that's easy for the model to use — a focused search result, a specific file section, a clean API response. A poorly designed tool dumps verbose, unstructured output into context, recreating exactly the retrieval and attention problems described in the previous section.</p>
<p>Since the model needs to be made aware of the available tools, each one has to be included in the model context. Having too many tools loaded or having tools that aren't applicable to the task at hand will increase the context length and reduce output quality. Limiting the available tool selection can increase the agent's reasoning quality, but can also handicap the agent if it doesn't have access to the tools it needs.</p>
<p>Conversely, tools that are overly specific can also reduce quality. Agents are trained (and therefore more capable with) general tools like file readers and web search. Highly specific tools like documentation search may not be as useful to the agent as a general web search. Always be considerate when giving an agent access to a tool.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>While highly specific tools may reduce quality, they might be necessary to keep certain security/correctness guarentees. When building agents with very constrained behavioral expectations, specific tools may be a necessity. Giving an agent access to a database query utility might be a disaster if it generates an expensive query, so a more specific tool that only allows the use of certain indexes or access limits may be preferable.</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="skills">Skills<a href="https://hythaam.github.io/blog/context-is-king/#skills" class="hash-link" aria-label="Direct link to Skills" title="Direct link to Skills" translate="no">​</a></h3>
<p>Skills are modular instruction or workflow packages that can be loaded only when necessary. Instead of stuffing every possible instruction into the system prompt, skills let the agent load specialized guidance only when it determines the guidance is relevant.</p>
<p><a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills" target="_blank" rel="noopener noreferrer" class="">Anthropic describes skills</a> as working through <strong>progressive disclosure</strong>: the harness will only load the name and description of each available skill into the context at first. When the model encounters a task that matches a skill, it instructs the harness to load the full instructions into context. If a skill contains even more detailed reference material, the agent can discover and load those additional files only as needed.</p>
<p>This design directly addresses the context efficiency issues that normal tools introduce. Instead of loading everything into the context at once, specific instructions and guidance stay out of the context until it's actually relevant, reducing background clutter and preserving the model's attention budget for the information that matters right now. In the same way that tools allow the model to load new working data into the context on the fly, skills essentially allow the model to load new tools.</p>
<p>Keep in mind that, while skills are progressively disclosed, the skill descriptions are always given to the agent to determine if they're necessary. Making hundreds of skills available can still add noise to your context, and having multiple similar skills can make it more difficult for an agent to decide that any single one is relevant to the task at hand.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>Tools and skills are not commands. No amount of "YOU MUST DO THIS" will make an LLM as deterministic as a dedicated application. Tools will go unused, skills will be misapplied, and workflow checklists will be ignored. Don't depend on an agent alone for any task that requires absolute adherence to policy, and <em>never</em> provide it carte-blanche access to sensitive systems.</p><p>If strict adherence to a workflow is required, include a script in the skill to execute the task.</p></div></div>
<p>A good skill adds reusable procedure, structure, or domain judgment that makes the agent measurably more effective at a class of tasks. Be skeptical of anything that adds tokens without adding much capability. A skill that injects 2,000 tokens of generic advice on every prompt is a net negative; the harm from increasing context length will almost certainly outweigh any marginal benefit the advice could provide. The best skills are focused, modular, and loaded only when they're relevant.</p>
<p>Conversely, a small skill that is only useful in highly-specific circumstances can also be harmful. The skill description will be included in many contexts where it doesn't provide value, and when the skill <em>is</em> relevant, the model may have been able to accomplish the task without the skill anyway (albiet with an increased token count for those few instances).</p>
<p>The most useful skills are ones that provide the agent context for a task within your personal working domain. Skills that point out which folders contain shared marketing material or that provide example commands for connecting to a database instance are irreplacable — the agent may have no other way of finding out that information. Design best practices, or project layout information is much less valuable. The first is likely already part of the underlying model's training data, and the second can be easily discovered via another tool call.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="agents-and-prompts">Agents and prompts<a href="https://hythaam.github.io/blog/context-is-king/#agents-and-prompts" class="hash-link" aria-label="Direct link to Agents and prompts" title="Direct link to Agents and prompts" translate="no">​</a></h3>
<p>This is the user-configurable request framing layer where you describe what you want, how you want it, and what constraints apply. In many harnesses, this takes the form of custom agent configurations, persona definitions, or specialized prompt templates.</p>
<p>Better request framing reduces ambiguity and keeps the model focused. Vague instructions force the model to guess at intent or lead it down irrelevant paths that waste tokens <em>and</em> pollute context with noise.</p>
<p>This is also where agent specialization becomes valuable. Rather than using one general-purpose agent with access to every tool and every domain, consider defining focused agents for different kinds of work:</p>
<ul>
<li class="">A <strong>code review agent</strong> that only has access to file reading and diff tools, keeping its context focused on the code under review.</li>
<li class="">A <strong>research agent</strong> that has access to web search and document retrieval but doesn't need file-editing capabilities (and the associated context bloat)</li>
<li class="">A <strong>writing agent</strong> that works with style guides and reference documents but doesn't need a code execution environment.</li>
</ul>
<p>Each specialized agent can carry a leaner context with fewer tool definitions, more focused instructions, and less noise.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="subagents">Subagents<a href="https://hythaam.github.io/blog/context-is-king/#subagents" class="hash-link" aria-label="Direct link to Subagents" title="Direct link to Subagents" translate="no">​</a></h3>
<p>Subagents are a way to allow an agent to isolate side work in an independent context instead of letting it flood the main conversation thread. When a task requires an investigation, a calculation, or a subsidiary piece of work, the harness can spin up a separate agent with its own context window to handle it. When the task is complete, the results come back without details of the intermediary steps.</p>
<p>Without subagents, every subsidiary task expands the main context — adding tool outputs, intermediate reasoning, and exploratory dead ends to a window that's already trying to track the primary task. With subagents, the main thread stays clean and focused.</p>
<p>Because each subagent starts with a fresh context window, multiple sub-agents can share the same cached context. Because subagents handle isolated workstreams, it's easy to switch to smaller, cheaper models for simpler tasks while reserving more capable models for complex tasks.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>It's tempting to view subagents as <em>just</em> a way to perform some parts of a task with a cheaper agent, but you should always be skeptical of whether or not the savings will materialize. Cheaper agents often need to use more tokens for a given task (particularly if you're aiming for the same level of quality), which can end up equalizing the cost. For the kind of automated workflows that subagents are used for, make sure you regularly test different models to see how the real costs compare!</p></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="practical-approaches-habits-that-improve-outcomes-without-overengineering">Practical approaches: habits that improve outcomes without overengineering<a href="https://hythaam.github.io/blog/context-is-king/#practical-approaches-habits-that-improve-outcomes-without-overengineering" class="hash-link" aria-label="Direct link to Practical approaches: habits that improve outcomes without overengineering" title="Direct link to Practical approaches: habits that improve outcomes without overengineering" translate="no">​</a></h2>
<p>The mechanisms above are how the harness manages context, but many of the most impactful improvements come from how <em>you</em> interact with the agent on a day-to-day basis (after all, agents are meant to imitate what a person can do).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="be-specific">Be specific<a href="https://hythaam.github.io/blog/context-is-king/#be-specific" class="hash-link" aria-label="Direct link to Be specific" title="Direct link to Be specific" translate="no">​</a></h3>
<p>When you give the model a task, include the goal, the constraints, any prior attempts, the expected output format, and anything you already know about the problem. Don't make the model guess at information you have.</p>
<p>In a long context window, the model has to identify which information is relevant to the current task. Specific, well-structured instructions make the important facts easier to find and harder to bury under noise. Even if the model can technically access the information through it's own tools, providing it upfront (or just telling it to retrieve that data specifically) can dramatically reduce the number of tokens the model will use just to figure out that the data is necessary. In the worst case, allowing a model to learn for itself that a particular approach to the problem won't work will cost more tokens <em>and</em> leave a large chunk of information in the context window that is directly misleading the agent in future rounds of conversation.</p>
<div class="theme-admonition theme-admonition-note admonition_xJq3 alert alert--secondary"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"></path></svg></span>note</div><div class="admonitionContent_BuS1"><p>Remember that input tokens are cheaper than output tokens. Even letting a model think for several paragraphs before it requests a tool call on it's own will be more expensive than just telling it to read the file. The only reason to withold that kind of information is if you're trying to verify whether or not the information itself is relevant. If you need to confirm your suspicion that a particular file has a bug, telling it "find the bug in this file" will be counterproductive.</p></div></div>
<p>Tell the model to clarify ambiguities rather than letting it silently guess. A clarifying question costs a few tokens, but will help prevent the model exploring an incorrect path.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="treat-the-interaction-like-mentorship-not-magic">Treat the interaction like mentorship, not magic<a href="https://hythaam.github.io/blog/context-is-king/#treat-the-interaction-like-mentorship-not-magic" class="hash-link" aria-label="Direct link to Treat the interaction like mentorship, not magic" title="Direct link to Treat the interaction like mentorship, not magic" translate="no">​</a></h3>
<p>A useful mental model: you're giving a scoped task to a capable but not omniscient collaborator. This collaborator is very fast, has broad <em>general</em> knowledge, and can use tools, but it doesn't know your project history, your preferences, or your unstated constraints unless you tell it.</p>
<p>This means:</p>
<ul>
<li class=""><strong>Give concrete, checkable tasks</strong> rather than vague delegation. "Refactor the authentication module to use JWT tokens, keeping the existing session-based auth as a fallback" is better than "improve the auth system."</li>
<li class=""><strong>Break large tasks into smaller steps</strong> rather than dumping an entire project specification into one prompt. Smaller tasks mean smaller contexts, which means better reasoning.</li>
<li class=""><strong>Review and redirect</strong> rather than hoping the model gets everything right on the first try. Iteration is normal and expected.</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="treat-the-interaction-like-magic-not-mentorship">Treat the interaction like magic, not mentorship<a href="https://hythaam.github.io/blog/context-is-king/#treat-the-interaction-like-magic-not-mentorship" class="hash-link" aria-label="Direct link to Treat the interaction like magic, not mentorship" title="Direct link to Treat the interaction like magic, not mentorship" translate="no">​</a></h3>
<p>On the other hand, LLMs can be very useful for analyzing from huge amounts of unstructured data. When you have no idea where to even start with an issue, it can be surprisingly helpful to simply dump a ton of possibly-relevant data into the context window and asking what's going on. With this kind of interaction, the goal should be to output some <strong>insight</strong> rather than to perform a <strong>task</strong>.</p>
<p>This means:</p>
<ul>
<li class=""><strong>Load whatever data that might be relevant</strong>, including text files, documentation, or logs. Make sure to inform the agent where the data comes from and what it (probably) represents.</li>
<li class=""><strong>Be mindful about your own assumptions</strong>. If you aren't absolutely certain of something, be careful about telling the agent. Providing speculation may lead the agent down the wrong reasoning chain.</li>
<li class=""><strong>Check and recheck</strong> the resulting insight. Starting a new session and providing a slightly different set of inputs can confirm results. For example, if the agent claims the logs show a bug in one of the source code files you provided, asking the same question with the source code excluded should confirm whether the logs actually point to that source code file, or if your inclusion of the file led the agent to make an assumption.</li>
</ul>
<p>These kinds of sessions are generally more expensive (particularly if you're regenerating similar large context prompts repeatedly), but they can provide insights that would otherwise take significantly more time. Once an insight is generated, it's generally better to extract those details into a new session rather than continuing, since the large raw data in the context probably can't provide further value for more task-oriented conversations.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="compact-or-reset-when-context-gets-stale">Compact or reset when context gets stale<a href="https://hythaam.github.io/blog/context-is-king/#compact-or-reset-when-context-gets-stale" class="hash-link" aria-label="Direct link to Compact or reset when context gets stale" title="Direct link to Compact or reset when context gets stale" translate="no">​</a></h3>
<p>When a conversation becomes long, repetitive, or stale (or when you've extracted the specific answers you needed from an earlier exchange) consider compacting or starting a new session. Most agent harnesses support this automatically or through an explicit action.</p>
<p>The goal of compaction is to preserve only what still matters: goals, decisions made, constraints, open questions, and source-of-truth facts. Everything else (the exploratory back-and-forth, verbose tool outputs, intermediate reasoning steps, etc.) gets summarized or discarded. Harnesses generally ask the underlying model to perform compaction directly, and differences in the prompt used by the harness can change the quality or focus of the compacted information.</p>
<p>If the context has become stale, (whether because the task has drifted or the underlying data has changed since the last interaction) it may be better to start fresh than to rely on the model to compact the context. Use what you learned over the course of that interaction to provide a more concise and up-to-date context to the new session.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="dont-rely-on-the-model-to-assemble-context-for-you">Don't rely on the model to assemble context for you<a href="https://hythaam.github.io/blog/context-is-king/#dont-rely-on-the-model-to-assemble-context-for-you" class="hash-link" aria-label="Direct link to Don't rely on the model to assemble context for you" title="Direct link to Don't rely on the model to assemble context for you" translate="no">​</a></h3>
<p>The harness does its best to build a useful context window, but you often know important facts that the harness does not. You know which files are relevant. You know what you tried yesterday. You know the business constraint the model has never been told about.</p>
<p>Participate actively in context selection and shaping. Paste in relevant code snippets, link to the right documentation and state your constraints explicitly. The model is good at working <em>with</em> information, but it can only work with what it has.</p>
<p>Even in the agent can discover the information on it's own, directly providing details you know are relevant will save time and tokens and increase quality.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="conclusion-context-as-a-first-class-engineering-constraint">Conclusion: context as a first-class engineering constraint<a href="https://hythaam.github.io/blog/context-is-king/#conclusion-context-as-a-first-class-engineering-constraint" class="hash-link" aria-label="Direct link to Conclusion: context as a first-class engineering constraint" title="Direct link to Conclusion: context as a first-class engineering constraint" translate="no">​</a></h2>
<p>The model matters. But much of the behavior users observe — the quality of the output, the relevance of the reasoning, the efficiency of the interaction — comes from the harness and the context it assembles. A frontier model with poorly managed context will consistently underperform against a smaller model with well-curated context.</p>
<p>Better context management improves both cost and output quality. You send fewer tokens, which costs less. The tokens you do send are higher-signal, which means the model reasons more effectively.</p>
<p>Being specific in your prompts, breaking large tasks into smaller ones, compacting stale conversations, choosing the right tools, shaping what the model sees — these are practical skills that are rapidly becoming requirements across the professional world. As agents become more capable and the quality ceiling shifts, what you can do matters a lot less than what you can get a model to do.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="sources-and-further-reading">Sources and further reading<a href="https://hythaam.github.io/blog/context-is-king/#sources-and-further-reading" class="hash-link" aria-label="Direct link to Sources and further reading" title="Direct link to Sources and further reading" translate="no">​</a></h3>
<ul>
<li class="">Anthropic, <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents" target="_blank" rel="noopener noreferrer" class="">Effective context engineering for AI agents</a></li>
<li class="">Anthropic, <a href="https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents" target="_blank" rel="noopener noreferrer" class="">Effective harnesses for long-running agents</a></li>
<li class="">Anthropic, <a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills" target="_blank" rel="noopener noreferrer" class="">Equipping agents for the real world with Agent Skills</a></li>
<li class="">Anthropic, <a href="https://www.anthropic.com/engineering/contextual-retrieval" target="_blank" rel="noopener noreferrer" class="">Contextual Retrieval in AI Systems</a></li>
<li class="">Anthropic, <a href="https://platform.claude.com/docs/en/build-with-claude/prompt-caching" target="_blank" rel="noopener noreferrer" class="">Prompt caching</a></li>
<li class="">Anthropic, <a href="https://platform.claude.com/docs/en/build-with-claude/compaction" target="_blank" rel="noopener noreferrer" class="">Compaction</a></li>
<li class="">OpenAI, <a href="https://developers.openai.com/api/docs/guides/prompt-guidance" target="_blank" rel="noopener noreferrer" class="">Prompt guidance</a></li>
<li class="">OpenAI, <a href="https://developers.openai.com/api/docs/guides/function-calling" target="_blank" rel="noopener noreferrer" class="">Function calling</a></li>
<li class="">OpenAI, <a href="https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them" target="_blank" rel="noopener noreferrer" class="">What are tokens and how to count them?</a></li>
<li class="">Model Context Protocol, <a href="https://modelcontextprotocol.io/docs/getting-started/intro" target="_blank" rel="noopener noreferrer" class="">What is MCP?</a></li>
<li class="">Liu et al., <a href="https://aclanthology.org/2024.tacl-1.9/" target="_blank" rel="noopener noreferrer" class="">Lost in the Middle: How Language Models Use Long Contexts</a> (TACL 2024)</li>
<li class="">Ling et al., <a href="https://arxiv.org/abs/2501.15089" target="_blank" rel="noopener noreferrer" class="">LongReason: A Synthetic Long-Context Reasoning Benchmark via Context Expansion</a> (arXiv 2025)</li>
<li class="">Chroma, <a href="https://www.trychroma.com/research/context-rot" target="_blank" rel="noopener noreferrer" class="">Context Rot: How Increasing Input Tokens Impacts LLM Performance</a></li>
<li class="">Claude Code docs, <a href="https://code.claude.com/docs/en/sub-agents" target="_blank" rel="noopener noreferrer" class="">Create custom subagents</a></li>
<li class="">Addy Osmani, <a href="https://addyosmani.com/blog/agent-skills/" target="_blank" rel="noopener noreferrer" class="">Agent Skills</a></li>
<li class="">Anthropic, <a href="https://claude.com/blog/how-claude-code-works-in-large-codebases-best-practices-and-where-to-start" target="_blank" rel="noopener noreferrer" class="">How Claude Code works in large codebases</a></li>
</ul>]]></content:encoded>
        </item>
    </channel>
</rss>