<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>agents-md on S Anand</title>
    <link>https://www.s-anand.net/blog/tag/agents-md/</link>
    <description>Recent content in agents-md on S Anand</description>
    <generator>Hugo -- 0.156.0</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 25 May 2026 16:30:02 +0800</lastBuildDate>
    <atom:link href="https://www.s-anand.net/blog/tag/agents-md/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Correcting instruction debt</title>
      <link>https://www.s-anand.net/blog/correcting-instruction-debt/</link>
      <pubDate>Mon, 25 May 2026 16:30:02 +0800</pubDate>
      <guid>https://www.s-anand.net/blog/correcting-instruction-debt/</guid>
      <description>&lt;p&gt;Here&amp;rsquo;s another AI-generated post, with &lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;&lt;/em&gt; editor notes. But I&amp;rsquo;ve also added my own version of the post below.&lt;/p&gt;
&lt;!--
RESEARCH: https://chatgpt.com/c/6a13dc2a-4d28-83ec-ae9b-016cd00b13a9
BLOG: https://claude.ai/chat/17173628-db14-42a4-b9c4-1aff78d5edf3
--&gt;
&lt;section ai-disclosure=&#34;ai-generated&#34; data-ai-model=&#34;claude-sonnet-4.6&#34; data-ai-provider=&#34;Anthropic&#34;&gt;
&lt;p&gt;I told my &amp;ldquo;&lt;a href=&#34;https://github.com/sanand0/scripts/blob/48a095e0a956841a8e395345d31f79b1ae99d4a6/freeslots.py&#34;&gt;find a free calendar slot&lt;/a&gt;&amp;rdquo; script to &amp;ldquo;&lt;a href=&#34;https://github.com/sanand0/scripts/commit/a8f5fb9eb5640b828618a33f2c89252e67664487#r186420170&#34;&gt;Avoid weekends and holidays&lt;/a&gt;&amp;rdquo;. Wednesday vanished. Turns out it&amp;rsquo;s a Singapore holiday (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: It&amp;rsquo;s &lt;a href=&#34;https://en.wikipedia.org/wiki/Eid_al-Adha&#34;&gt;Eid al-Adha&lt;/a&gt;&lt;/em&gt;), — irrelevant for the people I was meeting in other zones. &lt;strong&gt;I&amp;rsquo;d debugged my own helpful rule.&lt;/strong&gt; (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: What? What does &amp;ldquo;debugged my own helpful rule&amp;rdquo; even mean?&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;Annoying. But revealing. I went to ChatGPT — not to fix the script, but to think: (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: True. I had no clue what to do.&lt;/em&gt;)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Could you maybe interview me to figure out what direction I might want to take this train of thought in&amp;hellip;? Just ask me two or three questions.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;(The whole point was to &lt;em&gt;not&lt;/em&gt; take on more work myself.)&lt;/p&gt;
&lt;p&gt;Two questions in, it named it: &lt;strong&gt;instruction debt.&lt;/strong&gt; (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: which is such a cool term that I&amp;rsquo;ll keep it.&lt;/em&gt;)&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Not &amp;ldquo;bad instructions,&amp;rdquo; because the original instruction was reasonable. The debt is created when a rule that once reduced cognitive load later creates invisible work, missed options, brittle behavior, or debugging cost.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That hit. The script obeyed too literally. I got no warning. Worst of all, I&amp;rsquo;d scored a self-goal — given my future self an instruction that would bother me, while believing I was being helpful.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;I asked it to research further — and to mine my own agent logs as evidence. (&lt;a href=&#34;https://www.s-anand.net/blog/how-i-use-local-mcp/&#34;&gt;Local MCP&lt;/a&gt; runs bash; ChatGPT can read &lt;code&gt;~/.codex&lt;/code&gt;, &lt;code&gt;~/.claude&lt;/code&gt;, &lt;code&gt;~/.copilot&lt;/code&gt; and run &lt;code&gt;~/code/scripts/agentlog.py&lt;/code&gt; directly.) It came back with a taxonomy. I asked it to stress-test against more correction turns and &lt;strong&gt;discard what didn&amp;rsquo;t survive&lt;/strong&gt;. (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Basically, I said, analyze my logs.&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;It did. The robust categories, each grounded in an actual correction I&amp;rsquo;d made:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Objective framing&lt;/strong&gt; — &amp;ldquo;don&amp;rsquo;t base teachability on scores… base it on the pattern of errors.&amp;rdquo; Wrong proxy. (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Oh, yeah, I was trying to find patterns of errors in student submissions.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Evidence/modeling&lt;/strong&gt; — Ticketmaster classifier overfit on &lt;code&gt;venue_name&lt;/code&gt;. Predictive, not causal. (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: True. Stupid model said, &amp;ldquo;tickets in this stadium sell more&amp;rdquo; as if it were actionable.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Constraint semantics&lt;/strong&gt; — the Singapore holiday. Hard filter where a warning would do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State/action&lt;/strong&gt; — Darwinbox: &amp;ldquo;Click Clockin&amp;rdquo; clocked me &lt;em&gt;out&lt;/em&gt;. No pre/post-state check. (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: The button said &amp;ldquo;Clock in OR out&amp;rdquo;. I was clocked in. It clicked, thinking that&amp;rsquo;ll clock me in, without seeing that the button was already pressed.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Representation/path&lt;/strong&gt; — blog migration: &amp;ldquo;ALL LINKS relative&amp;rdquo; broke nested URLs. (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Yeah, relative links in my blog have been problematic for 20 years.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validation&lt;/strong&gt; — OCBC PDF: row balances passed, totals failed by SGD 6.9M. (_&lt;strong&gt;Anand&lt;/strong&gt;: I&amp;rsquo;m nowhere near this rich. Codex just messed up &lt;em&gt;badly&lt;/em&gt;.)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ChatGPT&amp;rsquo;s own self-critique was the best part:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;Lack of carefulness&amp;rdquo; should not be a category. It is not actionable. (_&lt;strong&gt;Anand&lt;/strong&gt;: No idea what this means!)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;p&gt;Then the pivot. It proposed a &lt;strong&gt;60-line &amp;ldquo;Operating Contract&amp;rdquo;&lt;/strong&gt; for my &lt;code&gt;AGENTS.md&lt;/code&gt;. I pushed back:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The operating contract is WAY too long. I was thinking 1 line, not 60&amp;hellip; fast and frugal heuristics that cover the majority of the scenarios, rather than hard-coding everything, is what we&amp;rsquo;re suggesting coding agents do in the first place.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It came back with three lines. &lt;a href=&#34;https://github.com/sanand0/scripts/commit/7be44855ac6063a364163181585b8eb5721fc469#r186421964&#34;&gt;I pasted them in verbatim&lt;/a&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;For non-trivial tasks, define the user-visible invariant: &amp;#34;done means ___&amp;#34;; verify that invariant before claiming success.
Treat constraints as soft preferences unless safety, privacy, data loss, credentials, or the current request makes them hard; surface any constraint that filters, skips, blocks, or deletes.
Prefer simple, rerunnable changes: inspect real inputs/state first, use existing tools/libs, log counts/examples, and call out uncertainty.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Line 1 catches OCBC and clock-in. Line 2 catches the Singapore holiday. Line 3 catches the toil.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Don&amp;rsquo;t add the rule to your head. Add it to the file the agent already reads.&lt;/strong&gt; (&lt;em&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Oh, so totally true!&lt;/em&gt;)&lt;/p&gt;
&lt;/section&gt;
&lt;hr&gt;
&lt;p&gt;Actually, the first half of the above AI-generated post didn&amp;rsquo;t really resonate with me. So let me explain in my own words what I did.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I found that, for some reason, this Wednesday never appears when I ask for &lt;a href=&#34;https://github.com/sanand0/scripts/blob/48a095e0a956841a8e395345d31f79b1ae99d4a6/freeslots.py&#34;&gt;find a free calendar slot&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I asked Codex, &amp;ldquo;Why on earth is this happening?&amp;rdquo; It said, &lt;a href=&#34;https://github.com/sanand0/scripts/commit/a8f5fb9eb5640b828618a33f2c89252e67664487#r186420170&#34;&gt;because you told me to exclude holidays&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;That got me thinking, where am I giving instructions that shoot me in the foot? And ChatGPT did a long, detailed analysis of my coding agent logs and came up with a bunch of examples and categorization.&lt;/li&gt;
&lt;li&gt;I didn&amp;rsquo;t bother reading it. I told it in &lt;a href=&#34;https://www.google.com/search?q=henry+kissinger+is+that+the+best+you+can+do&#34;&gt;Henry Kissinger style&lt;/a&gt;: can you do better?&lt;/li&gt;
&lt;li&gt;I didn&amp;rsquo;t bother reading it again. I told it, &amp;ldquo;Just tell me what to put into AGENTS.md&amp;rdquo;. I don&amp;rsquo;t want to do the work every time. &lt;strong&gt;YOU&lt;/strong&gt; do the work. Automate it!&lt;/li&gt;
&lt;li&gt;It gave me 60 lines. I said, &amp;ldquo;What rubbish! I can&amp;rsquo;t review 60. Just 3, max.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/sanand0/scripts/commit/7be44855ac6063a364163181585b8eb5721fc469#r186421964&#34;&gt;I copied that into AGENTS.md&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;For non-trivial tasks, define the user-visible invariant: &amp;ldquo;done means ___&amp;rdquo;; verify that invariant before claiming success.&lt;/li&gt;
&lt;li&gt;Treat constraints as soft preferences unless safety, privacy, data loss, credentials, or the current request makes them hard; surface any constraint that filters, skips, blocks, or deletes.&lt;/li&gt;
&lt;li&gt;Prefer simple, rerunnable changes: inspect real inputs/state first, use existing tools/libs, log counts/examples, and call out uncertainty.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;The first makes &lt;em&gt;total&lt;/em&gt; sense. Define &amp;ldquo;done&amp;rdquo;.&lt;br&gt;
The second makes &lt;em&gt;some&lt;/em&gt; sense - that&amp;rsquo;s exactly what I did wrong with the calendar.&lt;br&gt;
The third is supposed to &amp;ldquo;handle my recurring style&amp;rdquo; - and &lt;em&gt;kind of&lt;/em&gt; makes sense, so I&amp;rsquo;ll let it be.&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;https://files.s-anand.net/images/2026-05-25-correcting-instruction-debt.avif&#34;&gt;&lt;/p&gt;
</description>
    </item>
    <item>
      <title></title>
      <link>https://www.s-anand.net/blog/codex-follows-instructions-too-faithfully/</link>
      <pubDate>Tue, 16 Sep 2025 00:00:00 +0000</pubDate>
      <guid>https://www.s-anand.net/blog/codex-follows-instructions-too-faithfully/</guid>
      <description>&lt;p&gt;GPT-5 (Codex) follows instructions exactly as given. Usually a good thing, but sometimes, it this is what happens.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AGENTS.md&lt;/strong&gt;: ALWAYS WRITE TESTS before coding.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Codex&lt;/strong&gt;: Let me begin with the tests. (Spends 5 minutes writing tests.)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Stop! This is a proof of concept. We don&amp;rsquo;t need tests!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;AGENTS.md&lt;/strong&gt;: Write tests before coding. Drop tests for proof-of-concepts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Codex&lt;/strong&gt;: (Proceeds to delete all existing tests.)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anand&lt;/strong&gt;: STOP! We need those tests!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;AGENTS.md&lt;/strong&gt;: For new code, or if tests exist, start by writing tests.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anand&lt;/strong&gt;: Do this task. &amp;hellip; BUT SKIP TESTS! This is a POC!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Codex&lt;/strong&gt;: The user has explicitly asked to skip tests. But the guidelines require tests for new code. For now, I think I will skip tests.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anand&lt;/strong&gt;: (sigh!)&lt;/p&gt;
&lt;p&gt;Reminds me of Chaplin&amp;rsquo;s Feeding Machine.&lt;/p&gt;
&lt;div class=&#34;video-embed&#34;&gt;&lt;iframe src=&#34;https://www.youtube.com/embed/mVUVPen3xNQ&#34; title=&#34;YouTube video&#34; loading=&#34;lazy&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&#34;https://www.linkedin.com/posts/sanand0_charlie-chaplin-demonstrates-the-feeding-activity-7370987866577022976-d1MA&#34;&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;
</description>
    </item>
  </channel>
</rss>
