<?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[INTERNALS.md]]></title><description><![CDATA[I write about what happens inside the systems we build on. Distributed systems, AI, software engineering — one deep dive at a time.

INTERNALS.md by Laxmena.]]></description><link>https://internals.laxmena.com</link><image><url>https://substackcdn.com/image/fetch/$s_!R_0n!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3628c610-2c13-46f8-b6ad-429271a5ddc9_1280x1280.png</url><title>INTERNALS.md</title><link>https://internals.laxmena.com</link></image><generator>Substack</generator><lastBuildDate>Thu, 14 May 2026 08:57:32 GMT</lastBuildDate><atom:link href="https://internals.laxmena.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Lax Meiyappan]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[internalsmd@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[internalsmd@substack.com]]></itunes:email><itunes:name><![CDATA[Lax Meiyappan]]></itunes:name></itunes:owner><itunes:author><![CDATA[Lax Meiyappan]]></itunes:author><googleplay:owner><![CDATA[internalsmd@substack.com]]></googleplay:owner><googleplay:email><![CDATA[internalsmd@substack.com]]></googleplay:email><googleplay:author><![CDATA[Lax Meiyappan]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[What you're actually writing when you write a SKILL.md]]></title><description><![CDATA[INTERNALS.md #2 &#183; Skills are programs, not prompts. How the skills runtime actually loads, and why the architecture is everything.]]></description><link>https://internals.laxmena.com/p/what-youre-actually-writing-when</link><guid isPermaLink="false">https://internals.laxmena.com/p/what-youre-actually-writing-when</guid><dc:creator><![CDATA[Lax Meiyappan]]></dc:creator><pubDate>Thu, 30 Apr 2026 14:30:30 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!kikC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.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_!kikC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kikC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 424w, https://substackcdn.com/image/fetch/$s_!kikC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 848w, https://substackcdn.com/image/fetch/$s_!kikC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 1272w, https://substackcdn.com/image/fetch/$s_!kikC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kikC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png" width="1456" height="764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:764,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:338043,&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://internals.laxmena.com/i/195955352?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.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_!kikC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 424w, https://substackcdn.com/image/fetch/$s_!kikC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 848w, https://substackcdn.com/image/fetch/$s_!kikC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.png 1272w, https://substackcdn.com/image/fetch/$s_!kikC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F57dcbe69-b354-4bfb-b20f-897b352cd71e_3200x1680.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 role="img" 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><title></title><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></p><p>A skill is a small program. </p><p>It has three execution stages: 1\ what loads every turn, 2\ what loads on invocation, and 3\ what loads on demand. Because a skill is a program, it suffers from typical software rot&#8212;environment drift, version sensitivity, and silent, non-reproducible failures.</p><p>You&#8217;ll see these failures in specific shapes. A skill that cost 20% of your context window, silently, before the agent did any work. A skill that worked perfectly until you shared it with a teammate, and ran the build in the wrong directory. A skill tuned carefully on one model, producing worse output the moment you upgraded to a better one.</p><p>These aren&#8217;t separate bugs. They&#8217;re four faces of the same misunderstanding: treating a loader specification like a prompt.</p><p>This post is about what skills actually are underneath, and why understanding the runtime changes everything you do at the surface.</p><p>A note on scope. Skills aren&#8217;t a Claude-only thing anymore. Anthropic <a href="https://agentskills.io/">published the SKILL.md format as an open standard</a> in December 2025, and the same files now work across Claude Code, Kiro, Cursor, Codex CLI, and others. The mental model in this post applies to all of them. I&#8217;ll use <em>Claude</em> as shorthand for the agent harness reading the skill. Swap in your runtime of choice.</p><div><hr></div><h2>What skills are not</h2><p>The first time I wrote a Skill, I thought I was writing a long prompt the agent would consult.</p><p>I wrote one big SKILL.md. Maybe 1,200 lines. Workflow at the top, a map of every module in our codebase, example code, message contracts between services, framework-specific patterns, and at the bottom a list of every gotcha I knew. It worked. It also consumed about 20% of the context window before the agent did any actual work.</p><p>I rewrote it. Same instructions, same output, different architecture: a 180-line SKILL.md that pointed at three reference files and one helper script. The new version cost 7%.</p><p>The instructions didn&#8217;t change. The architecture did. That&#8217;s where the 3&#215; difference lived, and it was the first sign that I was not, in fact, writing a long prompt.</p><p>A prompt is static text. You write it, you ship it, the model reads all of it on every turn. Skills don&#8217;t work like that. Skills are a <em>loader specification</em>. You&#8217;re describing what should be in context, when, and at what cost. The text matters, but the structure decides what survives the trip into the model&#8217;s working memory.</p><p>That reframe is the whole post. Everything else falls out of it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aNlX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aNlX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 424w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 848w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aNlX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png" width="1456" height="707" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:707,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:187206,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/195955352?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.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_!aNlX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 424w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 848w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 1272w, https://substackcdn.com/image/fetch/$s_!aNlX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6cc1e5d9-6440-4fef-864c-1a16f3c72d04_2800x1360.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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><em>A real skill restructure. Same task, same model, same output. The 3&#215; difference came from where the instructions lived, not what they said.</em></p><div><hr></div><h2>The runtime</h2><p>Skills run on a principle Anthropic calls <em>progressive disclosure</em>. The official documentation defines it plainly:</p><blockquote><p>Skills can contain three types of content, each loaded at different times.</p></blockquote><p>This is why two skills with identical instructions can behave completely differently. One loads 180 lines on demand; the other dumps 1,200 lines every turn.</p><p>Anthropic built these levels to protect your context window. If a skill front-loads everything, it crowds out the conversation history and tool outputs. By using progressive disclosure, you stop paying for &#8220;just in case&#8221; instructions and only pay for &#8220;just in time&#8221; execution.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sG51!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sG51!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 424w, https://substackcdn.com/image/fetch/$s_!sG51!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 848w, https://substackcdn.com/image/fetch/$s_!sG51!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 1272w, https://substackcdn.com/image/fetch/$s_!sG51!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sG51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png" width="1456" height="898" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:898,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:188099,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/195955352?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.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_!sG51!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 424w, https://substackcdn.com/image/fetch/$s_!sG51!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 848w, https://substackcdn.com/image/fetch/$s_!sG51!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 1272w, https://substackcdn.com/image/fetch/$s_!sG51!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc8e5f5-b367-4e8e-9ae4-1024ba992ee4_2800x1726.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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><em>Each level loads at a different time, with a different cost. Most authors put everything at Level 2.</em></p><p><strong>Level 1: Metadata.</strong> The <code>name</code> and <code>description</code> from YAML frontmatter. Always loaded, every turn. The <a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview">official docs</a> put this at roughly 100 tokens per skill installed. The agent uses the description to decide whether the skill is relevant. It&#8217;s a routing decision, not a usage decision. This is the most important level to get right. If the description is wrong, nothing else matters.</p><p><strong>Level 2: SKILL.md body.</strong> The procedural instructions. Loaded only when the agent decides the skill applies, by reading the file via bash. Anthropic&#8217;s <a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices">best practices documentation</a> puts the recommended ceiling at 500 lines. This is where most people pile on content they shouldn&#8217;t.</p><p><strong>Level 3: References and scripts.</strong> Bundled files referenced from SKILL.md. References are markdown the agent reads only when the body points to them. Scripts are executable code the agent <em>runs</em>: output enters context, the source code does not. Effectively unlimited.</p><p>The Anthropic engineering team (Barry Zhang, Keith Lazuka, and Mahesh Murag) described it in <a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills">their October 2025 announcement</a> as: <em>&#8220;Like a well-organized manual that starts with a table of contents, then specific chapters, and finally a detailed appendix, skills let Claude load information only as needed.&#8221;</em></p><p>Get the architecture right and your skill costs almost nothing until it earns its place. Get it wrong and you pay every turn.</p><div><hr></div><h2>Mental model</h2><p>Picture a kitchen during dinner service.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-ur6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-ur6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 424w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 848w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 1272w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-ur6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png" width="1456" height="770" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:770,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:152770,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/195955352?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.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_!-ur6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 424w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 848w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 1272w, https://substackcdn.com/image/fetch/$s_!-ur6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd624a878-3b09-46e6-a741-dc0c707de3d3_2800x1480.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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><em>The chef&#8217;s attention is the scarce resource. Same as the agent&#8217;s context window.</em></p><p>There&#8217;s a pinboard on the wall with recipe titles and one-line summaries. <em>Pasta Carbonara: Italian classic, use when guest wants creamy pasta with bacon.</em> The chef glances at it constantly. It&#8217;s small enough to hold in peripheral vision. That&#8217;s frontmatter.</p><p>When a guest orders, the chef picks the matching card and pulls down the full recipe. Ingredients, steps, technique notes. The recipe is not on the wall. It would be too cluttered, too distracting, too much to scan during service. It comes down only when needed. That&#8217;s SKILL.md.</p><p>The recipe sometimes says <em>for the sauce, see Sauce Reference, page 47</em>. The chef walks to the binder, opens to page 47, reads only that page. Doesn&#8217;t read the whole binder. That&#8217;s <code>references/</code>.</p><p>In the corner, a stand mixer. The recipe says <em>use the mixer for three minutes</em>. The chef does not read the mixer&#8217;s circuit diagram. The chef hands it ingredients, presses a button, gets output. That&#8217;s <code>scripts/</code>.</p><p>The metaphor holds under pressure, which is the only test of a metaphor. Every failure mode I hit in my own skills traces back to violating the kitchen.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://internals.laxmena.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><strong>Get the Internals!</strong> <em>Deep dives for the engineers who skip the tutorials and go straight to the source code.</em></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>The Antipattern Ledger</h2><p>When I first started migrating my workflows to the <code>SKILL.md</code>, I treated the runtime like a smart intern who could &#8220;just figure it out.&#8221;</p><p>I was wrong. Because the skills runtime is a deterministic loader, minor architectural choices&#8212;like where you put a single line of YAML&#8212;can silently break the agent&#8217;s reasoning. These aren&#8217;t just bugs; they are <strong>antipatterns</strong>. Each one below represents a moment where I violated the &#8220;Kitchen&#8221; logic and paid for it in context drift, high latency, or hallucinated outputs.</p><h3>Frontmatter on reference files</h3><p>The first thing I got wrong, before I understood progressive disclosure existed.</p><p>I added YAML frontmatter to my reference files because SKILL.md had it, and the references felt important enough to deserve metadata. I didn&#8217;t realize what frontmatter actually does.</p><p>Frontmatter is what gets loaded into the system prompt at startup. Every file with frontmatter contributes its <code>name</code> and <code>description</code> to the always-loaded set. The pinboard. Adding frontmatter to a reference file pins it to the wall as if it were a top-level skill. It isn&#8217;t. Now the pinboard shows fifty entries instead of five, most of them sub-pages that were never meant to be visible at routing time.</p><p>In practice: the agent would occasionally trigger a reference file directly instead of the parent skill. Instructions out of context, without the skill body that gave them meaning. The output was subtly wrong and I couldn&#8217;t figure out why, because the reference file looked fine in isolation. I didn&#8217;t realize it had been promoted to skill-level visibility.</p><p>The fix was one line per file: delete the frontmatter from references. They&#8217;re not skills. They&#8217;re chapters that other skills point to.</p><h3>One monolithic skill</h3><p>This is the 20%-to-7% story.</p><p>When I built a skill to capture context across multiple modules and message systems, I put everything in one SKILL.md. It seemed cleaner. One file, one source of truth. Easy to read, easy to edit.</p><p>It also meant that every time the skill triggered, the agent loaded the entire 1,200-line file. Module map, contracts, patterns, and gotchas. Even when the task only needed two of those four.</p><p>Splitting it into a 180-line spine with three reference files dropped context consumption from 20% to 7%. Same task, same output, same model.</p><p>This compounds. A skill that costs 7% instead of 20% means you can install three of them in the same context budget, run longer sessions before compaction, hit fewer cliffs on long-horizon tasks. The savings aren&#8217;t local. They show up everywhere downstream.</p><h3>Hardcoded workspace paths</h3><p>I shared a skill with a teammate and it ran the build command in the wrong directory.</p><p>My instructions said something like <em>navigate to </em><code>modules/web</code><em> and run the build</em>. That worked in my repo. My teammate&#8217;s repo had four modules. <code>modules/web</code> didn&#8217;t exist; they had <code>packages/frontend/web</code>. The skill silently picked the wrong directory and produced output in the wrong place. No error. Just wrong output.</p><p>The fix was to write instructions that ask the agent to <em>discover</em> the right path rather than declare it. Search for the build configuration. Identify the module by its <code>package.json</code>. Read the workspace structure before assuming. The skill became more abstract, but it became portable.</p><p>This is the failure mode that doesn&#8217;t appear until you share. If you only ever run a skill on your own machine, you can hardcode anything and it will work. The moment another engineer runs it, every implicit assumption surfaces as a bug.</p><h3>Missing gotchas</h3><p>My monorepo uses Turborepo. The build command has to run from the repo root for the configuration to resolve correctly. If you run <code>build</code> from inside a module directory, the build still runs. But the cache misses, the dependency graph gets misread, and the output is subtly wrong.</p><p>The agent&#8217;s default was reasonable: <em>I&#8217;m working in the </em><code>web</code><em> module, so I&#8217;ll run the build from the </em><code>web</code><em> module.</em> That&#8217;s correct in 90% of repos. It was wrong in this one.</p><p>No amount of &#8220;explain the why&#8221; in the instructions would have prevented it. The wrongness wasn&#8217;t conceptual; it was environmental. The agent&#8217;s prior was correct on average. My environment wasn&#8217;t average.</p><p>The fix was a single line in a Gotchas section: <em>Always run </em><code>turbo build</code><em> from the repository root, never from inside a module.</em> One line. The next time the agent reached for the build command, it consulted the gotcha and ran correctly.</p><p>This is what Gotchas are for. The agent has reasonable defaults. Your environment isn&#8217;t average. That gap is the whole job of the Gotchas section, and it&#8217;s why mature skills treat it as the most important section to maintain over time.</p><h3>Not knowing why the skill worked at all</h3><p>The deepest mistake. I didn&#8217;t write evals.</p><p>I built a writing skill for my personal Claude desktop. It was based on <a href="https://laxmena.com/the-day-you-became-a-better-writer">Scott Adams&#8217; writing principles</a>: short sentences, active voice, front-loaded points, one idea per paragraph. I tuned it on Sonnet 4.6. It worked exactly the way I wanted: drafts came out clean, direct, in my voice.</p><p>Then I upgraded to Opus. Better model, I assumed. Better output.</p><p>The output was worse. Every sentence ran 5 to 7 words. Technically short. But choppy. No rhythm, no flow, nothing that read like me. The writing felt like bullet points dressed as prose.</p><p>What happened is subtle. Sonnet read &#8220;write short sentences&#8221; and applied judgment: short where brevity sharpened the point, longer where the rhythm needed it. It understood the spirit. Opus read the same instruction and followed it literally. Every sentence, hard constraint, no exceptions.</p><p>The more capable model has stronger priors about what &#8220;good writing&#8221; looks like. Its version of clear prose is the statistical center of good writing on the internet. My voice isn&#8217;t the statistical center. Opus pulled hard toward its own aesthetic, and away from mine.</p><blockquote><p><em>A skill tuned on one model is calibrated to that model&#8217;s compliance characteristics, not just its capabilities.</em></p></blockquote><p>A more capable model isn&#8217;t automatically a better fit. Sometimes it&#8217;s worse, because it interprets your instructions instead of following them.</p><p>I had no evals. No way to know how much had drifted, which instructions were being over-applied, or what a passing output even looked like quantitatively. I&#8217;d never defined what &#8220;sounds like me&#8221; meant in terms a test could check.</p><p>Anthropic&#8217;s <code>skill-creator</code>, the tool the team uses to build their own skills internally, has an explicit eval methodology. The core move is <em>paired runs</em>: for every test prompt, run the agent twice. Once with the skill, once without. You&#8217;re not measuring whether the output is good. You&#8217;re measuring whether it&#8217;s <em>better than baseline</em>, and by how much.</p><p>For a writing skill, not all assertions are scriptable. But some are: output length, sentence count, average sentence length, readability score. The rest is structured human review, with the previous output alongside the new one and a notes field. That&#8217;s what Anthropic&#8217;s <code>eval-viewer</code> in <code>skill-creator</code> produces.</p><p>I now keep a small 'Golden Set' per skill&#8212;a practice we&#8217;ll dissect in an upcoming post on automated skill validation&#8212;to ensure my voice doesn't drift when the underlying model changes. Three or four realistic prompts. Rerun the suite on every model bump, every skill edit. Check the deltas.</p><p><em><strong>It worked when I tested it</strong></em><strong> is not evidence. It&#8217;s the absence of measurement.</strong></p><div><hr></div><h2>What survives the post</h2><p>Four things should stick.</p><p><strong>Skills are loader specifications, not prompts.</strong> Frontmatter is a routing mechanism. SKILL.md is a triggered payload. References and scripts are deferred chapters. Once you see the architecture, every authoring decision becomes a question of <em>which level does this content belong at?</em></p><p><strong>Architecture decides cost.</strong> The same instructions, in the wrong shape, can consume 3&#215; the context window. That penalty compounds across every skill installed and every turn taken. The fix is structural, not prose-level.</p><p><strong>The agent has reasonable priors. Your environment doesn&#8217;t.</strong> Gotchas exist because the model&#8217;s defaults are correct on average and your situation isn&#8217;t average. Workspace paths, build systems, team conventions: none of it lives in the model&#8217;s training. It has to live in the skill.</p><p><strong>A model upgrade is not free.</strong> A skill tuned on one model is calibrated to that model&#8217;s compliance characteristics. A more capable model interprets your instructions instead of following them, and for skills that encode personal or organizational voice, that interpretation is the failure. The only way to know if an upgrade helped or hurt is to measure it.</p><div><hr></div><p><em>Next issue:</em> Embeddings Internals. Why cosine similarity gets weird in high dimensions. What contrastive training actually learns. Why a general-web embedding model will silently fail on your domain data, and how to know when to fine-tune versus pick a better base model.</p><p><em>Then:</em> AGENTS.md, and the empirical finding that adding more instructions to your agent often makes it worse. The Gloaguen et al. study on 138 production repositories. Why your context file might be hurting more than it&#8217;s helping.</p><div><hr></div><p><em>INTERNALS.md is a technical series on how production AI and Data systems actually work. No tutorials. No framework evangelism. Just the layer beneath.</em></p><p><em>If this was useful, the best thing you can do is share it with one engineer who&#8217;d care.</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://internals.laxmena.com/p/what-youre-actually-writing-when?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://internals.laxmena.com/p/what-youre-actually-writing-when?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>Sources</h2><ul><li><p><a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview">Agent Skills overview</a>, Claude API documentation</p></li><li><p><a href="https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices">Agent Skills best practices</a>, Claude API documentation</p></li><li><p><a href="https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills">Equipping agents for the real world with Agent Skills</a>, Barry Zhang, Keith Lazuka, Mahesh Murag, Anthropic Engineering, October 2025</p></li><li><p><a href="https://github.com/anthropics/skills/blob/main/skills/skill-creator/SKILL.md">skill-creator/SKILL.md</a>, Anthropic skills repository</p></li><li><p><a href="https://agentskills.io/">Agent Skills open standard</a>, December 2025</p></li><li><p><a href="https://laxmena.com/the-day-you-became-a-better-writer">The Day You Became a Better Writer</a>, Lakshmanan Meiyappan</p></li><li><p><a href="https://web.archive.org/web/20240302003157/https://dilbertblog.typepad.com/the_dilbert_blog/2007/06/the_day_you_bec.html">Scott Adams&#8217; original post</a>, via Internet Archive</p></li></ul>]]></content:encoded></item><item><title><![CDATA[Most people misunderstand LangGraph. Here’s what it actually is]]></title><description><![CDATA[Internals.md #1 - A breakdown of how LangGraph works under the hood&#8212;and how to think about it in real systems.]]></description><link>https://internals.laxmena.com/p/langgraph-internals-how-production</link><guid isPermaLink="false">https://internals.laxmena.com/p/langgraph-internals-how-production</guid><dc:creator><![CDATA[Lax Meiyappan]]></dc:creator><pubDate>Sat, 18 Apr 2026 21:30:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NfQt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.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_!NfQt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NfQt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NfQt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2222345,&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://internals.laxmena.com/i/194642827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.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_!NfQt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!NfQt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffda0e620-0d59-4bc9-be95-d09ebab8bbdd_1536x1024.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 role="img" 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><title></title><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></p><p>Your agent worked yesterday. Today it&#8217;s returning wrong answers. No stack trace. No failed tool call. No exception. Just quietly incorrect output, shipping to production.</p><p>Here&#8217;s what probably happened. You added a node that writes to the same state key as an existing one, and LangGraph&#8217;s execution engine ran both in parallel. One write clobbered the other. The state is corrupt. Your agent looks fine because technically, it <em>is</em> running. It&#8217;s just running on a lie.</p><p>This post is about the engine that makes that possible and the one decision that prevents it.</p><div><hr></div><h2>Why Graphs Won the Agent Runtime</h2><p>DAGs (Directed Acyclic Graphs) are elegant when data flows in one direction. The moment an agent needs to retry, re-plan, or loop through tool calls until some condition holds, they fall apart. A ReAct loop is not a DAG. It&#8217;s a cycle.</p><p>And cycles are what production agents actually do.</p><p>LangGraph&#8217;s answer is to model agents as cyclic graphs with typed state. Nodes compute. Edges - including conditional ones decide where execution goes next. State carries everything across steps. This isn&#8217;t a convenience; it&#8217;s the minimum structure that lets an agent loop without losing what it learned on the last pass.</p><p>The tradeoff is explicitness. You declare the schema up front. You declare the edges. The graph is compiled before it runs. In return, you get something most frameworks can&#8217;t give you: a runtime that pauses, resumes, replays, and parallelizes cleanly because the engine knows, precisely, what the graph is.</p><div><hr></div><h2>The Real Primitives: Actors and Channels</h2><p>The public API shows you <code>StateGraph</code>, nodes, and edges. The engine underneath doesn&#8217;t work that way.</p><p>Before we go technical, here&#8217;s the mental model that makes everything else click.</p><blockquote><h4>&#128161; Mental Model: The Autonomous Pancake House</h4><p>Stop thinking of a graph as a Boss shouting orders at Employees (function calling). Instead, imagine a kitchen that runs entirely on mailboxes (message passing).</p><ul><li><p><strong>The Channels (Mailboxes):</strong> There is a &#8220;Batter&#8221; mailbox and a &#8220;Plates&#8221; mailbox. They aren&#8217;t just boxes, they have rules written on the lid.</p></li><li><p><strong>The Actors (Specialized Cooks):</strong> The Fryer cook doesn&#8217;t wait for a command. She sits by the &#8220;Batter&#8221; mailbox. The moment batter appears, she wakes up, cooks it, and drops the result into the &#8220;Plates&#8221; mailbox.</p></li><li><p><strong>The Reducer (The Lid Rule):</strong> What if two cooks drop a pancake onto the same plate at once?</p><ul><li><p><em>No reducer:</em> The plate shatters; it only expects one item. (<code>InvalidUpdateError</code>)</p></li><li><p><em>With reducer (</em><code>operator.add</code><em>):</em> The rule on the lid says &#8220;Stack them.&#8221; Both pancakes land, and breakfast is saved.</p></li></ul></li></ul><p>In this kitchen, no one talks to each other. They only talk to the mailboxes. This is why LangGraph can pause, resume, or run ten cooks at once; the state is in the mailboxes, not in the cooks&#8217; heads.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VfVk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VfVk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VfVk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png" width="1456" height="1294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1294,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:290019,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/194642827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.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_!VfVk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!VfVk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff6149cb6-75ed-4095-a322-5769dc6c2907_2700x2400.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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>That's the mental model. Here's what it maps to in the engine.</p><p>Under the hood, LangGraph runs on a model borrowed from <a href="https://15799.courses.cs.cmu.edu/fall2013/static/papers/p135-malewicz.pdf">Google&#8217;s Pregel paper</a>. Its real primitives are <strong>actors</strong> and <strong>channels</strong>. Actors called <code>PregelNode</code> internally subscribe to channels, read from them, and write to them. Channels hold values. Reducers decide how those values update when multiple writes arrive in the same step.</p><p>Here&#8217;s the reframing that matters: a state key in your <code>StateGraph</code> <em>is</em> a channel. A reducer is that channel&#8217;s update function. When you annotate a field with <code>operator.add</code>, you&#8217;re configuring the channel to append on update. When you leave it unannotated, the channel overwrites - and if two actors write to it in the same step, the engine throws.</p><p>So &#8220;state&#8221; is not a dictionary that nodes mutate. State is a set of channels, each with its own update semantics. Nodes don&#8217;t call each other; they publish to channels. Other nodes subscribe. This is message passing, not function calling.</p><div><hr></div><h2>Supersteps: The Execution Model</h2><p>LangGraph executes in discrete steps called <strong>supersteps</strong>, and each one has three phases:</p><ol><li><p><strong>Plan</strong>: the engine inspects channel state and selects which actors to run</p></li><li><p><strong>Execute</strong>: selected actors run in parallel</p></li><li><p><strong>Update</strong>: writes are merged into channels through the reducers</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SgKb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SgKb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SgKb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png" width="1456" height="1294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1294,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:276367,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/194642827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.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_!SgKb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!SgKb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F643fb44c-32c3-4b80-9d53-32cb8f853c5d_2700x2400.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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>The crucial property is that a superstep is <strong>transactional</strong>. If any actor in the step raises an exception, the entire step&#8217;s writes are discarded. None of the parallel results land. This isn&#8217;t a bug - it&#8217;s the guarantee that makes checkpointing meaningful. You never observe a half-applied superstep.</p><p>Selection is deterministic, too. An actor fires only when a channel it subscribes to has new data. The engine loops until no actor has pending work, or a step limit is hit. This is Bulk Synchronous Parallel - the same model that powers Apache Spark&#8217;s graph processing layer.</p><p>Two consequences fall out of this design, and both matter at 2am in production.</p><p><strong>First, parallelism is free when nodes are independent.</strong> If two nodes subscribe to the same input channel and write to different channels, they run in the same superstep with no extra configuration. The engine figures it out.</p><p><strong>Second, concurrent writes to the same channel need a reducer.</strong> Without one, the engine has no way to know which write wins - so it refuses to guess.</p><p>That second consequence is where most production bugs live.</p><div><hr></div><h2>The Silent Corruption Problem</h2><p>Here&#8217;s the error the runtime throws when you get it wrong:</p><pre><code><code>InvalidUpdateError: At key 'todos':
Can receive only one value per step.
Use an Annotated key to handle multiple values.
</code></code></pre><p>This error is loud. It fires immediately. You see it, you fix it.</p><p>The silent version is worse.</p><p>If your graph has a single path today and no concurrent writes, the overwrite default works fine. You never see the error. Then weeks later - you add a parallel branch. A fan-out pattern, a subagent, a retry. Suddenly two nodes land writes in the same step. If the bug fires only intermittently, you get something uglier than an exception: wrong answers in production, with no trace of why.</p><p>The fix is one line:</p><pre><code><code>from typing import Annotated
import operator

class AgentState(TypedDict):
    messages: Annotated[list, operator.add]  # append, do not overwrite
    todos: Annotated[list[Todo], operator.add]
</code></code></pre><p>This isn&#8217;t theoretical. It&#8217;s still happening in production frameworks. As of November 2025, running the official research example in <a href="https://github.com/langchain-ai/deepagentsjs/issues/65">deepagentsjs</a> throws this exact error - the <code>todos</code> state key has no reducer, so the underlying channel falls back to <code>LastValue</code>, which refuses concurrent updates. The fix is the same in every case: annotate the channel with a reducer like <code>operator.add</code> so concurrent writes append instead of collide. CopilotKit shipped the identical patch for their LangGraph integration in August 2025 (<a href="https://github.com/CopilotKit/CopilotKit/pull/2276">PR #2276</a>).</p><blockquote><p>&#9889; <strong>If you remember one thing from this post:</strong> every state key that could receive concurrent writes needs a reducer. The question isn&#8217;t whether you have parallel execution today. It&#8217;s whether you might add it next sprint.</p></blockquote><div><hr></div><h2>Compilation: The Step Most Writers Skip</h2><p><code>graph.compile()</code> is not a convenience call - it&#8217;s where LangGraph turns your declarative graph into an executable plan.</p><p>During compilation, the engine does four things:</p><ol><li><p>Validates that every conditional edge routes to a declared node</p></li><li><p>Builds the channel topology from your state schema and reducers</p></li><li><p>Constructs the actual <code>PregelNode</code> objects from your node functions</p></li><li><p>Freezes the graph - the compiled object is immutable</p></li></ol><p>What <code>compile()</code> returns is a <code>Pregel</code> instance. <em>That&#8217;s</em> what you invoke, stream from, and checkpoint. The <code>StateGraph</code> you built was a blueprint. The <code>Pregel</code> is the machine.</p><p>This matters because compilation errors are caught before a single token of inference runs. Return a value from a conditional edge that isn&#8217;t in the edge map, and compilation throws immediately &#8212; something like:</p><pre><code><code>ValueError: Expected one of ['tools', 'end'], got 'tool'
Check your conditional edge return values.
</code></code></pre><p>Typo in an edge name. Zero LLM calls wasted. That&#8217;s the contract <code>compile()</code> offers - and most agent frameworks can&#8217;t give you anything close to it.</p><div><hr></div><h2>Checkpointing Is Write-Ahead Logging</h2><p>Every database engineer already knows how checkpointing works, even if the docs don&#8217;t put it that way. LangGraph&#8217;s checkpointer is write-ahead logging applied to agent state.</p><p>After every superstep, the full channel state is serialized and persisted. On resume, the engine reads the latest checkpoint and continues from the superstep boundary. Simple idea, enormous consequences.</p><p>The persisted object is a <code>Checkpoint</code> - a versioned snapshot containing <code>channel_values</code>, <code>channel_versions</code>, and any pending writes from nodes that succeeded while a sibling was failing. The <code>thread_id</code> is the namespace key: one agent session, one thread. Different threads can&#8217;t see each other&#8217;s state.</p><p>One primitive, four use cases - really the same capability wearing different clothes:</p><ul><li><p><strong>Durable execution</strong> - crash mid-run, resume from the last checkpoint, lose nothing</p></li><li><p><strong>Human-in-the-loop</strong> - interrupt before a node, serialize, wait for approval, resume</p></li><li><p><strong>Time travel</strong> - load any historical checkpoint, replay from there, fork alternate paths</p></li><li><p><strong>Partial failure recovery</strong> - if one node fails mid-step, the completed parallel writes get stored as pending; on resume, only the failed node re-runs</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xfcb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xfcb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xfcb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png" width="1456" height="1294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1294,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:421929,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/194642827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.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_!xfcb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!xfcb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa2b3caf3-e229-46f3-aebc-7bf7cc5d94df_2700x2400.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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>The Postgres checkpointer shows the mechanics clearly. It maintains four tables. <code>checkpoints</code> holds state snapshots as JSONB. <code>checkpoint_blobs</code> holds large values as binary. <code>checkpoint_writes</code> logs pending writes from mid-step failures. <code>checkpoint_migrations</code> tracks schema versions. Each superstep is an insert; resume is a read of the latest row for a given <code>thread_id</code>.</p><p>The trap is write amplification at scale. A long-running agent with a growing message list writes the full state every superstep. If messages accumulate unboundedly and checkpoints fire every step, checkpoint size grows linearly with conversation length.</p><p>One developer <a href="https://blog.lordpatil.com/posts/langgraph-postgres-checkpointer">documented four-second reads</a> on long threads in their production chatbot - the pickled message history sitting in <code>checkpoint_blobs</code> had grown large enough that loading a conversation meant a database query, a binary download, and a full pickle deserialization before the UI could render.</p><p>The fix is to evict. Summarize old messages, offload large tool results, keep the hot state small. DeepAgents handles this with a <code>SummarizationMiddleware</code> that compacts conversation history once token usage crosses a threshold. That&#8217;s the pattern in one sentence: checkpointing is cheap only if the state stays bounded.</p><div><hr></div><h2>Subgraphs and the State Boundary Problem</h2><p>Every production agent eventually outgrows a single graph. A planner calls an executor. A router dispatches to specialists. A retrieval pipeline feeds into a synthesis step. LangGraph handles this natively - a compiled graph is itself callable as a node inside another graph.</p><p><strong>The mental model:</strong> a subgraph is a reusable block of graph. Think of it like a function - compile once, invoke from anywhere. Same runtime, same checkpointer, same supersteps. When the parent reaches the subgraph node, execution descends into the child, runs to completion, and returns to the parent&#8217;s next superstep.</p><h4>The boundary is where it gets interesting</h4><p>Parent and child have separate state schemas. They have to - otherwise every subgraph would inherit every key from every possible parent, and the schemas would explode.</p><p>When execution crosses the boundary, state must be mapped. LangGraph does this one of two ways:</p><ul><li><p><strong>If the schemas share keys</strong>, state flows through those keys automatically. The parent&#8217;s <code>messages</code> channel wires to the child&#8217;s <code>messages</code> channel. Updates propagate.</p></li><li><p><strong>If the schemas don&#8217;t share keys</strong>, you pass state explicitly at invocation and transform the child&#8217;s output back into the parent&#8217;s shape. This is the boundary that silently breaks.</p></li></ul><p><strong>The failure mode:</strong> you write a subgraph with state key <code>documents</code>. Your parent has state key <code>retrieved_docs</code>. The subgraph runs, writes to <code>documents</code>, returns. The parent&#8217;s <code>retrieved_docs</code> is still empty. No error. No stack trace. Just a synthesis step running on zero documents, producing a confident-sounding but ungrounded answer.</p><p>The fix is explicit mapping:</p><pre><code><code>def call_retrieval(state: ParentState) -&gt; dict:
    result = retrieval_subgraph.invoke({"query": state["user_question"]})
    return {"retrieved_docs": result["documents"]}  # explicit key mapping
</code></code></pre><p>Treat subgraph boundaries like API contracts. Declare them explicitly. Validate the output shape.</p><div><hr></div><blockquote><h3>&#9888;&#65039; Subgraphs &#8800; Subagents</h3><p>Don&#8217;t confuse structural organization with behavioral autonomy.</p><ul><li><p><strong>Subgraphs are about code hygiene.</strong> Nested graphs that keep your main graph from becoming a spaghetti monster. They share the same execution engine and flow state through explicit channel mappings.</p></li><li><p><strong>Subagents are about context isolation.</strong> An autonomous loop with its own context window. It doesn&#8217;t just share state - it filters it, preventing <em>context pollution</em> where the messy reasoning of one specialist confuses the planner.</p></li></ul><p><strong>You use a subgraph when you want to repeat a pattern. You use a subagent when you want to delegate a problem.</strong></p></blockquote><div><hr></div><h2>DeepAgents: The Harness Around the Graph</h2><p>LangGraph gives you the runtime. DeepAgents gives you the architecture.</p><p>A vanilla ReAct loop fails in four predictable ways: shallow planning, context overflow, context pollution, state bloat. DeepAgents is a direct answer to each.</p><p>It&#8217;s an open-source harness from LangChain - a <code>CompiledStateGraph</code> wrapped with four middleware layers, each solving one failure mode:</p><ul><li><p><strong>TodoListMiddleware</strong> - <code>write_todos</code> forces the agent to decompose the task and write the plan into context before acting</p></li><li><p><strong>FilesystemMiddleware</strong> - <code>ls</code>, <code>read_file</code>, <code>write_file</code>, and friends let the agent offload large content to a virtual filesystem. The prompt holds pointers, not pages.</p></li><li><p><strong>SubAgentMiddleware</strong> - <code>task</code> spawns an isolated subagent with its own context window. Only the final result returns. The messy middle stays hidden.</p></li><li><p><strong>SummarizationMiddleware</strong> - watches token usage, compacts history when it crosses a threshold. Keeps checkpoints cheap.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!feVE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!feVE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!feVE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!feVE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!feVE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!feVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png" width="1456" height="1294" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1294,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:389505,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://internals.laxmena.com/i/194642827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.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_!feVE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 424w, https://substackcdn.com/image/fetch/$s_!feVE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 848w, https://substackcdn.com/image/fetch/$s_!feVE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 1272w, https://substackcdn.com/image/fetch/$s_!feVE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F720e5369-ce0f-4b84-9733-5d1af4997283_2700x2400.png 1456w" sizes="100vw" loading="lazy"></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 role="img" 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><title></title><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>Notice what DeepAgents <em>doesn&#8217;t</em> invent. Every capability sits on top of LangGraph primitives - channels, reducers, checkpointing, subgraphs. DeepAgents isn&#8217;t a different framework. It&#8217;s a set of opinionated patterns for using LangGraph well at scale.</p><p>That distinction matters more than it looks. If you understand LangGraph&#8217;s internals, DeepAgents reads as a library of workable defaults. If you don&#8217;t, it reads as magic. And magic becomes impossible to debug the first time something breaks.</p><div><hr></div><h2>Five Failure Modes You Will See in Production</h2><p>Every one of these is documented - in GitHub issues, official docs, or production writeups.</p><div><hr></div><p><strong>1. Concurrent write without a reducer.</strong> <code>InvalidUpdateError: At key 'X': Can receive only one value per step.</code> Two actors wrote to the same channel in one superstep without an annotated reducer. The engine refuses to guess which write wins. Fix: <code>Annotated[list, operator.add]</code> or a custom reducer. Sources: <a href="https://docs.langchain.com/oss/python/langgraph/errors/INVALID_CONCURRENT_GRAPH_UPDATE">Official docs</a> &#183; <a href="https://github.com/langchain-ai/deepagentsjs/issues/65">deepagentsjs #65</a></p><p>This is the first bug every multi-agent system ships.</p><div><hr></div><p><strong>2. Empty update from a node.</strong> <code>InvalidUpdateError: Must write to at least one of [...]</code> A node returned nothing. Happens most often with conditional routing nodes that forget to return a payload on certain branches. Fix: Always return an explicit dict - even <code>{"messages": []}</code> satisfies the engine. Sources: <a href="https://github.com/langchain-ai/langgraph/issues/740">langgraph #740</a> &#183; <a href="https://github.com/langchain-ai/langgraph/issues/2644">langgraph #2644</a></p><p>The engine is strict by design &#8212; it would rather throw than guess.</p><div><hr></div><p><strong>3. State bloat at checkpoint time.</strong> Checkpoint reads in seconds, not milliseconds. Unbounded message lists, large tool results stored inline. Every superstep serializes the full channel state. Messages that grow without a cap grow the checkpoint linearly. Fix: Summarize or offload. Keep the hot state small. Source: <a href="https://blog.lordpatil.com/posts/langgraph-postgres-checkpointer">lordpatil, July 2025</a> - four-second reads on a production chatbot, traced to <code>checkpoint_blobs</code>.</p><p>Checkpointing is only free if you treat state as precious. Most people don&#8217;t, until this.</p><div><hr></div><p><strong>4 &amp; 5. Subgraph state silently not flowing / Serialization failures.</strong></p><p>These appear less as sudden crashes and more as slow-burn confusion. Schema mismatch at a subgraph boundary (failure 4) produces no error - just a parent state that never updates, and an agent that silently runs on stale data. Fix: explicit key mapping at the invocation site. (<a href="https://langchain-ai.github.io/langgraph/how-tos/subgraph/">Official subgraph docs</a>)</p><p>Serialization failures (failure 5) fire during <code>put_writes</code> or resume: <code>TypeError: Object of type X is not JSON serializable</code>. The <code>JsonPlusSerializer</code> uses ormsgpack; anything it can&#8217;t encode breaks the checkpoint. Fix: keep only serializable objects in state, or use <code>JsonPlusSerializer(pickle_fallback=True)</code> for DataFrames and custom types. (<a href="https://github.com/langchain-ai/langgraph/issues/3441">langgraph #3441</a> &#183; <a href="https://github.com/langchain-ai/langgraph/issues/5769">langgraph #5769</a>)</p><div><hr></div><p>Each of these is the kind of bug you ship without noticing. Each has a one-line fix once you see it. The difference between a senior engineer and a principal one on agent code is knowing which to check first.</p><div><hr></div><h2>What to Take Away</h2><p>Three things that should survive this post.</p><p><strong>LangGraph is a message-passing runtime with transactional supersteps - not a graph of function calls.</strong> Once you see channels and reducers as the real primitives, everything else follows: parallelism, checkpointing, subgraphs, even DeepAgents.</p><p><strong>Every state key that might receive concurrent writes needs a reducer.</strong> The overwrite default is safe until it isn&#8217;t, and the failure mode is silent corruption.</p><p><strong>DeepAgents is a library of patterns for managing the context budget.</strong> Planning, filesystem offloading, subagent isolation, summarization - four answers to the same underlying question: how do you keep the hot state small while the task stays long?</p><div><hr></div><p><em>Next issue: <strong>Embeddings Internals.</strong> Why cosine similarity gets weird in high dimensions. What contrastive training actually learns. Why a general-web embedding model will silently fail on your domain data - and how to know when to fine-tune versus pick a better base model.</em></p><div><hr></div><p><em>INTERNALS.md is a technical series on how production AI systems actually work. No tutorials. No framework evangelism. Just the layer beneath.</em></p><p><em>If this was useful, the best thing you can do is share it with one engineer who'd care.</em></p><div><hr></div><p></p>]]></content:encoded></item></channel></rss>