<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Build Loops</title>
    <description>The latest articles on DEV Community by Build Loops (@buildloops).</description>
    <link>https://dev.to/buildloops</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4064191%2Fe637e748-c970-4615-b9c5-940d72798bfe.png</url>
      <title>DEV Community: Build Loops</title>
      <link>https://dev.to/buildloops</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/buildloops"/>
    <language>en</language>
    <item>
      <title>Your Coding Agent Has More Access Than You Think. Here's the Audit.</title>
      <dc:creator>Build Loops</dc:creator>
      <pubDate>Mon, 10 Aug 2026 11:38:12 +0000</pubDate>
      <link>https://dev.to/buildloops/your-coding-agent-has-more-access-than-you-think-heres-the-audit-2b3i</link>
      <guid>https://dev.to/buildloops/your-coding-agent-has-more-access-than-you-think-heres-the-audit-2b3i</guid>
      <description>&lt;p&gt;DEV.to has a trend right now called "sandboxing your AI coding agent." Nineteen posts in a week. New accounts, template titles, and one of them openly admits it's vendor outreach. It's noise — but the signal under it is real: developers are realizing their coding agent has actual power over their machine, and they don't know where it ends.&lt;/p&gt;

&lt;p&gt;I can tell you where it ends, because the answer is public. And it's not where most people think.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do you know what your agent can actually touch — read, write, run, and phone home?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's the question this post answers. Not with vibes, not with a sales pitch, and not with "just trust it." With the real permission defaults, the real failure receipts, and a five-check audit you can run in an afternoon.&lt;/p&gt;




&lt;h2&gt;
  
  
  Your agent is more powerful than you think
&lt;/h2&gt;

&lt;p&gt;Coding agents ship with the same three powers that make security people nervous: a shell, file write access, and network access. The difference between tools isn't whether they &lt;em&gt;have&lt;/em&gt; those powers — it's what they do before using them.&lt;/p&gt;

&lt;p&gt;Take the two agents most people are actually using right now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenCode defaults to allow.&lt;/strong&gt; From their own docs: "If you don't specify anything, OpenCode starts from permissive defaults — most permissions default to &lt;code&gt;allow&lt;/code&gt;." The only two things that prompt you by default are accesses outside your working directory and repeated tool calls. &lt;code&gt;.env&lt;/code&gt; files are denied — the one hard rule baked in. Everything else, including a full &lt;code&gt;bash&lt;/code&gt; shell, runs without asking.&lt;/p&gt;

&lt;p&gt;And here's the part almost nobody knows: &lt;strong&gt;OpenCode has no sandbox. It's their own words.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"OpenCode does not sandbox the agent. The permission system exists as a UX feature… it is not designed to provide security isolation. If you need true isolation, run OpenCode inside a Docker container or VM."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's from their &lt;a href="https://github.com/anomalyco/opencode/security" rel="noopener noreferrer"&gt;SECURITY.md&lt;/a&gt;. The permission prompt is a convenience, not a cage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Claude Code is the cautious one — relatively.&lt;/strong&gt; Bash commands ask before running, except a fixed read-only subset (&lt;code&gt;cat&lt;/code&gt;, &lt;code&gt;grep&lt;/code&gt;, &lt;code&gt;pwd&lt;/code&gt;, &lt;code&gt;diff&lt;/code&gt;, read-only git…). Permission rules are evaluated deny → ask → allow. It has a real &lt;a href="https://code.claude.com/docs/en/sandboxing" rel="noopener noreferrer"&gt;sandboxed Bash tool&lt;/a&gt; (bubblewrap on Linux, Seatbelt on macOS) that isolates filesystem and network. Anthropic claims it cuts permission prompts by &lt;a href="https://www.anthropic.com/engineering/claude-code-sandboxing" rel="noopener noreferrer"&gt;84% internally&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But even "cautious" means: shell access, write access, network access — all present, all gated by prompts you habitually click through.&lt;/p&gt;

&lt;p&gt;This gap between "the tool asks me sometimes" and "the tool is actually contained" is exactly what OWASP calls &lt;a href="https://owasp.org/www-project-top-10-for-large-language-model-applications/2_0_vulns/LLM06_ExcessiveAgency" rel="noopener noreferrer"&gt;excessive agency&lt;/a&gt; — the #1 blind spot in agent security.&lt;/p&gt;

&lt;p&gt;Developers already sense it. In the 2025 Stack Overflow survey, &lt;a href="https://survey.stackoverflow.co/2025/ai" rel="noopener noreferrer"&gt;81% of developers said they're concerned about AI security&lt;/a&gt; — yet 52% either don't use agents or stick to simple ones, and 38% have no adoption plan. Concern is high, verification is rare. That gap is this post.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where it breaks: the receipts
&lt;/h2&gt;

&lt;p&gt;This isn't hypothetical. Every major agent has a patched CVE or a user-reported incident on the same handful of failure modes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prompt injection turns approved commands into remote code execution.&lt;/strong&gt; Trail of Bits showed argument injection against pre-approved commands achieving &lt;a href="https://blog.trailofbits.com/2025/10/22/prompt-injection-to-rce-in-ai-agents/" rel="noopener noreferrer"&gt;one-shot RCE on popular agents&lt;/a&gt;. Academic research measured up to &lt;a href="https://arxiv.org/html/2509.22040v2" rel="noopener noreferrer"&gt;84% command-execution success&lt;/a&gt; against Cursor and Copilot with prompt injection.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo files execute code before you approve anything.&lt;/strong&gt; This is the scariest cluster, because it happens &lt;em&gt;before the trust dialog&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CVE-2025-65099 — a malicious Yarn config in a project ran code before Claude Code's trust prompt.&lt;/li&gt;
&lt;li&gt;CVE-2026-21852 — a repo's &lt;code&gt;ANTHROPIC_BASE_URL&lt;/code&gt; redirected API traffic and siphoned the API key before the trust prompt. CVSS 7.5.&lt;/li&gt;
&lt;li&gt;CVE-2026-33068 — a repo silently set &lt;code&gt;permissions.defaultMode: bypassPermissions&lt;/code&gt; and skipped the trust dialog entirely. CVSS 8.8.&lt;/li&gt;
&lt;li&gt;CVE-2025-54795 — command injection via &lt;code&gt;echo&lt;/code&gt; parsing let a prompt-injected agent run arbitrary commands. CVSS 9.8.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;"Secure" modes leak.&lt;/strong&gt; A &lt;code&gt;bypassPermissions&lt;/code&gt; rule, a misread glob, a model-generated path, and the boundary is gone: &lt;a href="https://github.com/cursor/cursor/security/advisories/GHSA-534m-3w6r-8pqr" rel="noopener noreferrer"&gt;Cursor's allowlist bypass&lt;/a&gt;, and &lt;a href="https://github.com/openai/codex/security/advisories/GHSA-w5fx-fh39-j5rw" rel="noopener noreferrer"&gt;Codex's sandbox bypass&lt;/a&gt; where the model-controlled working directory became the writable root.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And the user-reported incidents read like a horror list:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An agent &lt;a href="https://github.com/anthropics/claude-code/issues/62091" rel="noopener noreferrer"&gt;deleted a user's main GitHub repository&lt;/a&gt; after misreading a rename command. Restored via GitHub's 90-day window.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm -rf src&lt;/code&gt; &lt;a href="https://github.com/anthropics/claude-code/issues/7090" rel="noopener noreferrer"&gt;wiped a Vue project&lt;/a&gt; in standard, non-auto mode.&lt;/li&gt;
&lt;li&gt;An agent launched in an empty directory &lt;a href="https://github.com/anthropics/claude-code/issues/41560" rel="noopener noreferrer"&gt;wrote 40+ files into a sibling repo&lt;/a&gt; without saying anything.&lt;/li&gt;
&lt;li&gt;Cursor &lt;a href="https://github.com/cursor/cursor/issues/2546" rel="noopener noreferrer"&gt;read and echoed &lt;code&gt;.env&lt;/code&gt; credentials&lt;/a&gt; despite a &lt;code&gt;.cursorignore&lt;/code&gt; file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pattern across all of them: &lt;strong&gt;the boundary held until it didn't, and nothing noticed until after the damage.&lt;/strong&gt; That's why the audit below exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  The audit: five checks, one afternoon
&lt;/h2&gt;

&lt;p&gt;No security degree required. Run these once now, and re-run after every agent or tool update — because each update can silently change the defaults.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check 1 — Read your permission config
&lt;/h3&gt;

&lt;p&gt;Find out exactly what runs without asking. In Claude Code, run &lt;code&gt;/permissions&lt;/code&gt; and inspect &lt;code&gt;settings.json&lt;/code&gt; — the deny → ask → allow order means a single &lt;code&gt;ask&lt;/code&gt; rule can silently upgrade. In OpenCode, review the &lt;code&gt;permission&lt;/code&gt; block in your config and your agent files. You're hunting for three things: blanket rules like &lt;code&gt;Bash(*)&lt;/code&gt;, any auto or bypass mode, and network tools (&lt;code&gt;webfetch&lt;/code&gt;, &lt;code&gt;websearch&lt;/code&gt;, &lt;code&gt;curl&lt;/code&gt;). Ask yourself: &lt;em&gt;is there a single command here I would never want auto-approved?&lt;/em&gt; If yes, that rule gets a &lt;code&gt;deny&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check 2 — Plant canaries
&lt;/h3&gt;

&lt;p&gt;A canary is a decoy your agent has no legitimate reason to touch. Drop a fake credential into a file (&lt;code&gt;sk-test-DONOTREAD-…&lt;/code&gt;), a bait &lt;code&gt;.env&lt;/code&gt;, or a tripwire file outside the workspace. Check after your sessions: if the canary moved, got read, or shows up in agent logs — the boundary leaked. &lt;a href="https://canarytokens.org" rel="noopener noreferrer"&gt;Canary tokens&lt;/a&gt; turn this into an alert. The read is invisible to you otherwise: file reads leave no trace, which is exactly why a canary is the right tool.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check 3 — Test egress
&lt;/h3&gt;

&lt;p&gt;Can the agent reach the network? Blocked HTTP with open DNS is still an exfiltration pipe. Two probes: request the cloud metadata endpoint &lt;code&gt;169.254.169.254&lt;/code&gt; (it should &lt;em&gt;fail&lt;/em&gt;), and check whether your DNS resolver logs hits on a hostname only the agent could have looked up. If you care about this, default-deny the network with a proxy or firewall rules — don't assume the agent's "network access" setting means anything on your machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check 4 — Verify the sandbox is real
&lt;/h3&gt;

&lt;p&gt;If you rely on a sandbox, confirm it's enforced, not just configured. A container with &lt;code&gt;--privileged&lt;/code&gt;, &lt;code&gt;--cap-add=SYS_ADMIN&lt;/code&gt;, &lt;code&gt;seccomp=unconfined&lt;/code&gt;, or a mounted &lt;code&gt;docker.sock&lt;/code&gt; is not a sandbox — it's a room with the door off. Check with &lt;code&gt;docker inspect&lt;/code&gt;, look at &lt;code&gt;/proc/self/attr/current&lt;/code&gt; for AppArmor, and probe a blocked syscall. Tools like &lt;a href="https://github.com/declaw-ai/cagecheck" rel="noopener noreferrer"&gt;cagecheck&lt;/a&gt; automate this. And remember the OpenCode case: if your tool has &lt;em&gt;no&lt;/em&gt; sandbox, the only honest isolation is a container or VM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check 5 — Make read-only real
&lt;/h3&gt;

&lt;p&gt;Plan mode and read-only agents are prompt-based, not enforced — a misbehaving model can still write. If you want a hard guarantee, enforce it structurally: a &lt;code&gt;PreToolUse&lt;/code&gt; hook that returns &lt;code&gt;deny&lt;/code&gt; for edit/write tools outside approved modes, or run exploration agents against a read-only mount. Enforce with a hook, don't hope with a prompt.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where trust really breaks
&lt;/h2&gt;

&lt;p&gt;The audit catches what's misconfigured. But there's a deeper failure that no checklist fixes — and it's the one the trend posts never mention:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Permission rules are enforced by the tool, not by the model.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An &lt;code&gt;allow&lt;/code&gt; rule is a contract the tool will honor. The model, on the other hand, is a probabilistic text-completer that can be prompt-injected, can misread a path, or can interpret "clean up" as "delete everything in &lt;code&gt;src&lt;/code&gt;." The load doesn't guarantee the obey. Every incident above is a loaded rule that wasn't obeyed — which is exactly why a session log matters (&lt;a href="https://dev.to/buildloops/i-built-a-session-log-that-survived-my-migration-heres-the-three-file-system-4bj6"&gt;I wrote the system for that&lt;/a&gt;), and why I keep saying migration is a re-declaration, not a file copy (&lt;a href="https://dev.to/buildloops/i-migrated-my-claude-code-workflow-to-opencode-heres-what-broke-5ajc"&gt;the diary version&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The practical consequence: &lt;strong&gt;boundaries are a systems-design problem, not a model-politeness problem.&lt;/strong&gt; Your agent's cage is your config, your hooks, and your harness — not the model's mood. That's the framework behind the whole AGENTS.md approach I write about.&lt;/p&gt;




&lt;h2&gt;
  
  
  The verdict
&lt;/h2&gt;

&lt;p&gt;You don't need to fear your coding agent. You do need to audit it — because the defaults are wider than you think, the failures are documented and recurring, and nobody else is going to check for you.&lt;/p&gt;

&lt;p&gt;Five checks. One afternoon. Re-run on every tool update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read your permission config. Plant canaries. Test egress. Verify the sandbox. Enforce read-only.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Then ask yourself the question from the top of this post, and actually know the answer: what can my agent read, write, run, and phone home?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;The "sandbox your agent" trend is full of posts from accounts that were created last week. The signal under the noise is real, and it's this: nobody's checking what their agent can touch. This is the check.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What's the one thing you'd never want your agent to touch — and have you tested whether it can?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The weird part of the boundary story is that your own rules file is the biggest boundary you already control. Start there: &lt;a href="https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o"&gt;Why Your Coding Agent Keeps Making the Same Mistakes — AGENTS.md Fixes It&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I write about AI engineering stacks, autonomous developer tools, and structural agent design. If you're building in this space, follow &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/buildloops"&gt;@buildloops&lt;/a&gt;&lt;/strong&gt; for weekly breakdowns!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>security</category>
      <category>programming</category>
    </item>
    <item>
      <title>Loaded Obeyed: Why Your Agent Quotes Rules It Doesn't Follow</title>
      <dc:creator>Build Loops</dc:creator>
      <pubDate>Sun, 09 Aug 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/buildloops/loaded-obeyed-why-your-agent-quotes-rules-it-doesnt-follow-2256</link>
      <guid>https://dev.to/buildloops/loaded-obeyed-why-your-agent-quotes-rules-it-doesnt-follow-2256</guid>
      <description>&lt;p&gt;&lt;em&gt;The file was loaded. The rules just weren't followed. Here's the two-failure diagnostic that tells you which one you have — and what to do for each.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My agent used to follow my rules. The output-format rules, written once into a &lt;code&gt;CLAUDE.md&lt;/code&gt;, were obeyed like law — for months, in Claude Code.&lt;/p&gt;

&lt;p&gt;Then I migrated to OpenCode, and the rules quietly stopped meaning anything. The agent quoted them back flawlessly. It recited them every time I asked. And it ignored them, day after day, rule after rule. The file was loaded. The rules just weren't obeyed.&lt;/p&gt;

&lt;p&gt;The fix wasn't stronger wording, and it wasn't a better prompt. It was re-declaring every rule, one by one, into a fresh &lt;code&gt;AGENTS.md&lt;/code&gt; — and it held.&lt;/p&gt;

&lt;p&gt;That's the lesson this post is built on: a rule that isn't followed is one of two failures. Either it never loaded, or it loaded and lost. Here's how to tell which, and what to do for each.&lt;/p&gt;




&lt;h2&gt;
  
  
  The days of the break
&lt;/h2&gt;

&lt;p&gt;I didn't run that test once. I ran it in fresh sessions, multiple times, for days. Every time, the same answer: a perfect recital. Every time, the same next output: the format rules broken.&lt;/p&gt;

&lt;p&gt;In the middle of it, the token usage climbed — noticeably higher than expected. Not because the work was harder. Because the rules were being re-derived and re-explained instead of followed, every session, on top of a &lt;code&gt;MEMORY.md&lt;/code&gt; that was already bloated. Token waste and trust damage from the same root cause.&lt;/p&gt;

&lt;p&gt;This is the exact state readers end up in with their own agents, and the reason most of them are on GitHub filing issues that never get answered.&lt;/p&gt;

&lt;p&gt;So let's name what that means.&lt;/p&gt;

&lt;h2&gt;
  
  
  The two lanes — the diagnostic
&lt;/h2&gt;

&lt;p&gt;Here's the model that ended my guesswork. A rule that isn't followed is one of two failures:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Lane A — never loaded&lt;/th&gt;
&lt;th&gt;Lane B — loaded and lost&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What it is&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;A file/loading problem: wrong file, nested or path-scoped rule, compacted away, not read at all&lt;/td&gt;
&lt;td&gt;A model-behavior problem: the rule reached the context window and still didn't steer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;The truth about it&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;The harness never applied weight to this rule&lt;/td&gt;
&lt;td&gt;Rules are context, not enforced configuration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;The fix&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Re-declare it into the file the harness actually reads, then verify&lt;/td&gt;
&lt;td&gt;Redesign the rule's shape, or move it to a mechanism that can't lose&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cost of guessing wrong&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;You reword a rule that never mattered&lt;/td&gt;
&lt;td&gt;You reword a rule forever, because wording was never the lever&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The whole point of the model is that these are two different problems with two different fixes. Most advice treats them as one problem — "write better rules" — which is why so much of that advice doesn't change anything.&lt;/p&gt;

&lt;p&gt;My migration had both lanes in play. But the one that broke me was neither, exactly. It was the state in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gray zone — "loaded but not load-bearing"
&lt;/h2&gt;

&lt;p&gt;Here's what my migration actually looked like. OpenCode reads &lt;code&gt;AGENTS.md&lt;/code&gt; as its first-class rules file, and it falls back to &lt;code&gt;CLAUDE.md&lt;/code&gt; if there's no &lt;code&gt;AGENTS.md&lt;/code&gt; — which is why the agent could quote my old rules at all. The fallback file was present enough to recite.&lt;/p&gt;

&lt;p&gt;Present enough to quote. Not enough to act on.&lt;/p&gt;

&lt;p&gt;The telling detail was what the agent &lt;em&gt;couldn't&lt;/em&gt; do. It could recite the general rules. It couldn't tie them to a file or a plan — it couldn't tell me where they lived or what it would do to follow them. That's the gray zone's fingerprint: quoting without any load-bearing behind it.&lt;/p&gt;

&lt;p&gt;I call that state &lt;strong&gt;loaded but not load-bearing&lt;/strong&gt; — and it quietly breaks the most common piece of advice in this space: &lt;em&gt;"ask your agent what your rules are."&lt;/em&gt; I asked, every single day. The answer was always a perfect recital. The recital proved a file existed. It proved nothing about whether the rule carried any weight.&lt;/p&gt;

&lt;p&gt;That's the trap the two-lane model has to catch before it can help you: the gray zone — a rule that is loaded, quotable, and useless.&lt;/p&gt;

&lt;h2&gt;
  
  
  The verification hierarchy — the only test that works
&lt;/h2&gt;

&lt;p&gt;The reason "what are my rules?" failed me is that it's the bottom rung of a three-rung ladder:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Quoted.&lt;/strong&gt; "What are my rules?" — proves a file of some kind was read. Proves nothing about which file, or whether it steers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quoted and located.&lt;/strong&gt; "Quote the exact rule and show me where it lives." — this catches the gray zone. If the agent can quote the rule &lt;em&gt;and&lt;/em&gt; point at the file that's actually being loaded, you know you're in Lane B. If it can't, you're in Lane A (or the gray zone).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Behavioral output.&lt;/strong&gt; The rule is followed in real work, consistently, without you re-asking. This is the only proof of obedience.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The one line you can run today:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Quote the exact rule, show me where it lives, and tell me what you'll do with it."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And what a passing answer looks like — this is the test I ran after the re-declaration:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The output-format rule is the first block under &lt;strong&gt;Output format&lt;/strong&gt; in &lt;code&gt;AGENTS.md&lt;/code&gt;. It requires a per-file summary (path, what changed, why) and a fenced, language-tagged code block for every diff. I'll apply it: every change in this session gets that summary and a tagged diff block."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's quoted + located + plan statement — level 2 proven. Then you watch the next output for level 3.&lt;/p&gt;

&lt;p&gt;The asymmetry matters here: Claude Code can show you loading proof directly — &lt;code&gt;/context&lt;/code&gt; lists what actually loaded. OpenCode doesn't have an equivalent shipped (there's an open issue asking for loading verification). Which means on OpenCode, this test isn't optional. It's the whole test.&lt;/p&gt;

&lt;h2&gt;
  
  
  The docs say it's by design
&lt;/h2&gt;

&lt;p&gt;This is the part that ended the blame-game for me, because the mechanism is documented.&lt;/p&gt;

&lt;p&gt;Anthropic's own memory docs describe &lt;code&gt;CLAUDE.md&lt;/code&gt; as providing "context, not enforced configuration." And they're explicit about what that means: there's "no guarantee of strict compliance" — the wording is right there in the docs for anyone to read.&lt;/p&gt;

&lt;p&gt;Your agent ignoring a rule you wrote is not a personal prompt failure. It's the documented behavior of a system where instructions are context rather than commands. That reframes the whole problem: the question isn't "why is my agent broken," it's "which lane is this rule in, and what does the fix look like when instructions aren't commands?"&lt;/p&gt;

&lt;p&gt;And it's not just me saying it. The issue trackers are full of this exact failure — users reporting "my agent quoted my rules back and ignored them," and the admissions go further. In one thread, a user counted 14+ corrections on a single rule before anything stuck. The demand set is real, current, and cross-harness: it's the "I Told You" Developer's situation, at scale.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lane A fix — re-declare, then verify
&lt;/h2&gt;

&lt;p&gt;What finally fixed my migration wasn't a better prompt or stronger wording. It was re-declaring every rule, one by one, into a fresh &lt;code&gt;AGENTS.md&lt;/code&gt; — the file OpenCode actually applies weight to.&lt;/p&gt;

&lt;p&gt;Copying files across hadn't worked. The old &lt;code&gt;CLAUDE.md&lt;/code&gt; came along, was read as a fallback, and was quotable without being load-bearing. The re-declaration was different because it moved the rules into the first-class file — and then I verified each one at level 2, and watched the output for level 3.&lt;/p&gt;

&lt;p&gt;Here's the shape the rule needed to take. This is a faithful reconstruction of the kind of rule that lived in the fallback &lt;code&gt;CLAUDE.md&lt;/code&gt; — a paragraph buried in a file that held rules, context, and everything else:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Always present your output in a clear and professional format. Use code blocks where appropriate and make sure diffs are easy to read. Pay attention to formatting quality in all responses.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Vague, not checkable, one paragraph competing with every other paragraph in the file.&lt;/p&gt;

&lt;p&gt;And this is how the same rule reads re-declared in the fresh &lt;code&gt;AGENTS.md&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Output format (required, no exceptions):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every change is summarized as: file path, what changed, why.&lt;/li&gt;
&lt;li&gt;Every diff is a fenced code block tagged with the language.&lt;/li&gt;
&lt;li&gt;Never inline a diff without a code block.&lt;/li&gt;
&lt;li&gt;When in doubt about the format, ask before outputting — do not improvise.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every line is checkable — the summary either has the three parts or it doesn't; the diff either is fenced or isn't. Self-verifying by observation.&lt;/p&gt;

&lt;p&gt;It was a one-time fix. The rules went into a fresh &lt;code&gt;AGENTS.md&lt;/code&gt; once, and the loaded-but-not-load-bearing state never came back. Since that day I've been fully settled on OpenCode — the fixes since have been minor.&lt;/p&gt;

&lt;p&gt;Here's the part I had to learn the hard way: &lt;strong&gt;re-declaration fixes loading, not obedience.&lt;/strong&gt; If a rule is in Lane A, re-declaring it into the right file is the fix. If a rule is already in Lane B — loaded into the right file and still ignored — re-declaring it does nothing. Which brings us to the second fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lane B fix — redesign, or move it to the mechanical floor
&lt;/h2&gt;

&lt;p&gt;Once you've confirmed a rule is genuinely loaded and still losing, the choice comes down to a single question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I afford for this rule to lose?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If the answer is yes — and the output-format rule from the previous section is exactly this kind — keep it in prose, but make sure it's shaped well: short, specific, prohibition-framed, impossible to misread. You can see the output either follows it or doesn't, so it's the right fit for the load-bearing file.&lt;/p&gt;

&lt;p&gt;If the answer is no, prose is the wrong home for it. The rule can't afford a single loss, so it moves to the mechanical floor: hooks, deny rules, permission configs. Mechanisms can't be ignored because they're not asking the model to comply; they're intercepting the action. (Reporails' line captures it: &lt;em&gt;prompts steer, hooks enforce.&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;Your own secrets rule is the perfect example — "don't push secrets to git repos." (GitHub's analysis of 2,500+ repos found it the single most common rule in &lt;code&gt;AGENTS.md&lt;/code&gt; files.) As prose, it's the weakest kind of rule:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Never push secrets to the repository. Check for API keys and credentials before every commit.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's not self-verifying by observation — a leaked secret looks like a normal commit. It's catastrophic when lost even once. And the docs' "no guarantee of strict compliance" means the model is never forced to check. It's a rule that begs to be ignored in a rushed session — which is exactly when secrets leak.&lt;/p&gt;

&lt;p&gt;So the mechanical version:&lt;/p&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;A pre-push secret scan (a git-secrets / gitleaks style hook) that &lt;strong&gt;blocks the push&lt;/strong&gt; if a secret pattern matches.&lt;/li&gt;
&lt;li&gt;A deny rule on the harness side (e.g., deny reading &lt;code&gt;.env&lt;/code&gt;, deny the push action until the scan passes).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.env&lt;/code&gt; in &lt;code&gt;.gitignore&lt;/code&gt; as defense-in-depth.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;The mechanism intercepts the action — the model isn't being asked to comply, so there's no "strict compliance" gap to exploit. The choice stops being abstract: one rule earns shaped prose, the other earns the floor.&lt;/p&gt;

&lt;p&gt;I'll be straight with you: I don't run a mechanical enforcement layer. My safety net is the memory loop — &lt;code&gt;AGENTS.md&lt;/code&gt; tells the agent to read &lt;code&gt;MEMORY.md&lt;/code&gt; at the start of every session and update it at the end (&lt;a href="https://dev.to/buildloops/i-built-a-session-log-that-survived-my-migration-heres-the-three-file-system-4bj6"&gt;the exact three-file system I built&lt;/a&gt;), and that log is how I'd notice a rule starting to get ignored (the entries would begin to diverge from what the rules require). The escalation above is for rules you can't afford to lose, not the setup I run.&lt;/p&gt;

&lt;p&gt;And the takeaway that ties the series together: &lt;strong&gt;rules are another thing you have to re-declare, not carry.&lt;/strong&gt; When your agent keeps making the same mistakes, the fix is the file that tells it how to work — and knowing what that file can and can't enforce is the difference between a rule that steers and a rule that decorates.&lt;/p&gt;

&lt;h2&gt;
  
  
  The blurry line — compaction and nested files
&lt;/h2&gt;

&lt;p&gt;One more thing, because it's the case that misleads everyone.&lt;/p&gt;

&lt;p&gt;Compaction — when the context window gets rebuilt mid-session — re-injects the root &lt;code&gt;CLAUDE.md&lt;/code&gt;. What it does not re-inject is nested or path-scoped rules, or rules that lived in files outside the root. The same goes for nested files in general: if a rule lives in a subdirectory that only loads in certain paths, and you switch harnesses, it can quietly drop out of the bundle.&lt;/p&gt;

&lt;p&gt;The result looks exactly like Lane B. "The agent just ignored my rule," you'll think, and start rewording a rule that never actually loaded — a Lane A costume on a Lane A failure. This is where the two-lane test matters most: diagnose before you reword. Quote-and-locate first. Only then decide whether the fix is re-declaration, redesign, or the mechanical floor.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing the loop
&lt;/h2&gt;

&lt;p&gt;The mystery at the top of this post — rules that worked, then quoted-and-ignored — resolved into something much simpler than I expected. Loaded ≠ obeyed. The file was loaded; the rules just weren't load-bearing. And once you see the failure as two lanes instead of one, the fix stops being a guessing game: re-declare if it never loaded; redesign or enforce if it loaded and lost.&lt;/p&gt;

&lt;p&gt;The migration made both lanes visible at once. That's the only reason I can hand you the diagnostic instead of a longer list of things that didn't work. If your agent quotes your rules and ignores them, run the test — quote, locate, watch the output — and you'll know which lane you're in before you change a single word.&lt;/p&gt;

&lt;p&gt;Rules are another thing you have to re-declare, not carry. If your agent keeps making the same mistakes, the fix is the file that tells it how to work — I wrote the playbook here: &lt;a href="https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o"&gt;Why Your Coding Agent Keeps Making the Same Mistakes — AGENTS.md Fixes It&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This closes Break 1 of the migration diary (&lt;a href="https://dev.to/buildloops/i-migrated-my-claude-code-workflow-to-opencode-heres-what-broke-5ajc"&gt;what broke when I switched from Claude Code to OpenCode&lt;/a&gt;). Next up: why skills silently degrade — the same failure class, different file.&lt;/p&gt;

&lt;p&gt;Which of the two lanes are you stuck in? Quote the rule that still isn't obeyed in the comments and I'll tell you which one it is.&lt;/p&gt;

</description>
      <category>opencode</category>
      <category>claude</category>
      <category>aiagents</category>
      <category>programming</category>
    </item>
    <item>
      <title>I Built a Session Log That Survived My Migration. Here's the Three-File System.</title>
      <dc:creator>Build Loops</dc:creator>
      <pubDate>Sat, 08 Aug 2026 07:59:04 +0000</pubDate>
      <link>https://dev.to/buildloops/i-built-a-session-log-that-survived-my-migration-heres-the-three-file-system-4bj6</link>
      <guid>https://dev.to/buildloops/i-built-a-session-log-that-survived-my-migration-heres-the-three-file-system-4bj6</guid>
      <description>&lt;p&gt;My Claude Code setup was small, which is exactly why its failure surprised me. One root &lt;code&gt;CLAUDE.md&lt;/code&gt;. A &lt;code&gt;MEMORY.md&lt;/code&gt; beside it. A folder of reference docs, and a second &lt;code&gt;CLAUDE.md&lt;/code&gt; doing the job of a rules file. It hummed along for months. Then, with no changes at all, it started leaking.&lt;/p&gt;

&lt;p&gt;Claude mixed up the files — rules surfaced as instructions, memory got treated as reference material — and I watched my token count climb on every session. I hadn't touched anything. That was the most frustrating part: it proved the setup had been fragile from day one; the cracks just took months to show.&lt;/p&gt;

&lt;p&gt;So I moved. Both feet. I brought every file to OpenCode and started talking to it. It remembered me. It ignored my instructions.&lt;/p&gt;

&lt;p&gt;This is what broke after that — ranked, with the rebuild for each one. The short version: the migration isn't a file copy, it's a re-declaration.&lt;/p&gt;




&lt;h2&gt;
  
  
  What broke, ranked in the order it hurt
&lt;/h2&gt;

&lt;p&gt;The list is ranked by how much each break cost me, not by how loud it was. The quiet ones hurt the most.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 1 — My instructions didn't come with me
&lt;/h3&gt;

&lt;p&gt;OpenCode had my memory loaded — it referenced my notes and conventions from &lt;code&gt;MEMORY.md&lt;/code&gt; correctly. But my rules from &lt;code&gt;CLAUDE.md&lt;/code&gt; weren't in effect. Whether that April version of OpenCode never loaded the file, or loaded it and ignored it, the outcome was identical: my instructions weren't being followed.&lt;/p&gt;

&lt;p&gt;The reason became obvious once I stopped to think: &lt;code&gt;CLAUDE.md&lt;/code&gt; is Claude's rule file. OpenCode reads &lt;code&gt;AGENTS.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On paper that's a one-line rename. In practice it was the first confirmation that this migration was a &lt;em&gt;translation&lt;/em&gt;, and the translation work landed on me — not the tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; re-declare your rules in &lt;code&gt;AGENTS.md&lt;/code&gt;. Don't copy — re-declare, because some of what your old rules assumed is now load-bearing. Then verify the rules are actually in effect. Run &lt;code&gt;/init&lt;/code&gt; (OpenCode reads &lt;code&gt;CLAUDE.md&lt;/code&gt; and seeds &lt;code&gt;AGENTS.md&lt;/code&gt; from it — &lt;a href="https://opencode.ai/docs/rules/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;), then ask the agent in a fresh session: "what are my rules?" If it can't quote them, they're not loaded. Loaded is not the same as obeyed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 2 — I asked OpenCode to migrate its own predecessor's config
&lt;/h3&gt;

&lt;p&gt;I treated the migration as "bring the files, tell the new agent what I had." Then I went one step further: I asked OpenCode to migrate my skills and MCP servers for me.&lt;/p&gt;

&lt;p&gt;The problem with asking a tool to migrate its own predecessor's tooling: it doesn't know what it doesn't know. It can't inventory what it never had. It has no idea which of my skills were load-bearing, which MCPs I used once and forgot, or where the config actually lived. It told me what it could — and couldn't tell me what was missing, because the missing stuff never existed in its world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; inventory first. Before you touch the new tool, list every skill, command, and MCP server you actually use. Write them down while the old tool is still alive to ask. Then decide consciously what gets rebuilt versus what gets dropped. The list is the migration plan — without it, you're migrating whatever happens to survive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 3 — What did migrate degraded silently
&lt;/h3&gt;

&lt;p&gt;The skills that did make it over didn't behave the same. OpenCode read them but ignored chunks of their frontmatter — model assignments, allowed tools, argument handling. And it didn't auto-fire them the way Claude Code did; skills load on demand here, when the agent decides to reach for them.&lt;/p&gt;

&lt;p&gt;Nothing errored loudly. They just worked less. That's the worst kind of break: the silent one, because it doesn't surface until you trust the skill and it quietly does the wrong thing.&lt;/p&gt;

&lt;p&gt;This one is even documented: OpenCode only recognizes &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;license&lt;/code&gt;, &lt;code&gt;compatibility&lt;/code&gt;, and &lt;code&gt;metadata&lt;/code&gt; in a skill's frontmatter (&lt;a href="https://opencode.ai/docs/skills/" rel="noopener noreferrer"&gt;skills docs&lt;/a&gt;). Everything else is silently ignored.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; assume every ported skill is degraded until proven otherwise. Rebuild the ones you actually use and delete the rest (more on this in the "rebuild, don't port" section).&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 4 — The friction tax
&lt;/h3&gt;

&lt;p&gt;Manually toggling between plan and build modes with &lt;code&gt;Tab&lt;/code&gt;, instead of Claude Code's automatic transition. Different keybinds. Different scroll behavior. None of it is a bug — but it's a constant low-grade "this feels wrong" that lasts for the first few weeks.&lt;/p&gt;

&lt;p&gt;This one never shows up in migration guides, because it never shows up in a feature table. It's a tax, not a defect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; budget the adjustment period like you'd budget a learning curve — plan on two to three weeks of reduced flow, not two days. On day one, map your three most-used Claude Code keybinds to their OpenCode equivalents. Force yourself through the change instead of reaching for the old muscle memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 5 — The one that didn't break for me, but will for you: no auto-memory
&lt;/h3&gt;

&lt;p&gt;OpenCode has no native cross-session memory. No silent "remembers what you said last week" like Claude Code has. There's an open feature request for it (&lt;a href="https://github.com/anomalyco/opencode/issues/20322" rel="noopener noreferrer"&gt;#20322&lt;/a&gt;), and it's not shipped.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;MEMORY.md&lt;/code&gt; survived the migration because it was a &lt;em&gt;file&lt;/em&gt;. Yours might not be. If you've been relying on the agent just remembering things across sessions, that memory evaporates the day you switch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; give the agent a session log. Add one instruction to &lt;code&gt;AGENTS.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Session log&lt;/span&gt;
At the end of every session, append a short summary to &lt;span class="sb"&gt;`session-log.md`&lt;/span&gt;:
what was done, what's pending, and any decisions made. Never lose a decision.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one instruction replaced the silent memory I lost — and made my memory &lt;em&gt;better&lt;/em&gt;, because now it's explicit, greppable, and portable to whatever tool I use next.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I gained (the counterweight)
&lt;/h2&gt;

&lt;p&gt;A list of four breaks with no counterweight is a hit piece. Here's the honest other half.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Permission-first by default.&lt;/strong&gt; OpenCode runs on my hardware — I bring my own keys. And out of the box it asks before acting: it wants to read a folder outside the current directory, it stops and asks. I approve, it proceeds. It rebuilt my trust in the tool faster than any benchmark table could. The honest limits: inside the working directory it's permissive by default, and &lt;code&gt;.env&lt;/code&gt; files are denied by default — which is the right default. And keep it updated: the 2026-22812 and 22813 CVEs were patched, and a stale harness is the one risk in an otherwise local-first setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One key, many models.&lt;/strong&gt; My setup is deliberately boring: the built-in model plus a single API key for OpenRouter. One key, dozens of models. Switching models for a task is a config line — not a harness, not a subscription, not a signup flow. After Claude Code, where the model was whatever Anthropic shipped, that felt like the ceiling coming off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost reality.&lt;/strong&gt; January 9, 2026 is a date a lot of us remember — the day Anthropic restricted third-party tools from using Claude subscription OAuth, with a full cutoff that April. It was the day my project stalled: I sat down to continue work I'd started two or three weeks earlier and couldn't do a thing. A workday gone, a project stuck, and a subscription that no longer worked the way I'd paid for it. On the other side, my token bill became something I could actually reason about instead of a flat subscription that either worked or didn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  The one lesson that mattered: rebuild, don't port
&lt;/h2&gt;

&lt;p&gt;The inversion that reframed everything: the skills I carried over degraded silently, but a freshly installed skill worked on the first go. No debugging, no frontmatter fighting, no "why won't this load." Drop it in, call it, done.&lt;/p&gt;

&lt;p&gt;That flipped how I thought about the whole migration. Don't port your skills — rebuild the ones you actually use.&lt;/p&gt;

&lt;p&gt;This applies beyond skills. It applies to rules, memory, and MCP config. And it explains why the ported stuff behaved differently in the first place: the harness matters more than people admit. Same model, different wrapper, measurably different results — in &lt;a href="https://blog.logrocket.com/benchmarked-claude-open-reality-agentic-cli-workflow" rel="noopener noreferrer"&gt;one 2026 benchmark&lt;/a&gt;, OpenCode finished in 7 minutes with zero mistakes; Claude Code took 14 minutes and made two, on the &lt;em&gt;same&lt;/em&gt; model. Separately, tracker-sourced SWE-bench numbers show a ~3.6-point swing between two harnesses running the same model. The agent is only as good as what's declared to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Carry the knowledge. Rebuild the tooling.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Would I do it again? Yes. Here's my day-one do-over
&lt;/h2&gt;

&lt;p&gt;Straight answer: yes. Not once did the breakage list add up to enough to pull me back. Running locally, the permission-first default, a skill workflow that rebuilt better than the original, and the cost — those four outweighed every item on the broke list. That surprised me more than the breaks themselves.&lt;/p&gt;

&lt;p&gt;But I'd change day one. In order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build the &lt;code&gt;AGENTS.md&lt;/code&gt; first&lt;/strong&gt; — the file that owns the state. Spend the morning on it, not the migration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add the session-log instruction&lt;/strong&gt; ("log what you did each session") so nothing is forgotten and no decision falls through the cracks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rebuild the three skills you actually use.&lt;/strong&gt; Delete the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-declare MCPs manually.&lt;/strong&gt; Audit versions before you trust them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide the model and permission posture consciously&lt;/strong&gt; — what you run, where you keep keys, where you let it read.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most of what broke in my migration wasn't the tooling. It was that my knowledge lived in places the new tool couldn't read. The fix isn't a better importer. It's one file that owns the state, written from day one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Migrate if / stay if
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Migrate if&lt;/strong&gt; you want multi-provider freedom or local models; you're burned by subscription-OAuth economics; you value a permission-first workflow; you're willing to re-declare your rules instead of copying them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay if&lt;/strong&gt; you're maximally invested in Claude's ecosystem — skills, hooks, auto-memory; you want speed and polish out of the box; you're happy on a flat subscription; you can't spend the adjustment weeks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Or run both.&lt;/strong&gt; The honest middle option: Claude Code for fast interactive work, OpenCode for provider experiments. Several reviewers recommend exactly this, and nothing about my migration contradicts it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Don't do these (the checklist)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Copying files instead of re-declaring rules. Migration is re-declaration, not a file copy.&lt;/li&gt;
&lt;li&gt;Trusting "drop-in / full parity" claims. Real parity needs wrappers, plugins, and manual re-declaration.&lt;/li&gt;
&lt;li&gt;Assuming rules are in effect because the file loaded. Loaded ≠ obeyed. Verify.&lt;/li&gt;
&lt;li&gt;Asking the new agent to migrate the old config. It can't inventory what it never had.&lt;/li&gt;
&lt;li&gt;Ignoring the cost shift: per-token models, prompt-cache misses, and the new subscription math.&lt;/li&gt;
&lt;li&gt;Skipping the security and version audit. The 2026-22812/22813 CVEs were patched; keep it updated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The verdict
&lt;/h2&gt;

&lt;p&gt;Four breaks, four wins, no regrets. Everything that broke traced back to the same root: the knowledge was there, it just lived in a place the new tool couldn't read. And the fix was the same for every single one of them — declare it, and log it.&lt;/p&gt;

&lt;p&gt;The migration wasn't about which harness is better. It was about making my workflow portable on purpose. That's the only way a migration sticks — whether you move now, later, or never.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does OpenCode read CLAUDE.md?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OpenCode reads &lt;code&gt;AGENTS.md&lt;/code&gt;. &lt;code&gt;CLAUDE.md&lt;/code&gt; is only used as a fallback when no &lt;code&gt;AGENTS.md&lt;/code&gt; exists — which is why copying your &lt;code&gt;CLAUDE.md&lt;/code&gt; over and expecting your rules to work is the #1 migration mistake. Re-declare them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do my Claude Code skills work in OpenCode?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Partially. OpenCode only recognizes &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;license&lt;/code&gt;, &lt;code&gt;compatibility&lt;/code&gt;, and &lt;code&gt;metadata&lt;/code&gt; in a skill's frontmatter — everything else is silently ignored, and skills load on demand rather than auto-firing. Rebuild the ones you actually use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does OpenCode have auto-memory like Claude Code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No native cross-session memory (feature request #20322 is open). Add a session-log instruction to &lt;code&gt;AGENTS.md&lt;/code&gt; so nothing is forgotten between sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is migrating worth it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want provider freedom, local-first operation, and a permission-first workflow — yes. If you're maximally invested in Claude's ecosystem (hooks, auto-memory, flat subscription) — stay, or run both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use the same model in both?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes — OpenCode supports 75+ providers including Anthropic and OpenRouter, so you can A/B test the harness effect with the same model.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you've been fighting the same battle — instructions that aren't followed, memory that disappears between sessions — I wrote the full playbook for fixing it here: &lt;a href="https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o"&gt;AGENTS.md Is Programming for Your AI Agent, Not Documentation for Humans&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What broke when you migrated? Name the one thing you lost that nobody warned you about — and if nothing broke, tell me that too, especially where I'm wrong. I'll collect the rebuilds people reply with in a follow-up.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the first post in my agent-workflow migration series.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I write about AI engineering stacks, autonomous developer tools, and structural agent design. If you're building in this space, follow &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/buildloops"&gt;@buildloops&lt;/a&gt;&lt;/strong&gt; for weekly breakdowns!&lt;/p&gt;

</description>
      <category>opencode</category>
      <category>aiagents</category>
      <category>llmmemory</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>I Migrated My Claude Code Workflow to OpenCode. Here's What Broke.</title>
      <dc:creator>Build Loops</dc:creator>
      <pubDate>Thu, 06 Aug 2026 12:24:49 +0000</pubDate>
      <link>https://dev.to/buildloops/i-migrated-my-claude-code-workflow-to-opencode-heres-what-broke-5ajc</link>
      <guid>https://dev.to/buildloops/i-migrated-my-claude-code-workflow-to-opencode-heres-what-broke-5ajc</guid>
      <description>&lt;p&gt;My Claude Code setup was small, which is exactly why its failure surprised me. One root &lt;code&gt;CLAUDE.md&lt;/code&gt;. A &lt;code&gt;MEMORY.md&lt;/code&gt; beside it. A folder of reference docs, and a second &lt;code&gt;CLAUDE.md&lt;/code&gt; doing the job of a rules file. It hummed along for months. Then, with no changes at all, it started leaking.&lt;/p&gt;

&lt;p&gt;Claude mixed up the files — rules surfaced as instructions, memory got treated as reference material — and I watched my token count climb on every session. I hadn't touched anything. That was the most frustrating part: it proved the setup had been fragile from day one; the cracks just took months to show.&lt;/p&gt;

&lt;p&gt;So I moved. Both feet. I brought every file to OpenCode and started talking to it. It remembered me. It ignored my instructions.&lt;/p&gt;

&lt;p&gt;This is what broke after that — ranked, with the rebuild for each one. The short version: the migration isn't a file copy, it's a re-declaration.&lt;/p&gt;




&lt;h2&gt;
  
  
  What broke, ranked in the order it hurt
&lt;/h2&gt;

&lt;p&gt;The list is ranked by how much each break cost me, not by how loud it was. The quiet ones hurt the most.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 1 — My instructions didn't come with me
&lt;/h3&gt;

&lt;p&gt;OpenCode had my memory loaded — it referenced my notes and conventions from &lt;code&gt;MEMORY.md&lt;/code&gt; correctly. But my rules from &lt;code&gt;CLAUDE.md&lt;/code&gt; weren't in effect. Whether that April version of OpenCode never loaded the file, or loaded it and ignored it, the outcome was identical: my instructions weren't being followed.&lt;/p&gt;

&lt;p&gt;The reason became obvious once I stopped to think: &lt;code&gt;CLAUDE.md&lt;/code&gt; is Claude's rule file. OpenCode reads &lt;code&gt;AGENTS.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;On paper that's a one-line rename. In practice it was the first confirmation that this migration was a &lt;em&gt;translation&lt;/em&gt;, and the translation work landed on me — not the tool.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; re-declare your rules in &lt;code&gt;AGENTS.md&lt;/code&gt;. Don't copy — re-declare, because some of what your old rules assumed is now load-bearing. Then verify the rules are actually in effect. Run &lt;code&gt;/init&lt;/code&gt; (OpenCode reads &lt;code&gt;CLAUDE.md&lt;/code&gt; and seeds &lt;code&gt;AGENTS.md&lt;/code&gt; from it — &lt;a href="https://opencode.ai/docs/rules/" rel="noopener noreferrer"&gt;docs&lt;/a&gt;), then ask the agent in a fresh session: "what are my rules?" If it can't quote them, they're not loaded. Loaded is not the same as obeyed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 2 — I asked OpenCode to migrate its own predecessor's config
&lt;/h3&gt;

&lt;p&gt;I treated the migration as "bring the files, tell the new agent what I had." Then I went one step further: I asked OpenCode to migrate my skills and MCP servers for me.&lt;/p&gt;

&lt;p&gt;The problem with asking a tool to migrate its own predecessor's tooling: it doesn't know what it doesn't know. It can't inventory what it never had. It has no idea which of my skills were load-bearing, which MCPs I used once and forgot, or where the config actually lived. It told me what it could — and couldn't tell me what was missing, because the missing stuff never existed in its world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; inventory first. Before you touch the new tool, list every skill, command, and MCP server you actually use. Write them down while the old tool is still alive to ask. Then decide consciously what gets rebuilt versus what gets dropped. The list is the migration plan — without it, you're migrating whatever happens to survive.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 3 — What did migrate degraded silently
&lt;/h3&gt;

&lt;p&gt;The skills that did make it over didn't behave the same. OpenCode read them but ignored chunks of their frontmatter — model assignments, allowed tools, argument handling. And it didn't auto-fire them the way Claude Code did; skills load on demand here, when the agent decides to reach for them.&lt;/p&gt;

&lt;p&gt;Nothing errored loudly. They just worked less. That's the worst kind of break: the silent one, because it doesn't surface until you trust the skill and it quietly does the wrong thing.&lt;/p&gt;

&lt;p&gt;This one is even documented: OpenCode only recognizes &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;license&lt;/code&gt;, &lt;code&gt;compatibility&lt;/code&gt;, and &lt;code&gt;metadata&lt;/code&gt; in a skill's frontmatter (&lt;a href="https://opencode.ai/docs/skills/" rel="noopener noreferrer"&gt;skills docs&lt;/a&gt;). Everything else is silently ignored.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; assume every ported skill is degraded until proven otherwise. Rebuild the ones you actually use and delete the rest (more on this in the "rebuild, don't port" section).&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 4 — The friction tax
&lt;/h3&gt;

&lt;p&gt;Manually toggling between plan and build modes with &lt;code&gt;Tab&lt;/code&gt;, instead of Claude Code's automatic transition. Different keybinds. Different scroll behavior. None of it is a bug — but it's a constant low-grade "this feels wrong" that lasts for the first few weeks.&lt;/p&gt;

&lt;p&gt;This one never shows up in migration guides, because it never shows up in a feature table. It's a tax, not a defect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; budget the adjustment period like you'd budget a learning curve — plan on two to three weeks of reduced flow, not two days. On day one, map your three most-used Claude Code keybinds to their OpenCode equivalents. Force yourself through the change instead of reaching for the old muscle memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Break 5 — The one that didn't break for me, but will for you: no auto-memory
&lt;/h3&gt;

&lt;p&gt;OpenCode has no native cross-session memory. No silent "remembers what you said last week" like Claude Code has. There's an open feature request for it (&lt;a href="https://github.com/anomalyco/opencode/issues/20322" rel="noopener noreferrer"&gt;#20322&lt;/a&gt;), and it's not shipped.&lt;/p&gt;

&lt;p&gt;My &lt;code&gt;MEMORY.md&lt;/code&gt; survived the migration because it was a &lt;em&gt;file&lt;/em&gt;. Yours might not be. If you've been relying on the agent just remembering things across sessions, that memory evaporates the day you switch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The rebuild:&lt;/strong&gt; give the agent a session log. Add one instruction to &lt;code&gt;AGENTS.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## Session log&lt;/span&gt;
At the end of every session, append a short summary to &lt;span class="sb"&gt;`session-log.md`&lt;/span&gt;:
what was done, what's pending, and any decisions made. Never lose a decision.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That one instruction replaced the silent memory I lost — and made my memory &lt;em&gt;better&lt;/em&gt;, because now it's explicit, greppable, and portable to whatever tool I use next.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I gained (the counterweight)
&lt;/h2&gt;

&lt;p&gt;A list of four breaks with no counterweight is a hit piece. Here's the honest other half.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Permission-first by default.&lt;/strong&gt; OpenCode runs on my hardware — I bring my own keys. And out of the box it asks before acting: it wants to read a folder outside the current directory, it stops and asks. I approve, it proceeds. It rebuilt my trust in the tool faster than any benchmark table could. The honest limits: inside the working directory it's permissive by default, and &lt;code&gt;.env&lt;/code&gt; files are denied by default — which is the right default. And keep it updated: the 2026-22812 and 22813 CVEs were patched, and a stale harness is the one risk in an otherwise local-first setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One key, many models.&lt;/strong&gt; My setup is deliberately boring: the built-in model plus a single API key for OpenRouter. One key, dozens of models. Switching models for a task is a config line — not a harness, not a subscription, not a signup flow. After Claude Code, where the model was whatever Anthropic shipped, that felt like the ceiling coming off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cost reality.&lt;/strong&gt; January 9, 2026 is a date a lot of us remember — the day Anthropic restricted third-party tools from using Claude subscription OAuth, with a full cutoff that April. It was the day my project stalled: I sat down to continue work I'd started two or three weeks earlier and couldn't do a thing. A workday gone, a project stuck, and a subscription that no longer worked the way I'd paid for it. On the other side, my token bill became something I could actually reason about instead of a flat subscription that either worked or didn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  The one lesson that mattered: rebuild, don't port
&lt;/h2&gt;

&lt;p&gt;The inversion that reframed everything: the skills I carried over degraded silently, but a freshly installed skill worked on the first go. No debugging, no frontmatter fighting, no "why won't this load." Drop it in, call it, done.&lt;/p&gt;

&lt;p&gt;That flipped how I thought about the whole migration. Don't port your skills — rebuild the ones you actually use.&lt;/p&gt;

&lt;p&gt;This applies beyond skills. It applies to rules, memory, and MCP config. And it explains why the ported stuff behaved differently in the first place: the harness matters more than people admit. Same model, different wrapper, measurably different results — in &lt;a href="https://blog.logrocket.com/benchmarked-claude-open-reality-agentic-cli-workflow" rel="noopener noreferrer"&gt;one 2026 benchmark&lt;/a&gt;, OpenCode finished in 7 minutes with zero mistakes; Claude Code took 14 minutes and made two, on the &lt;em&gt;same&lt;/em&gt; model. Separately, tracker-sourced SWE-bench numbers show a ~3.6-point swing between two harnesses running the same model. The agent is only as good as what's declared to it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Carry the knowledge. Rebuild the tooling.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Would I do it again? Yes. Here's my day-one do-over
&lt;/h2&gt;

&lt;p&gt;Straight answer: yes. Not once did the breakage list add up to enough to pull me back. Running locally, the permission-first default, a skill workflow that rebuilt better than the original, and the cost — those four outweighed every item on the broke list. That surprised me more than the breaks themselves.&lt;/p&gt;

&lt;p&gt;But I'd change day one. In order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Build the &lt;code&gt;AGENTS.md&lt;/code&gt; first&lt;/strong&gt; — the file that owns the state. Spend the morning on it, not the migration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add the session-log instruction&lt;/strong&gt; ("log what you did each session") so nothing is forgotten and no decision falls through the cracks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rebuild the three skills you actually use.&lt;/strong&gt; Delete the rest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Re-declare MCPs manually.&lt;/strong&gt; Audit versions before you trust them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decide the model and permission posture consciously&lt;/strong&gt; — what you run, where you keep keys, where you let it read.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most of what broke in my migration wasn't the tooling. It was that my knowledge lived in places the new tool couldn't read. The fix isn't a better importer. It's one file that owns the state, written from day one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Migrate if / stay if
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Migrate if&lt;/strong&gt; you want multi-provider freedom or local models; you're burned by subscription-OAuth economics; you value a permission-first workflow; you're willing to re-declare your rules instead of copying them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay if&lt;/strong&gt; you're maximally invested in Claude's ecosystem — skills, hooks, auto-memory; you want speed and polish out of the box; you're happy on a flat subscription; you can't spend the adjustment weeks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Or run both.&lt;/strong&gt; The honest middle option: Claude Code for fast interactive work, OpenCode for provider experiments. Several reviewers recommend exactly this, and nothing about my migration contradicts it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Don't do these (the checklist)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Copying files instead of re-declaring rules. Migration is re-declaration, not a file copy.&lt;/li&gt;
&lt;li&gt;Trusting "drop-in / full parity" claims. Real parity needs wrappers, plugins, and manual re-declaration.&lt;/li&gt;
&lt;li&gt;Assuming rules are in effect because the file loaded. Loaded ≠ obeyed. Verify.&lt;/li&gt;
&lt;li&gt;Asking the new agent to migrate the old config. It can't inventory what it never had.&lt;/li&gt;
&lt;li&gt;Ignoring the cost shift: per-token models, prompt-cache misses, and the new subscription math.&lt;/li&gt;
&lt;li&gt;Skipping the security and version audit. The 2026-22812/22813 CVEs were patched; keep it updated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The verdict
&lt;/h2&gt;

&lt;p&gt;Four breaks, four wins, no regrets. Everything that broke traced back to the same root: the knowledge was there, it just lived in a place the new tool couldn't read. And the fix was the same for every single one of them — declare it, and log it.&lt;/p&gt;

&lt;p&gt;The migration wasn't about which harness is better. It was about making my workflow portable on purpose. That's the only way a migration sticks — whether you move now, later, or never.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does OpenCode read CLAUDE.md?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OpenCode reads &lt;code&gt;AGENTS.md&lt;/code&gt;. &lt;code&gt;CLAUDE.md&lt;/code&gt; is only used as a fallback when no &lt;code&gt;AGENTS.md&lt;/code&gt; exists — which is why copying your &lt;code&gt;CLAUDE.md&lt;/code&gt; over and expecting your rules to work is the #1 migration mistake. Re-declare them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do my Claude Code skills work in OpenCode?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Partially. OpenCode only recognizes &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt;, &lt;code&gt;license&lt;/code&gt;, &lt;code&gt;compatibility&lt;/code&gt;, and &lt;code&gt;metadata&lt;/code&gt; in a skill's frontmatter — everything else is silently ignored, and skills load on demand rather than auto-firing. Rebuild the ones you actually use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does OpenCode have auto-memory like Claude Code?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No native cross-session memory (feature request #20322 is open). Add a session-log instruction to &lt;code&gt;AGENTS.md&lt;/code&gt; so nothing is forgotten between sessions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is migrating worth it?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want provider freedom, local-first operation, and a permission-first workflow — yes. If you're maximally invested in Claude's ecosystem (hooks, auto-memory, flat subscription) — stay, or run both.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Can I use the same model in both?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Yes — OpenCode supports 75+ providers including Anthropic and OpenRouter, so you can A/B test the harness effect with the same model.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If you've been fighting the same battle — instructions that aren't followed, memory that disappears between sessions — I wrote the full playbook for fixing it here: &lt;a href="https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o"&gt;AGENTS.md Is Programming for Your AI Agent, Not Documentation for Humans&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What broke when you migrated? Name the one thing you lost that nobody warned you about — and if nothing broke, tell me that too, especially where I'm wrong. I'll collect the rebuilds people reply with in a follow-up.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the first post in my agent-workflow migration series.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I write about AI engineering stacks, autonomous developer tools, and structural agent design. If you're building in this space, follow &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/buildloops"&gt;@buildloops&lt;/a&gt;&lt;/strong&gt; for weekly breakdowns!&lt;/p&gt;

</description>
      <category>opencode</category>
      <category>aiagents</category>
      <category>claudecode</category>
    </item>
    <item>
      <title>Why Your Coding Agent Keeps Making the Same Mistakes — AGENTS.md Fixes It</title>
      <dc:creator>Build Loops</dc:creator>
      <pubDate>Wed, 05 Aug 2026 13:15:07 +0000</pubDate>
      <link>https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o</link>
      <guid>https://dev.to/buildloops/agentsmd-is-programming-for-your-ai-agent-not-documentation-for-humans-1g4o</guid>
      <description>&lt;p&gt;If you use a coding agent for any real length of time, you hit the same wall: it makes the same mistakes you already corrected. Wrong package manager. Banned patterns. Edits to files that shouldn't be touched. Fix it, and tomorrow it happens again.&lt;/p&gt;

&lt;p&gt;The standard advice is "write better prompts" — but that treats a memory problem as a wording problem. The fix is a file called &lt;code&gt;AGENTS.md&lt;/code&gt;, which your agent re-reads at the start of every session. The catch: most people write it like documentation, and documentation doesn't change behavior. Here's the difference in one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# What most files say (does nothing)&lt;/span&gt;
Write clean, maintainable code.

&lt;span class="gh"&gt;# What changes behavior (works)&lt;/span&gt;
Never use npm — install and run everything with pnpm.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; is programming for an AI agent, not documentation for humans. The rest of this article gives you the full template, explains why each section exists, and shows the mistakes that silently make the file useless. Roughly 6 minutes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; a short, specific, maintained file beats a long, detailed one — if a line wouldn't change the agent's output, delete it. Want the file first and the theory second? Scroll to the &lt;strong&gt;The drop-in template&lt;/strong&gt; section below.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is AGENTS.md?
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; is the open-standard file that AI coding agents read at the start of every session — the project's permanent memory for the agent. It's plain Markdown at your repo root, committed to git, and re-read (not remembered) every session, so instructions in it don't decay the way chat context does. The drop-in template is below; the rest of this article explains why each section exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why your agent forgets everything
&lt;/h2&gt;

&lt;p&gt;Coding agents are stateless: every session starts from a blank context, plus guesses derived from other people's code. Your project uses &lt;code&gt;pnpm&lt;/code&gt;, your tests need a running database, &lt;code&gt;dist/&lt;/code&gt; is generated and must never be edited — the agent doesn't know any of that, so it guesses, and the correction evaporates when the session ends. That's not the model being bad; it's the agent having no memory.&lt;/p&gt;

&lt;p&gt;The mechanism that fixes it is one almost no guide explains: &lt;strong&gt;the agent re-reads the file at the start of every session.&lt;/strong&gt; Chat instructions get buried under newer tokens and drift out of attention — context drift, in every long conversation. Instructions in a file don't decay, because they're re-read, not remembered. Think of it as onboarding for an AI employee: a README tells humans what the project is; &lt;code&gt;AGENTS.md&lt;/code&gt; tells the agent how to work here — the exact commands, the conventions, the "don't touch" zones, and the traps that have already hurt someone.&lt;/p&gt;




&lt;h2&gt;
  
  
  AGENTS.md is code, not prose
&lt;/h2&gt;

&lt;p&gt;Here's the mental shift that changes everything. Documentation &lt;em&gt;describes&lt;/em&gt; a system. Code &lt;em&gt;causes&lt;/em&gt; behavior. When you write &lt;code&gt;AGENTS.md&lt;/code&gt; like a README — descriptive, warm, comprehensive — you're writing prose the agent reads and mostly ignores, because prose is ambiguous and the agent already has a default behavior baked in.&lt;/p&gt;

&lt;p&gt;When you write it like code, every line has a job. A line that doesn't change an edit, doesn't earn its place. The rules for writing it well are the same rules you'd apply to good code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Token cost is real.&lt;/strong&gt; Every word in this file is loaded into context at the start of every single session, for every single task. A 500-word backstory about your team's engineering philosophy displaces 500 words of actual task context. And context bloat isn't free — Chroma's 2025 study found that all 18 frontier models tested degrade in accuracy as input grows, some dropping from 95% to 60% past a threshold. A bloated file isn't neutral; it's actively making the agent worse. Keep it under ~200 lines. If removing a line wouldn't change the agent's output, delete it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specificity beats aspiration.&lt;/strong&gt; "Write clean, maintainable code" does nothing — the agent already tries to do that. Only include rules that are specific to your project and that the agent couldn't figure out from reading the code. "Use &lt;code&gt;pnpm&lt;/code&gt;, not npm" changes behavior. "Follow best practices" doesn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Every "never" needs an "instead."&lt;/strong&gt; Pure prohibitions create dead ends. "Never use &lt;code&gt;any&lt;/code&gt;" leaves the agent guessing what to do. "Never use &lt;code&gt;any&lt;/code&gt; — use &lt;code&gt;unknown&lt;/code&gt; and narrow it with type guards" gives it an escape route. The same rule in miniature: "Use &lt;code&gt;pnpm&lt;/code&gt;" is a fact the agent will forget; "Never use npm — install and run everything with &lt;code&gt;pnpm&lt;/code&gt;" changes a behavior and names the alternative in one line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structure aids parsing.&lt;/strong&gt; Headers, bullets, and exact commands are easier to prioritize than paragraphs. The same content, organized, is ten times more useful.&lt;/p&gt;

&lt;p&gt;One more thing worth being honest about: this is leverage, not magic. As Martin Fowler puts it, context engineering raises the &lt;em&gt;probability&lt;/em&gt; of useful results — it can never &lt;em&gt;guarantee&lt;/em&gt; them. No matter how good your file is, an LLM is still an LLM. When a rule absolutely must hold, don't write it in Markdown; enforce it deterministically with a hook. Treat the file as your agent's guidance, and hooks as its guardrails.&lt;/p&gt;




&lt;h2&gt;
  
  
  The drop-in template
&lt;/h2&gt;

&lt;p&gt;Don't read this line by line — copy it, delete what doesn't apply to your project, and keep going. The explanations below matter more than the file itself.&lt;/p&gt;

&lt;p&gt;Here's the skeleton. It deliberately mixes two kinds of content. The &lt;strong&gt;lean core&lt;/strong&gt; — sections 1, 5, 6, 7, 9 — is the part that changes edits: exact commands, conventions, guardrails. The &lt;strong&gt;workflow contract&lt;/strong&gt; — sections 2, 3, 4, and the "when in doubt" checklist in section 8 — tells the agent &lt;em&gt;how to operate&lt;/em&gt;: plan before code, an approval gate, a skills whitelist. That's not filler; it programs how the agent works with you. It reflects one popular workflow — supervised "vibe engineering," where the agent writes its own implementation prompts and you approve them. Run that workflow and it pays off; work more autonomously or manually and drop it — the lean core works everywhere. Either way, this is a template, not a finished file: anything that isn't true for your project gets deleted, not kept.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# AGENTS.md&lt;/span&gt;

You are a principal-level &lt;span class="nt"&gt;&amp;lt;role&amp;gt;&lt;/span&gt; engineer and AI implementation agent working on &lt;span class="nt"&gt;&amp;lt;PROJECT&amp;gt;&lt;/span&gt;, &lt;span class="nt"&gt;&amp;lt;one-line&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;.

Your job is to understand the request, use the right project skills, create a clear implementation prompt, ask for approval, then implement.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 1. Product&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;PROJECT&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;what&lt;/span&gt; &lt;span class="na"&gt;it&lt;/span&gt; &lt;span class="na"&gt;does&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;.

Build only:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;feature&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;feature&amp;gt;&lt;/span&gt;

Do not overbuild.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- Optional: workflow contract. Sections 2–4 (and the "when in doubt" checklist in section 8) only pay off when you run a supervised, agent-driven workflow (plan, approve, implement). Lean-core-only users can delete them. --&amp;gt;&lt;/span&gt;

&lt;span class="gh"&gt;# 2. Workflow&lt;/span&gt;

For every implementation request:
&lt;span class="p"&gt;
1.&lt;/span&gt; Read &lt;span class="sb"&gt;`AGENTS.md`&lt;/span&gt;.
&lt;span class="p"&gt;2.&lt;/span&gt; Read the skills explicitly mentioned by the user.
&lt;span class="p"&gt;3.&lt;/span&gt; Read clearly needed supporting skills from the approved skill list.
&lt;span class="p"&gt;4.&lt;/span&gt; Inspect relevant code.
&lt;span class="p"&gt;5.&lt;/span&gt; Ask a focused question only if the task has meaningful ambiguity.
&lt;span class="p"&gt;6.&lt;/span&gt; Create a detailed prompt file in &lt;span class="sb"&gt;`prompts/`&lt;/span&gt;.
&lt;span class="p"&gt;7.&lt;/span&gt; Ask: "I prepared the implementation prompt at &lt;span class="sb"&gt;`prompts/&amp;lt;file-name&amp;gt;.md`&lt;/span&gt;. Is this good to execute?"
&lt;span class="p"&gt;8.&lt;/span&gt; Implement only after user approval.
&lt;span class="p"&gt;9.&lt;/span&gt; Run available checks.
&lt;span class="p"&gt;10.&lt;/span&gt; Share exact steps to test or run the completed feature.

Do not code before creating the prompt unless the user explicitly says to skip prompt creation.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 3. Skills&lt;/span&gt;

Use only these skills:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="sb"&gt;`.agents/skills/&amp;lt;skill&amp;gt;`&lt;/span&gt;

Do not invent new skills.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 4. Prompt files&lt;/span&gt;

Prompt files live in the &lt;span class="sb"&gt;`prompts/`&lt;/span&gt; directory.

Each prompt must include:
&lt;span class="p"&gt;
-&lt;/span&gt; goal
&lt;span class="p"&gt;-&lt;/span&gt; skills read
&lt;span class="p"&gt;-&lt;/span&gt; existing code inspected
&lt;span class="p"&gt;-&lt;/span&gt; decisions or assumptions
&lt;span class="p"&gt;-&lt;/span&gt; files likely to change
&lt;span class="p"&gt;-&lt;/span&gt; implementation requirements
&lt;span class="p"&gt;-&lt;/span&gt; security requirements
&lt;span class="p"&gt;-&lt;/span&gt; acceptance criteria
&lt;span class="p"&gt;-&lt;/span&gt; checks to run
&lt;span class="p"&gt;-&lt;/span&gt; exact manual test steps expected after implementation

&lt;span class="c"&gt;&amp;lt;!-- End of the optional workflow contract. Everything from here is lean core — keep it even without the workflow sections. --&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 5. Architecture&lt;/span&gt;

Keep these layers separate:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;layer&amp;gt;&lt;/span&gt;: &lt;span class="nt"&gt;&amp;lt;responsibility&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;layer&amp;gt;&lt;/span&gt;: &lt;span class="nt"&gt;&amp;lt;responsibility&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Boundary&lt;/span&gt; &lt;span class="na"&gt;rule&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;e.g.&lt;/span&gt; &lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="na"&gt;UI&lt;/span&gt; &lt;span class="na"&gt;must&lt;/span&gt; &lt;span class="na"&gt;display&lt;/span&gt; &lt;span class="na"&gt;stored&lt;/span&gt; &lt;span class="na"&gt;data&lt;/span&gt; &lt;span class="na"&gt;only.&lt;/span&gt;&lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 6. Tech stack&lt;/span&gt;

Use:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;stack&amp;gt;&lt;/span&gt;

Do not use:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;stack&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 7. Source of truth&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;Name&lt;/span&gt; &lt;span class="na"&gt;the&lt;/span&gt; &lt;span class="na"&gt;authoritative&lt;/span&gt; &lt;span class="na"&gt;source&lt;/span&gt; &lt;span class="na"&gt;the&lt;/span&gt; &lt;span class="na"&gt;agent&lt;/span&gt; &lt;span class="na"&gt;should&lt;/span&gt; &lt;span class="na"&gt;rely&lt;/span&gt; &lt;span class="na"&gt;on&lt;/span&gt; &lt;span class="err"&gt;—&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt; &lt;span class="na"&gt;database&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt; &lt;span class="na"&gt;spec&lt;/span&gt; &lt;span class="na"&gt;document&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;a&lt;/span&gt; &lt;span class="na"&gt;config&lt;/span&gt; &lt;span class="na"&gt;file&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;an&lt;/span&gt; &lt;span class="na"&gt;API.&lt;/span&gt; &lt;span class="na"&gt;It&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="na"&gt;s&lt;/span&gt; &lt;span class="na"&gt;whatever&lt;/span&gt; &lt;span class="na"&gt;your&lt;/span&gt; &lt;span class="na"&gt;project&lt;/span&gt; &lt;span class="na"&gt;treats&lt;/span&gt; &lt;span class="na"&gt;as&lt;/span&gt; &lt;span class="na"&gt;ground&lt;/span&gt; &lt;span class="na"&gt;truth.&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;What&lt;/span&gt; &lt;span class="na"&gt;each&lt;/span&gt; &lt;span class="na"&gt;record&lt;/span&gt; &lt;span class="na"&gt;or&lt;/span&gt; &lt;span class="na"&gt;entity&lt;/span&gt; &lt;span class="na"&gt;stores&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;required&lt;/span&gt; &lt;span class="na"&gt;fields&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;what&lt;/span&gt; &lt;span class="na"&gt;must&lt;/span&gt; &lt;span class="na"&gt;never&lt;/span&gt; &lt;span class="na"&gt;be&lt;/span&gt; &lt;span class="na"&gt;hardcoded&lt;/span&gt; &lt;span class="na"&gt;or&lt;/span&gt; &lt;span class="na"&gt;assumed.&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 8. Security, code standards, and final rule&lt;/span&gt;

Never expose to browser code: &lt;span class="nt"&gt;&amp;lt;secrets&amp;gt;&lt;/span&gt;.
Never run from browser code: &lt;span class="nt"&gt;&amp;lt;side-effectful&lt;/span&gt; &lt;span class="na"&gt;work&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;.

&lt;span class="nt"&gt;&amp;lt;Language&lt;/span&gt; &lt;span class="err"&gt;/&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt; &lt;span class="na"&gt;rules:&lt;/span&gt; &lt;span class="na"&gt;explicit&lt;/span&gt; &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt; &lt;span class="na"&gt;no&lt;/span&gt; &lt;span class="err"&gt;`&lt;/span&gt;&lt;span class="na"&gt;any&lt;/span&gt;&lt;span class="err"&gt;`,&lt;/span&gt; &lt;span class="na"&gt;small&lt;/span&gt; &lt;span class="na"&gt;functions.&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

When in doubt:
&lt;span class="p"&gt;
1.&lt;/span&gt; Keep it small.
&lt;span class="p"&gt;2.&lt;/span&gt; Use the relevant skill.
&lt;span class="p"&gt;3.&lt;/span&gt; Preserve server/client boundaries.
&lt;span class="p"&gt;4.&lt;/span&gt; Ask a focused question if needed.
&lt;span class="p"&gt;5.&lt;/span&gt; Save a prompt before coding.
&lt;span class="p"&gt;6.&lt;/span&gt; Ask if it is good to execute.
&lt;span class="p"&gt;7.&lt;/span&gt; Implement after confirmation.
&lt;span class="p"&gt;8.&lt;/span&gt; Run available checks.
&lt;span class="p"&gt;9.&lt;/span&gt; Share exact test steps.
&lt;span class="p"&gt;
---
&lt;/span&gt;
&lt;span class="gh"&gt;# 9. Commands and checks&lt;/span&gt;

"Run available checks" (sections 2 and 8) means running these from the project root and reporting the results:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;command&amp;gt;`&lt;/span&gt; — &lt;span class="nt"&gt;&amp;lt;what&lt;/span&gt; &lt;span class="na"&gt;it&lt;/span&gt; &lt;span class="na"&gt;does&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;command&amp;gt;`&lt;/span&gt; — &lt;span class="nt"&gt;&amp;lt;what&lt;/span&gt; &lt;span class="na"&gt;it&lt;/span&gt; &lt;span class="na"&gt;does&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

Development and runtime:
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;command&amp;gt;`&lt;/span&gt; — start the dev server
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="sb"&gt;`&amp;lt;command&amp;gt;`&lt;/span&gt; — run tests

After implementation, run the checks and report the exact output. Never claim a check passed without running it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Your file should pass this test:&lt;/strong&gt; (1) every line would change the agent's output, (2) every prohibition names an "instead," (3) commands are copy-paste runnable, (4) no line contradicts another, (5) it stays under ~200 lines and gets a monthly review.&lt;/p&gt;

&lt;p&gt;Now the part people skip: &lt;strong&gt;why each section exists.&lt;/strong&gt; Start with the lean core — the four sections that change edits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Product / "Build only"&lt;/strong&gt; — the agent works best when it knows exactly who it's supposed to be and what it's allowed to build. "Do not overbuild" is the anti-hallucination guardrail: it stops the agent from expanding a small request into a rewrite of the codebase.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Architecture + tech stack&lt;/strong&gt; — the "Do not use" list matters as much as the "Use" list. It stops the agent from reaching for the dependency you deliberately avoided.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Source of truth&lt;/strong&gt; — one authoritative place for the facts the agent relies on, whatever it is: a database, a spec, a config file. It turns a vague feature request into concrete decisions instead of guesswork.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Commands and checks&lt;/strong&gt; — the highest-ROI section. Exact invocations, including the flag the agent would otherwise guess wrong. And "do not claim a check passed without running it" is the evidence rule: the agent must report real output, not assume success.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then the workflow contract — only when you run a supervised, agent-driven workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Workflow&lt;/strong&gt; — this is what turns the file from documentation into programming. The numbered steps and the approval gate are the most important piece: the agent plans, you approve, it executes. That isn't documentation; it's a control loop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skills + prompt files&lt;/strong&gt; — a whitelist ("Do not invent new skills") plus a mandatory plan-before-code step with a defined list of required sections. That's what makes the approval gate real: the agent can't show you a one-line plan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security + final rule&lt;/strong&gt; — the fallback checklist for situations your rules didn't cover. It tells the agent how to behave when it doesn't know what to do — which is exactly when improvisation goes wrong.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Airflow project shows how far this can go in the real world. Its &lt;code&gt;AGENTS.md&lt;/code&gt; instructs: "Never run pytest, python, or airflow commands directly on the host — always use &lt;code&gt;breeze&lt;/code&gt;." One line, and the agent stops polluting the developer's machine with a wrong-versioned Python environment. That's a guardrail that saves real pain, and it only works because it names the alternative, not just the prohibition.&lt;/p&gt;

&lt;p&gt;If you use Claude Code specifically, one practical note: Claude Code reads &lt;code&gt;CLAUDE.md&lt;/code&gt; natively, not &lt;code&gt;AGENTS.md&lt;/code&gt;. Bridge them with a one-line import:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# CLAUDE.md&lt;/span&gt;
@AGENTS.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;@AGENTS.md&lt;/code&gt; import expands at session start, so you keep a single source of truth and add Claude-specific rules below it.&lt;/p&gt;




&lt;h2&gt;
  
  
  What changed for me
&lt;/h2&gt;

&lt;p&gt;Before I started using &lt;code&gt;AGENTS.md&lt;/code&gt;, every project began the same way: initialize the repo, then type out a long prompt covering everything I wanted built, the conventions, the things not to touch. It worked — for that one session. The next day I'd open a new session and all of it was gone. I'd repeat myself, re-correct a mistake it had already made, and watch it make a similar one anyway. It got frustrating fast.&lt;/p&gt;

&lt;p&gt;The turning point was writing a well-structured &lt;code&gt;AGENTS.md&lt;/code&gt; before anything else. The agent stopped repeating those mistakes — not because I prompted better, but because it could re-read my instructions every session instead of trying to remember them. Work was easier, and there was a side effect I hadn't expected: I was burning fewer tokens. Re-explaining everything session after session is the biggest token waste there is, and when you're paying for a plan, that waste costs real money. A good &lt;code&gt;AGENTS.md&lt;/code&gt; is cheap insurance against it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Real-world proof that this scales
&lt;/h2&gt;

&lt;p&gt;A single file might feel like a small thing. The adoption numbers say otherwise.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; is now an open standard, released by OpenAI in August 2025 and donated — jointly with Anthropic — to the Linux Foundation's Agentic AI Foundation in December 2025. It's used in more than 60,000 open-source repositories and read natively by every major agent: Codex, Cursor, Copilot, Claude Code (via import), Google's Jules, Gemini CLI, Windsurf, and more. One file, all tools. That's the point of a standard.&lt;/p&gt;

&lt;p&gt;The most extreme use of it is inside OpenAI's own repository, which ships &lt;strong&gt;88 nested &lt;code&gt;AGENTS.md&lt;/code&gt; files&lt;/strong&gt; — a root file for global conventions, and subdirectory files for each subproject. Agents automatically read the nearest file in the directory tree, so the closest one takes precedence. That's how you scale from "one file for my side project" to "one hierarchy for a monorepo."&lt;/p&gt;

&lt;p&gt;At the enterprise end, context configuration is part of the layer that makes the headline agent stories possible. Rakuten runs an autonomous code-repair system across 12.5 million lines of code; TELUS credits full-pipeline AI integration with half a million saved engineering hours. Systems like that have to be reliable — and reliable agents need to understand the codebase they're operating on, which is exactly what a well-written context file is for.&lt;/p&gt;

&lt;p&gt;The message for a solo developer is simpler: if a 60,000-repo open standard and Fortune-500 engineering orgs both treat this file as infrastructure, it's worth the thirty minutes it takes to write yours properly.&lt;/p&gt;




&lt;h2&gt;
  
  
  The mistakes that make your file useless
&lt;/h2&gt;

&lt;p&gt;Most &lt;code&gt;AGENTS.md&lt;/code&gt; files fail for one of five reasons. Here's what they look like and how to fix them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. The novel.&lt;/strong&gt; A 500-word essay about your codebase's history. It burns context on every session and buries the rules that matter. Fix: cut ruthlessly. If a sentence wouldn't change the agent's output, it's dead weight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. The wish list.&lt;/strong&gt; "Write clean, well-documented code. Follow best practices." The agent already does this by default, so the file is pure noise. Fix: delete anything the agent would get right without being told.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Negative-only rules.&lt;/strong&gt; "Never use &lt;code&gt;any&lt;/code&gt;." "Don't commit to main." Without an alternative, the agent improvises — usually badly. Fix: every prohibition gets an "instead."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Contradictions.&lt;/strong&gt; "Always write comprehensive tests" and "keep sessions fast, minimize token usage" are in tension. The agent oscillates between them. Fix: set explicit priorities and document the trade-offs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Set and forget.&lt;/strong&gt; This one is the silent killer. A recent study of 356 repositories found stale code references in 23% of AI configuration files — files pointing at renamed paths, deleted modules, and old commands. Stale instructions don't just waste tokens; they actively mislead. Fix: treat the file like code. Review it monthly, put a &lt;code&gt;# last reviewed: YYYY-MM-DD&lt;/code&gt; comment at the top, and delete anything that no longer reflects reality.&lt;/p&gt;




&lt;h2&gt;
  
  
  How to write an AGENTS.md (in 30 minutes)
&lt;/h2&gt;

&lt;p&gt;You can get the full benefit in about half an hour:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Write the file.&lt;/strong&gt; Start with the template above and adapt it to your project: commands, conventions, guardrails. Cut anything that wouldn't change the agent's output.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verify your commands.&lt;/strong&gt; Run each one yourself. An &lt;code&gt;AGENTS.md&lt;/code&gt; full of commands that don't work is worse than no file at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run a real session.&lt;/strong&gt; Give the agent a task that touches your conventions — a refactor, a new endpoint — and watch whether it follows the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test a guardrail on purpose.&lt;/strong&gt; Ask the agent to do something your file forbids (e.g., "add &lt;code&gt;console.log&lt;/code&gt; here"). If it complies, the rule is too vague — rewrite it as a hard constraint or move it to a hook.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then keep the freshness loop going: commit the file to git, review it monthly, and add a rule any time the agent repeats a mistake. One correction that turns into a rule is a correction you never make again.&lt;/p&gt;




&lt;h2&gt;
  
  
  The one-line takeaway
&lt;/h2&gt;

&lt;p&gt;Your coding agent isn't limited by the model — it's limited by what it knows about your project. A short, specific, maintained &lt;code&gt;AGENTS.md&lt;/code&gt; is the highest-leverage change you can make to your AI workflow. Not because the file is magic, but because it's the agent's only permanent memory.&lt;/p&gt;

&lt;p&gt;Write it like documentation, and you've added a paragraph to a manual. Write it like code, and you've given a teammate a brain.&lt;/p&gt;




&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Does AGENTS.md replace CLAUDE.md?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;No. &lt;code&gt;AGENTS.md&lt;/code&gt; is the tool-agnostic standard read by most agents. Claude Code reads &lt;code&gt;CLAUDE.md&lt;/code&gt; natively — bridge them with a one-line &lt;code&gt;@AGENTS.md&lt;/code&gt; import in &lt;code&gt;CLAUDE.md&lt;/code&gt; so you keep a single source of truth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How long should AGENTS.md be?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Under ~200 lines. Every word is loaded into context on every session, and context bloat degrades model accuracy. If removing a line wouldn't change the agent's output, delete it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does my coding agent keep repeating mistakes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because it's stateless — it forgets everything between sessions and starts from training-data guesses about your project. &lt;code&gt;AGENTS.md&lt;/code&gt; is re-read at the start of every session, so it acts as the agent's permanent memory.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where should AGENTS.md live?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At the repository root. For monorepos, add one per subdirectory — agents read the nearest file, so the closest one takes precedence (OpenAI's repo ships 88 of them).&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;CTA:&lt;/strong&gt; Copy the template into your repo and run one session. But before you do, think about your answer to this: what mistake does your coding agent repeat every session? That's the first line of your file. Start with just that one rule — the "instead" included — and test it. One correction that becomes a rule is a correction you never make again.&lt;/p&gt;




&lt;p&gt;I write about AI engineering stacks, autonomous developer tools, and structural agent design. If you're building in this space, follow &lt;strong&gt;&lt;a class="mentioned-user" href="https://dev.to/buildloops"&gt;@buildloops&lt;/a&gt;&lt;/strong&gt; for weekly breakdowns!&lt;/p&gt;

</description>
      <category>agents</category>
      <category>aicodingagents</category>
      <category>claudecode</category>
      <category>aiagents</category>
    </item>
  </channel>
</rss>
