<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Agent Native]]></title><description><![CDATA[A builder's journey through the AI frontier: discovery, wonder, and the occasional thing that shouldn't work but does.]]></description><link>https://agentnative.blog</link><image><url>https://substackcdn.com/image/fetch/$s_!-xSi!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b54e270-66dd-4ba3-9524-635a6d786a49_512x512.png</url><title>Agent Native</title><link>https://agentnative.blog</link></image><generator>Substack</generator><lastBuildDate>Sat, 01 Aug 2026 14:34:55 GMT</lastBuildDate><atom:link href="https://agentnative.blog/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Zhi Huang]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[huangzhi@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[huangzhi@substack.com]]></itunes:email><itunes:name><![CDATA[Zhi Huang]]></itunes:name></itunes:owner><itunes:author><![CDATA[Zhi Huang]]></itunes:author><googleplay:owner><![CDATA[huangzhi@substack.com]]></googleplay:owner><googleplay:email><![CDATA[huangzhi@substack.com]]></googleplay:email><googleplay:author><![CDATA[Zhi Huang]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Make Your Agent Follow Rules Like Clockwork]]></title><description><![CDATA[Situational guidance, delivered by a hook at the moment it matters]]></description><link>https://agentnative.blog/p/make-your-agent-follow-rules-like-clockwork</link><guid isPermaLink="false">https://agentnative.blog/p/make-your-agent-follow-rules-like-clockwork</guid><dc:creator><![CDATA[Zhi Huang]]></dc:creator><pubDate>Wed, 15 Jul 2026 00:41:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!wFw3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wFw3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wFw3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1504507,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://huangzhi.substack.com/i/207094372?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wFw3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!wFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F630d5f98-bce7-4a50-970a-d28ba9bd9a1e_1200x630.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I used to have a big rules folder with all my coding agent rules, indexed in <code>CLAUDE.md</code>. The expectation was agents would load the right rules when the moment was right. It usually did the right thing, usually.</p><p>You&#8217;ve probably experienced this. Somewhere in a long session, Claude gets to a place, let&#8217;s say it went from writing backend code to the frontend, starts adding a test, and &#8216;forgets&#8217; to look up the frontend test rules. It&#8217;s an agent, it&#8217;s not clockwork. If only we could make it load the right guides like one...</p><p>Context fades as the session moves on. An agent working away on a ticket doesn&#8217;t always &#8216;remember&#8217; we have hinted at a doc with frontend test rules 15 turns ago. Even if we preload all the rules upfront, there&#8217;s no guarantee they will all be followed precisely either. Besides, all those rules are just noise until they become relevant.</p><p>This is what I do. Rules that apply all the time get loaded upfront: mostly basic working practices. The rest are <strong>injected</strong> into the conversation when the agent is about to do the relevant thing.</p><p>Here is a real example. I have a design guide to optimize Claude ultra code workflows for token efficiency. If I link it in <code>CLAUDE.md</code>, it&#8217;s not always followed and I burn bunch of tokens. A hook makes it unmissable:</p><pre><code><code>hook: runs before every tool call
  if this call is spawning a workflow or fleet of workers:
    block it once; reply: &#8220;Read workflow-design-guide.md before building the workflow.&#8221;
  the retry goes through</code></code></pre><p>The key is to BLOCK the first call to create a workflow, put the rule into the conversation, and let the now-informed agent retry.</p><p>Once you understand how it works, you can get creative. Put logic inside the hook so it responds differently to each situation. For tests:</p><pre><code><code>hook: runs before every file write
  if the file ends in .test.ts or .test.js:
    in frontend/ &#8594; block once; reply with the frontend test rules
    in backend/  &#8594; block once; reply with the backend test rules
  everything else goes through</code></code></pre><p>Claude now sees only the conventions for the side it&#8217;s touching. You don&#8217;t need both sets of test rules loaded in every session.</p><p>This is the crux of it: situational rules arrive at the situation; anything reliably detectable can become a gate.</p><p>You get more control, and Claude gets room to work without carrying an enormous guide through every step.</p><blockquote><p>Here&#8217;s something you can try for yourself. Prompt Claude Code to add a hook like the example below. Describe your own file extensions, folder names and doc paths. When agents try to edit those files, they will stop and read the doc first.</p><p>The prompt: <em>&#8220;Add a file write hook that looks for writes to any .test.ts file and, depending on whether the file is under frontend/ or backend/, responds with &#8216;retry after reading docs/[frontend|backend]-test-rules.md&#8216;. It should block once per rule doc.&#8221;</em></p></blockquote><p>If you want to take it to the next level, plant rule files in your folder structure and make the hook locate them. The hook stops being one big switch statement you keep updating. Each file carries its own note, right where the work happens.</p><p>One last note. I came across Birgitta B&#246;ckeler&#8217;s writeup on <a href="https://martinfowler.com/articles/harness-engineering.html">harness engineering</a>, on Martin Fowler&#8217;s site. She splits an agent's harness into guides - advice given before the agent acts, and sensors - checks on what it did after. The hooks here take the best of both: they watch like a sensor, advise like a guide, and fire right as the agent is about to act.</p>]]></content:encoded></item></channel></rss>