Rule Rot: How Long-Running AI Agents Calcify Your Own Instructions
A little over a month ago, I wrote about orchestrating a one-person software factory—how I got Claude Code and Codex threads to delegate, review each other's work, and run parallel tracks across Backdrop, Sensei, marketing, and customer support.
That setup works remarkably well. Most of the system runs on written rules: AGENTS.md files at the front door of each repo, policy documents, reusable skills, custom linters, and auto-memory files that carry lessons forward between sessions.
At the end of that post, one of my orchestrators casually mentioned a quirk:
I've carried old instructions forward as if they were permanent: a one-off "stop by midnight tonight" ended up in my briefs for days.
I laughed it off as an amusing edge case. A few weeks later, I realized it wasn't an edge case at all. It was a systemic failure mode of running long-lived AI agents.
I've started calling it rule rot.
What Rule Rot Looks Like
For the past couple of years, everyone building with AI agents talked about context rot—the gradual degradation you get as a single conversation fills up with stale tool output and dead ends. Between stronger long-context models, automatic compaction, and spinning up fresh threads for each task, context rot is largely solved.
Rule rot is what happens across sessions once you start persisting lessons so fresh threads actually build upon previous ones—learning from old mistakes and carrying your taste, direction, and policy forward. A brand-new thread with a spotless context window doesn't save you from rule rot, because turn one immediately loads your instruction files and memory index.
When you work with agents every day, you naturally correct them when they mess up. You tell an agent not to make a specific mistake in an email. You mention offhandedly that a particular partnership doesn't feel right. You vent in frustration when a build script breaks or an agent invents a limitation that doesn't exist.
Here is the problem: agents repeatedly take a one-off remark, a single-case preference, or a frustrated correction and turn it into a permanent ban.
Claude is a particularly bad offender here. Correcting it—or showing even a hint of frustration—seems to trigger a reflex to register the widest possible standing rule to make sure it never gets scolded for that again. Worse, if you later catch the overcorrection and say "we shouldn't do that," it rarely deletes the bad rule. Instead, it writes a brand-new rule on top of it that contradicts or inverts the first one. (At one point I even had a memory file literally named remove-dont-invert.md trying to stop this.)
Then that rule gets copied into a skill file. Another agent summarizes it into AGENTS.md. A third turns it into a regex in a checker script. A fourth saves it into Claude's auto-memory. Two months later, your agents aren't getting smarter—they're getting boxed in by the calcified ghosts of old bugs.

This week, I had a three-model council (Gemini, Claude Opus, and Codex) run a blind audit across both my marketing repo and my main Backdrop codebase—checking every AGENTS.md, policy doc, skill, executable checker, and auto-memory file against git history and what I had actually said.
What they turned up was wild.
Real Examples From Backdrop and Marketing
1. The agent that gave itself a permanent bedtime
A one-night instruction—"No more work after midnight"—got copied forward into session briefs for days, until I had to explicitly tell it: "I didn't mean it to be like a standing rule forever."
2. We unbanned the video encoder—but only in one paragraph
After a concurrent hardware-encoding kernel panic on my Mac Studio, an agent wrote a blanket ban: "No hardware video encoding on the Studio: not in tests, fixtures, probes or review agents" (never *_videotoolbox).
Weeks later, we fixed the real issue (don't run concurrent encodes or encode over Screen Sharing) and lifted the ban. The update rewrote the Studio paragraph in our scene-authoring skill to permit serialized hardware encoding—and left "never *_videotoolbox" completely untouched 90 lines earlier in the exact same skill (plus in TESTING.md and a memory file still literally named no-hardware-video-encodes-on-studio.md).
3. One flaky test made agents run every suite 5×
A single timing-sensitive test failed once because our gallery shelves fetch four requests concurrently while the test asserted sequential request order.
The resulting standing rule in memory: "Before telling the orchestrator or a PR that tests pass, run the affected suites at least 5 times." One narrow concurrency bug quietly multiplied test time across unrelated suites.
4. Deterministic checkers that rejected my own approved copy
Rules don't just rot in prose; they rot when agents harden them into deterministic mechanisms.
In our marketing repo, we have a small pipeline for short-form promo videos—and true to form, a coding agent had built a regex "copy linter" on top of it to catch policy mistakes before publishing. (Having a compiler-style linter sitting on top of marketing copy is already a bit ridiculous—classic coding-agent brain trying to solve creative taste with regexes.)
Rule rot made it even funnier. Earlier, an agent had left real Backdrop 3.0 features out of a launch description because it wrongly assumed they weren't shipping yet, so I told it to stop inventing limits or claiming shipped features didn't exist. That correction hardened into a regex demanding that any 15-second video script mentioning one interactive feature had to list all four (touch, click, music, tilt) in the same clip. When we ran the linter against a sentence I had personally approved a week earlier—which used "shake your MacBook" instead of "tilt"—our own linter rejected it. Another regex, generalized from rejecting one outdated count of third-party community scenes, blocked a completely normal video title: "4 Wallpapers in 12 Seconds". A third—meant to stop agents from promising that a specific demo wallpaper would ship in the app—banned the word "guaranteed" anywhere, rejecting even "Guaranteed to make your desk look clean."
In the end, we deleted the copy linter completely. Deterministic checks belong on hard binary invariants—security gates, secrets, broken links—not fluid copy and creative taste.
5. Rule-on-top-of-rule whiplashing
When releasing Backdrop 3 and reaching out to press, an earlier rule said license keys should only be sent to contacts who didn't already hold one. That caused an agent to omit keys from brand-new launch emails sent months later to press contacts who had tried an older version—expecting busy journalists to dig through months-old emails for a key.
I pushed back on that specific mistake. The overcorrection? An agent rewrote the policy to say every outreach email must include a license key—stretching a narrow fix into routine scheduling and negotiation replies.
The fix wasn't a cleverer third rule. It was deleting both micro-rules and writing one plain sentence of common sense.
6. Contradictory skills and a dangerous stale runbook
Three skill files in the marketing repo disagreed with each other on core email-sending and outreach procedures. Worse, one skill—and even the database's own runtime error message—still instructed agents to "delete the SQLite database and rebuild on schema mismatch" (!), a leftover from early prototyping even though the database had evolved to hold months of human-reviewed video evaluations, QA checks, and planned shoot briefs.
The Three Hidden Accelerators
Fixing individual rules is easy. What surprised me was discovering why the rot kept regenerating on its own. There were three structural causes.
1. The authority loophole
At the very top of our marketing policy doc, an agent had written a meta-rule explaining how firm each entry was. Even entries explicitly labeled "his view, said about one deal" or "an agent's proposal, never put to him" were marked as binding until Oskar explicitly changes the policy.
Once any agent wrote down a cautious default—or an embargo like "no paid promotion for Sensei until Sensei 3" from a casual "not sure it's worth advertising right now"—every subsequent agent treated it as iron law. Friction only moved in one direction: toward more bans and narrower boxes.
2. Zombie auto-memory (517 files in one repo)
Even after cleaning AGENTS.md, policy docs, and skills, I checked ~/.claude/projects/*/memory/.
In the marketing repo, 57 memory files sat behind MEMORY.md, pulled into Claude sessions on demand—including stale notes saying "never plan shots around Oskar filming; render everything in Blender" even though in our observational comparison a real handheld MacBook clip outperformed a 3D CGI product ad by 25× on views.
In Backdrop, it was staggering: 392 active notes, plus MEMORY.md (at 20 kilobytes) and 124 archived files (517 total). Because MEMORY.md hit its 200-line truncation limit, agents had invented 5 sub-indexes just to keep adding more notes. About 38% of active notes were expired status logs, duplicates of AGENTS.md, or superseded rules—including two active notes linked from the index that literally started with "Expired" or "Holds until 3.0 ships (24 Nov)", and 27 broken links pointing into archive/.
My favorite discovery of the entire audit: even my own correction telling agents "dont just blanket insert more rules" had been saved into two separate duplicate memory files (rule-changes-need-oskar-ok.md and rule-text-needs-oskar-wording-ok.md).
Worse, we found the memory factory generating them inside Backdrop's AGENTS.md itself. Earlier, to stop agents from distorting my words, we had added a meta-rule instructing them to quote my exact words with an About: scope, a Holds: duration—including "this case only"—and an Our practice (not Oskar's): block. Because it said "when he corrects or decides something ... save it to memory" unconditionally, 70 Backdrop memory files already carried that template.
Right after we cleaned the repo, I told an orchestrator "we're stopping updating the beta, so remove any instructions for it." Instead of simply deleting the old beta-update instructions and stopping, it obeyed AGENTS.md and minted a brand-new tombstone file (beta-link-not-updated.md) recording that we had removed them. A rule written to prevent rule rot had quietly become its most productive factory.
3. Instructions are subject to git mechanics
This one sneaks up on you. Because AGENTS.md, policy docs, and skills live inside git, your rules obey git mechanics—even when you don't realize it.
In a worktree-heavy workflow like mine, every PR gets built in an isolated worktree and merged on GitHub, while the main local checkout (~/Backdrop) just sits there. When we audited Backdrop, my local ~/Backdrop checkout had quietly drifted 788 commits behind origin/main. You can correct a rule, review the PR, merge it on GitHub, open a brand-new session at the repo root—and none of your updated rules apply, because nobody pulled main in between. Every fresh root session was silently loading a two-week-old AGENTS.md that lacked the newer memory-scoping rules already merged on main.
The mitigation is simple, mechanical, and belongs in the harness rather than human memory:
- Keep root
maina clean mirror (all active edits happen in worktrees or feature branches, never lingering on rootmain). - Run a tiny
SessionStarthook (git-rule-freshness.py) on every new session. When you're onmainwith no local commits ahead, no staged changes, and no active git lock, it fetchesorigin/mainand runsgit merge --ff-only—without requiring a spotless working tree. Auto-generated IDE edits (like Xcode touching an.xcschemefile) and untracked files survive untouched; if an incoming commit genuinely overlaps a dirty file, Git refuses the fast-forward without modifying your local edits and the hook injects a turn-one warning asking the agent to readorigin/maininstead. Whenever rule files (AGENTS.md,CLAUDE.md,.claude/) change during a fast-forward, it also prompts the agent to re-read them immediately.
Breaking Through the Rot: Why One Agent Can't Fix It Alone
The real struggle wasn't spotting individual bad rules—it was figuring out how to fix rule rot at its core rather than just trimming symptoms at the surface.
Claude is great at doing deep repo and transcript archaeology, writing clean migrations, and refactoring docs—but it isn't great at catching rule rot inside itself. When Claude runs inside Claude Code, it automatically loads AGENTS.md and the MEMORY.md index it is supposed to critique. It is subject to the very rules it needs to question, and its compliance reflex nudges it to rationalize written bans rather than challenge them.
What actually broke through was a three-model cross-provider council—Gemini, Codex, and Claude Opus—each playing a different role:
- Gemini acted as the orchestrator outside Claude Code's auto-memory loader, synthesizing findings and challenging rule scope without being pre-conditioned by Backdrop's memory index.
- Codex ran in a clean read-only sandbox with zero Claude memory loaded, auditing every rule like a skeptical outside engineer. It was Codex that thought to actually execute our marketing copy linter against my own approved
"shake your MacBook"sentence and"4 Wallpapers in 12 Seconds"to prove the false positives empirically—and then served as the blind Pass-2 gatekeeper on every single fix. - Claude Opus brought the deepest context across git history, transcripts, and codebase architecture, executing the cleanups and regression tests once the council agreed—without ever grading its own homework.
Running the same model inside the same harness kept missing issues that an outside-model review caught immediately. Auditing from outside the target harness's memory loader—with a different model family's priors—is what lets an agent look at a sacred rule and say: "Wait—why does this exist?"
The Fix: Rule Hygiene as a First-Class Loop
After cleaning up both repos, I turned the whole process into a reusable skill—rule-hygiene-audit—that hunts all nine failure modes (authority drift, memory-factory meta-rules, over-generalized corrections, frustration dogma, executable overreach, stale copies, missing front-door pointers, zombie auto-memory, and git-skew) and encodes the cross-model council explicitly:
The two highest-leverage changes were fixing the root-cause meta-rules:
- Authority scope: Explicit standing decisions and approved plans bind within their agreed scope. Corrections fix the specific mistake being corrected—never stretch or invert them. One-off remarks, small-sample observations, and unapproved agent proposals set defaults and inform briefs; they never create blanket bans.
- Default to not writing memories: When a decision changes code, scripts, docs, or skills, make the change and stop there. When told to stop doing something or remove an instruction, delete the old rule—never add a tombstone memory note recording that you removed it, and never save one-off ("this time only") decisions to memory. Keep one canonical owner per rule and link to it instead of maintaining competing copies.
And just as important: every audit explicitly lists the guardrails that don't get touched—approvals for spending money, sending outbound messages, publishing releases, touching credentials, or deleting data. Rule hygiene isn't about making agents reckless; it's about clearing out the fake constraints so the real ones actually hold.
Treating Rules Like Production Code
Honestly, I think rule rot is the biggest unsolved problem in coding agents right now.
In fact, in an agent-driven repo, your rules and instructions are even more valuable than production code—orders of magnitude more important than the application code itself. A bad function breaks one feature; a rotten rule quietly shapes every session, decision, and pull request across the entire project for months.
I have a hunch that rule rot, together with occasional congestion or slowdowns with AI model providers, accounts for most of the so-called "nerfed" model experiences that users have been reporting, where their agents suddenly perform dramatically worse from one day to another.
Until harnesses garbage-collect stale rules natively, we solve it today with rule-hygiene-audit, git-rule-freshness.py, and a default of editing or deleting rules instead of minting new memories—both are live in OskarGroth/orchestrating-agents.
Next time your agents start hesitating, second-guessing, or refusing simple work, don't blame the model first. Refactor your rules—and tear down the fortress you accidentally built around them.