My AGENTS.md files kept growing because I tweak the files as I identify mistakes and added preferences/overrides. But as time goes by, especially after switching models, it’s hard to tell which instruction still mattered, or made things worse.

But they are agents, you can just tell it to do things.

I asked Sol, the coding model I was using, to evaluate one global AGENTS.md and four project files. It extracted the individual points from each file, started with an empty AGENTS.md, added the points back incrementally, and compared the output.

The review left the files approximately 50% shorter.

Treat AGENTS.md Like Code

I already review AGENTS.md like code, but I used to prune it manually by reading the file and hand editing them. That isn’t enough.

An instruction can sound important and do nothing. Another can look redundant but prevent the agent from running the wrong command or crossing a production boundary. That’s because models hold a lot of knowledge and have their own preferences. They might infer your preferences from your existing codebase, but they can’t always do that, you might have to ask them to, or maybe your codebase is inconsistent.

OpenAI’s current model guidance recommends removing one group of instructions at a time and rerunning the same evals. That is close to the method I used, except I applied it to the standing instructions in my AGENTS.md files.

Extract Every Instruction First

Do not start by asking the agent to “make this shorter.” That invites a rewrite based on what sounds repetitive and “unproven”. Instead, start by turning the file into a list of individual instructions. I’m omitting the rest here because coding agents would know what to do if you tell them the right way.

Optimize all of them

You can ask it to work on your global AGENTS.md as well as project-specific AGENTS.md. I don’t usually use them, but if you have folder/specific AGENTS.md too, go for it.

Remember, 50% is not the target. I have some AGENTS.md files where the coding agent recommended not to change at all.