Sulat.com / Writing on AISunday, December 6, 2026
Enter →
Agent Engineering/6 December 2026

poteto’s prompt for pruning AGENTS.md

poteto's prompt has a coding agent prune its own AGENTS.md into tests, then ablate what's left. I ran it, then ran 60 controlled sessions on a toy repo.

3D illustration of an AGENTS.md file being pruned with shears, with a test checklist beside it
Illustration: Sulat

At a glance

  • poteto's prompt has a coding agent sort its AGENTS.md and skills into code-enforced rules and prose, move the enforceable ones into tests, then ablate the rest.
  • On a toy repo, all four code conventions held in 60 of 60 runs even with a one-line AGENTS.md.
  • The one rule that lived only in the text, a rural surcharge that is never discounted, was right in 30 of 30 runs with the text and 4 of 30 without it.
  • The prompt's own example prune rule, a 2-point margin on a 10-point total, would have deleted that rule.
  • A stale line in AGENTS.md made 7 of 15 runs write code that contradicted the repo.

poteto posted a prompt on X that asks an agent to audit every piece of agent-facing text in a repository, turn what it can into tests and lints, and then prove by experiment which text is left worth keeping. I ran the prompt, then ran a 60-session controlled test to see what it would do to a real AGENTS.md. It’s a sound idea with one blind spot, and the blind spot deleted the only rule that mattered.

poteto’s post with the prompt.

The prompt

This is the prompt as posted. You paste it into a coding agent that’s sitting in your repository.

Code
Audit all unstructured agent-facing text in this repo (AGENTS.md, skills, cursor rules, architecture/spec markdown docs) and replace as much of it as possible with executable code, types, lints, and tests. Then prove empirically what text actually earns its context window.

1. Inventory: list every doc, rule, and skill file, its byte size, and classify each claim into:
   - Restates code or types (delete)
   - Mechanically enforceable (convert into a linter, compiler check, typed API, or test, then delete the prose)
   - Irreducible judgment call (candidate to keep, only if concise)

2. Prune and enforce: move enforceable rules into CI/lints/tests first, delete the dead prose, and shrink root instructions to only what automated checks cannot catch.

3. Run a blinded ablation eval before keeping any remaining instructions/skills:
   - Pick 1 to 2 representative real tasks from this repo with an objective rubric and stress tests.
   - Pre-register a prune rule before running (for example: drop the larger text set unless its median beats the smaller set by at least 2 points).
   - Run 3 fresh isolated replicates per condition on clean commits that differ ONLY in the text under test:
     - A: full current instructions/skills
     - B: domain-only instructions
     - C: minimal root instructions only (0 skills/extra docs)
   - Audit transcripts for leaks (verify which files were actually opened vs just sitting in the system prompt).
   - Grade blinded diffs + built artifacts only (strip branch names, SHAs, and notes) using a separate judge model + automated probe tests.

4. Report the scorecard, which docs/skills were never opened, where extra text hurt or helped, and delete everything that fails the pre-registered prune rule. Turn any recurring failure modes into tests or lints, not new prose.
Flowchart of the prompt: inventory agent text, prune into tests and lints, then run a blinded A/B/C ablation
The prompt inventories your agent text, moves what it can into tests, then ablates what’s left.

It has three moves. First it sorts every claim into three bins: restates the code, mechanically enforceable, or a judgment call. Second it moves the enforceable rules into tests and lints and deletes the prose. Third it runs an A/B/C ablation with a pre-registered rule for what gets deleted, so the agent can’t talk itself into keeping text it likes.

What the evidence says

The prompt rests on a result that’s now well known. ETH Zurich and LogicStar’s Evaluating AGENTS.md found that across several coding agents and models, LLM-generated context files made task success slightly worse than no repository context at all, and raised inference cost by more than 20%. Developer-written files fared better, with a small gain, but still cost more to run.

Vercel reached a different conclusion for a different question. In its agent evals, a compressed AGENTS.md index beat skills the agent had to choose to load. Both can be true: short, always-present text can help, while long text and optional extras mostly add cost.

Cutting rules has been a theme of the last fortnight’s coverage. Philipp Schmid deleted most of his agent rules for Gemini 4 Neon. Ratchet turns AGENTS.md rules into enforced hooks. PostHog’s Coherence does the same with checks inside Codex, Claude Code and Antigravity, and Anthropic’s advice on large codebases says the setup around the model matters as much as the model. poteto’s prompt is the do-it-yourself version of all of that.

Running it as posted

I installed opencode (version 1.19.6) on a 4-core, 15 GB RAM Ubuntu 24 box and ran the prompt verbatim on DeepSeek V4.1 Flash, against a small shipping-quote repo I built called Parcelmate. The repo has an AGENTS.md, an architecture doc and three skills, 6,630 bytes of agent text in all.

The agent finished with 96 bytes. It deleted the restatements, wrote a conventions test and added tests for the checkable rules. That part worked. Then its ablation came out at 19.625 for the full set, 19.750 for domain-only and 19.500 for minimal, and the pre-registered rule kept the minimal set.

Terminal output of the prompt on DeepSeek V4.1 Flash deleting the rural surcharge rule as not executable
The prompt’s report: the rule that mattered was classed “not executable” and deleted.

One of the deleted lines was this one: the rural surcharge is never discounted. It’s an ops decision. Nothing in the code states it, and the agent classed it as not executable. The agent had also written the task prompts for its own ablation, and its first task spelled that rule out in the prompt, so every condition passed. The experiment couldn’t have caught the deletion.

The controlled test

One agent run on one repo is an anecdote, so I built the test properly. Parcelmate’s code is identical in every condition. Only the agent text changes, in four setups:

  • A: everything: AGENTS.md, the architecture doc and three skills.
  • B: the four domain bullets only.
  • C: a one-line AGENTS.md that says to run npm test.
  • D: the same one line, plus a checker script that npm test runs and that enforces the repo’s four code conventions.

Five models ran each setup three times, for 60 sessions: Kimi K3.1 Pro, DeepSeek V4.1 Flash, Claude Haiku 5.5, GPT-6.2 Sol and Gemini 4 Neon. Every session got this identical task:

Code
Add promo codes to Parcelmate. Export a function quoteWithPromo({ weightKg, zone, promoCode }) from src/index.js. It returns the same quote shape as quoteRate. SAVE10 takes 10% off the shipping. FREESHIP waives the base charge, but any surcharge still applies. Any other promo code is an error. Add tests, and make sure npm test passes.

A script graded each result with ten checks: six behaviour probes (including the rural FREESHIP case, where the surcharge must survive), two convention checks and two test checks.

What happened

The setups scored almost the same on the total, which is the problem with a total. The medians were 10 for A and B, and 9 for C and D. Under the prompt’s own example rule, drop the larger set unless it beats the smaller by two points, A loses to C by one point and goes.

Check (15 runs per setup)A fullB domainC minimalD minimal + checker
10% off, urban1581515
10% off, rural151531
Free shipping, rural1581515
Other seven checks15151515
Runs passing each check. The other seven cover free shipping urban, unknown code, invalid weight, the two convention checks, new tests and the existing suite.
Infographic: a 10-point score where a 2-point prune rule would delete the single rule that mattered
A single total score can hide the one rule that mattered.

Conventions don’t need text

All four code conventions held in all 60 runs, including the 30 runs with only a one-line file: named exports only, kebab-case file names, a Result type instead of throwing, and a test file per module. The agents copied what the code showed them. The convention checker in setup D never fired once.

Checklist: four code conventions held in 60 of 60 runs, the rural surcharge rule right in 4 of 30 without text
Conventions the code shows survive a one-line file. The one rule the code doesn’t show doesn’t.

That part of poteto’s thesis holds up. Prose that restates the code, or restates what a lint would say, isn’t earning its place.

The one rule the code can’t show

The rural surcharge rule is the only requirement that lives nowhere in the code. With the text, A and B got it right in 30 of 30 runs. With a one-line file, 4 of 30 did. The checker in D didn’t help, because it checks conventions, and this isn’t one. It’s a business decision, and the prompt’s three bins have no clear place for it. “Irreducible judgment call” is the nearest fit, but the prompt says to keep those only if concise, and then tests the choice with a score that can’t see it.

A stale line beats the code

The test also turned up the opposite failure. Setup B’s AGENTS.md carried an out-of-date line saying GST is rounded down. The code rounds to the nearest cent. In 7 of 15 B runs the agent followed the line and wrote Math.floor, which broke the money probes. A was clean because its pricing skill pointed the agent to the existing rounding helper. Text that disagrees with the code does more than waste tokens, because agents follow it over the code.

Infographic: a stale rounds-down line in AGENTS.md made 7 of 15 runs use Math.floor despite the code
A stale line in the file beat the code it described in 7 of 15 runs.

Two smaller findings back the prompt’s instinct about skills. The release-process skill was never opened in 15 runs where it was available, while the pricing and testing skills loaded in all 15. The full set also cost more: the median session read about 12,500 tokens before doing anything in A against about 11,300 in the other setups, and about 189K input tokens in total against 138K to 152K.

Diagram sorting AGENTS.md rules into code-enforced, restated-by-code and knowledge only the text carries
Only the rules the code can’t enforce are worth keeping in the file.

How to use it

  1. Run the prompt. The inventory and the move into tests are the valuable parts.
  2. Before the ablation, list the rules that exist nowhere in the code, such as pricing decisions, ops constraints and legal limits. Write one probe task for each and keep it out of the agent’s own prompts.
  3. Pre-register the prune rule per probe, not per total. If any single probe drops when text is removed, the text stays.
  4. Read the surviving text for lines that contradict the code, and delete them.

What this test covers

This is a smoke test: one toy repo, one task and a script of probes. I didn’t use an LLM judge in my controlled runs, and I didn’t test larger repos or other harnesses’ skill systems. The findings are about what a one-line file can and can’t carry.

Disclosure: I’m an OpenAI, Firecrawl and Devin ambassador.