The Exponential Rise of Agent Instruction Files
65 points by reshabh 3 days ago | 45 comments

tensegrist 6 hours ago
> The adoption of agent instruction files has grown exponentially. They have grown from about 20,000 to 1.4 million in just over a year.

the chart after this has three points and the choice to put an exp-like curve in between the most-separated pair thereof is unfortunate

incidentally it seems quite likely that most of the AGENTS.md files here are for new repos, since the post doesn't control for total repo count on github (or even the rate of growth) so even if we were creating the same number of repos per day now as in the before times — which i know isn't the case — we'd still expect to see a linear growth in the number of these files

reply
pards 6 hours ago
> I have found it difficult for the agents to follow the set of rules I want them to follow for projects that were not developed by them from scratch.

This reflects my experience too.

reply
cataConst 5 hours ago
If I have a prompt, I put it in 3 different chats and filter the result & input trough all 3 chats. Claude is the best in my opinion, coding and daily chat. Do you have a specific way how to input the prompt/rules ?
reply
basch 2 hours ago
“rewrite this project to be exactly the same but also as if you had written it”
reply
knollimar 2 hours ago
I’ve tried “another instance of you wrote this”.

No formal measurements but it feels better

reply
miltonlost 4 hours ago
And then in PRs and meetings, we're told to fix the agents file when we see it get something wrong. But the agents file already has the rule. And then the agent gets the rule wrong again. And the cycle continues because we get so much more lines of code!
reply
dasil003 40 minutes ago
If it doesn't work you need to move it out of band, to the strongest layer you can that makes sense. The best is compiler enforcement, one layer lower is a linter, then some other form of progrmmatic test, and failing that you can have separate agent reviewer plugged into your CI process / software factory.

You can't just dump all considerations on a single agent and expect them to follow every single rule while also making the right tradeoffs. Fundamentally the game is how do you orchestrate agents to elevate the right considerations for human awareness and input. Models and harnesses will continue to get better which will continue to raise the ceiling on what you can naively throw at a single agent, but the buck always needs to stop with human at some point, because otherwise what are we even doing here?

reply
chai_coder 4 hours ago
[dead]
reply
williamdclt 4 hours ago
Well TBF, I have the same difficulty with humans. Either you're the only* developer on a codebase and you can have an unenforced "set of rules", or you're not and you need to somehow enforce them.

*okay I've seen it work in small, competent, tight-knit teams... and even then, it often relies on someone particularly caring about those rules, even if the others are generally in agreement

reply
slurpyb 3 hours ago
Lol what is this shilling? Who is it for? It is not even comparable.
reply
brendanator 4 hours ago
AI code review[1] can check that guidelines in AGENTS.md (and the like) are being followed in PRs

1. https://www.sourcery.ai/ - disclosure, I'm the CEO

reply
santiagobasulto 53 minutes ago
Regarding agents following instructions, my recommendation is to split in as many `AGENTS.md` file as possible, and use the root AGENTS.md as an index reference.

For example, this would be the resulting structure:

    src/
        billing/
            AGENTS.md
        products/
            AGENTS.models.md
            AGENTS.api.md
            AGENTS.md
    AGENTS.md
Then in the core AGENTS.md you can reference the main subsystems of your project and instruct the agent to reference the specific AGENTS.md. And `products` is a concrete example of a module so big that you can split instructions in multiple agents files.

This usually keeps the context very clean and working locally reading files is very fast.

reply
armcat 50 minutes ago
This is great advice and something I apply everywhere even with skills, where I have SKILL.md as just front matter plus index/ToC. It aligns well with progressive disclosure principles
reply
Schlagbohrer 6 hours ago
Can anyone recommend a good AGENTS.md for use with local AI? I have mine but I keep needing to prune it and I never had a tested, open source template to start with so I don't know what I might be missing. Would love to see some tried and tested open source examples.
reply
bruce343434 6 hours ago
If you are having a recurring issue with how you AI is developing the project, i.e. pittfalls, then you can put the right way to do it or a workaround in the AGENTS.md

This depends on both the AI model and the Project.

Other than that, most things should probably still go into documentation like README, CONTRIBUTING since a lot of process still generalizes to both humans and AI agents.

You can add a line in AGENTS that it should orient itself with those files before starting anything.

Stay on top of the "project memory" that your agent is building up. Literally prompt it to "dream about the project" so that it can prune stale entries itself and re-derive, re-summarize. I try to keep most project memory entries in traditional documentation, since it's also useful to humans. And putting it in the repo makes it useful across AI providers and accounts.

It's not well established to think about documentation this way. But documentation is instructions. Code is instructions. Code is commonly refactored and technical debt is regularly (hopefully!) reduced in a dedicated maintenance pass. Do the same for documentation.

And this is very unorthodox but: for my personal projects, I put the tickets as markdown in the repository now. They haev a fixed structure that begins with owner, status (approved, ai suggested, draft). I have tickets/todo and tickets/done. This way, tickets are not only version tracked, but also directly accessible to the agent without having to go through some API. As a bonus, it makes migrations to and from various forges very easy.

When you notice that a workflow generalizes across repositories or projects, you should move it out of AGENTS.md and into a SKILL.md

reply
eigencoder 2 hours ago
I tried putting tickets as markdown in my personal repository, but I found I had to be very diligent about pruning them, because ai suggested "tickets" kept being read by other agents and it would bloat the way they would build other unrelated features.
reply
samudrijan 2 hours ago
Keep the project management out of the code.

If you don’t want to use an api, then centralize all your tickets in one repo, organized by project.

reply
Schlagbohrer 3 hours ago
How do you manage the tickets? Are they just lists in .md files?

I have a workflow that creates a project folder, gives it a README.md, and git init's for everything. But the README.md also accumulates the TODO list which is where the tickets get put and it builds up a bit. I wonder if git has some esoteric way of doing this already that I could use...

reply
baby_souffle 2 hours ago
> How do you manage the tickets? Are they just lists in .md files?

I used to do this. One folder per epic with numbered files describing the work, acceptance details ..etc.

Now I use Beads and it’s been a game changer.

reply
trio8453 5 hours ago
Start empty and only add stuff you find yourself repeating across sessions.

I think most people overdo it with the AGENTS.md files and skills - if you know that you always have a preference for style-x instead of style-y or always need to explain something specific about your project which for some reason isn't documented elsewhere (why isn't it in your readme or /docs?), then sure, add it there. But for many things you can prompt directly during the session instead of maintaining these md files.

reply
latentsea 6 hours ago
Very specific to your model and your project tbh. Everytime the model changes you need to run ablation studies to even know if what's in there still has value or should be removed.
reply
bruce343434 6 hours ago
What do you mean by ablation studies?
reply
latentsea 4 hours ago
An ablation study is when you run an eval both with and without a component of the harness to see if it has any effect on eval performance or not. Otherwise... it's all vibes. Components of a harness are bets against the model since they arise from things the model itself can't do, so you add them in and keep adding them, and when a new model comes out actually unless you test it this way, you don't know whether the things you added in to help the previous model are good, bad or neutral under the new model.
reply
thechao 5 hours ago
Remove chunks & recode.
reply
ramses0 3 hours ago
I took my initial janky `AGENTS.md`, asked it to begin authoring an `AGENTS.rfc` (expanded prose with justifications, etc which I then reviewed and rewrote in my own voice with justifications and rationales) and then condense it back down to an `AGENTS.md`.

    0.  Introduction (AGENTS.rfc)

    This file is designed for the humans working on the project, in
    collaboration with an AI agent.  Regularly ask the AI agent to
    summarize this file to your typical `AGENTS.md`, but collaborate
    with the agent and work to modify `AGENTS.rfc` when composing
    new rules or guidance.

    It is written in an RFC-style format (but slightly modernized)
    which should trigger the right type of tone and processing for
    both humans and agents.
...and here's some "answerless prompts" which you can use your big human brain to imagine the AI responses: "review agents.rfc and explain some of the benefits of it compared to only having agents.md"; "calculate prompt and context impact estimation between the RFC and the raw *.md"

Basically, the `*.rfc` has the justifications + rationales: AGENTS.md says don't mock in-repo code. The RFC explains that mocks reimplement behavior, so when real code changes, the test stays green against the stale mock — "worse than no test, because it creates false confidence."

...however the `AGENTS.md` just has the directive(s) "Don't mock in-repo code, ask before mocking, only mock external boundaries, ..."

So on every context turn the agent is getting an abbreviated (low-token) mandate "don't mock by default", but if it starts going off track I say: "Penance! Read AGENTS.rfc, contrast against your proposed code, go fix it, and then propose updates to AGENTS.rfc and AGENTS.md so you don't do it again..."

The rules decay without the "why", and maintaining the "why" gives better guidance. Good rules can take up "too much context" (especially earlier, before 1M context windows...) and most of the time our busy-bee coding assistants don't really need the rationales (unless you're collaborating to update or understand the rules that caused the incident).

reply
D2OQZG8l5BI1S06 2 hours ago
Claude recommends having the rationale in the AGENTS.md as well.
reply
ramses0 33 minutes ago
In my case it's ~3-4x token burn (6kb vs 24kb) which I can _conditionally_ invoke . Maybe with huge context windows and token caching it's all "fine" nowadays, but if you think about it as an employee handbook and then the safety posters on the wall like "don't stick your fingers in the machines (b/c they'll get chopped off); always wear your PPE (or you'll get injured); ...", you can definitely tune/tone-down ("pre-compile") what gets sent to the LLM but still re-vivify the complete rationale if needed.

Again... this was really effective ~6-9 months ago, but the pace, capacity, and capabilities are increasing so quickly this is probable just another "bitter lesson" moment.

reply
cisrockandroll 5 hours ago
Its literally just a prompt of text.
reply
darkerside 6 hours ago
Wouldn't the best option here be to use the agent itself to generate it while the repo is still new and small?
reply
LevGoldstein 3 hours ago
Auditing a friends large vibed app recently, they had done exactly this. The file had turned into a many-thousand-line blob of text that was closer to just being a chat log, with random facts about the design process and excessively verbose descriptions of things that should have just been comment blocks in the code. Claude even printed an error when starting a new session, complaining about the size. So I would say definitely don't go hands-off...keep it tight, and have it contain only points that you've personally found should be there.
reply
Schlagbohrer 2 hours ago
haha yes i find my agent often adding unnecessary stuff to the AGENTS.md and I have to tell it to "take that out, it's just a one-time thing"
reply
latentsea 6 hours ago
That assumes the agent knows what to put in it to affect the agents own behaviour in a positive way that aligns with the users intent.
reply
arbor-group 4 hours ago
[dead]
reply
gencay-e 3 hours ago
[dead]
reply
j45 3 hours ago
Why are universities and researchers studying the past of AI by the time they publish?

Is it just me, or does AI research increasingly feels obvious, or dated?

reply
julianlam 2 hours ago
Models improve by leaps and bounds on the order of months. Research papers solidify research targets ahead of time, and so even state of the art models are stale by the time the paper comes out.
reply
peab 2 hours ago
agreed. I keep seeing headlines that don't make sense, and then I open the paper and they use something like gpt 3.5 turbo - which feels ancient by now. It also feels absolutely meaningless to be talking about gpt 3.5 at this point
reply
zdragnar 2 hours ago
I recall a university professor explaining that the department wouldn't teach any common languages above C++ because the web was moving too fast and the language feature knowledge would be outdated over the course of a 4 year degree. Instead, they only focused on the computer science fundamentals and "hard" problems like modelling fluid dynamics and AI (pre-LLM and neural network days).

Then, universities started feeling left out because web was where all the jobs were at, and bootcamps were becoming a Big Thing, so the departments changed to include more "real experience", going so far as to even include some basics in version control!

Now, we've had a decade or so of research outside of academia utterly leapfrog where a lot of the academia research was in AI, and they're feeling left out again. Sadly, the rigor and process of researching, authoring and publishing an academic paper takes much more time than throwing out some blogspam. Processes designed around understanding immutable facts of nature (everything from laws of physics to chemical interactions to sociological development) don't cope very well with fields that change every time you blink.

reply
ben-greenspring 48 minutes ago
[dead]
reply
k_ivanow 29 minutes ago
[dead]
reply
yeestwind 2 hours ago
[dead]
reply
aitchek 3 hours ago
[dead]
reply
lucasdupont 44 minutes ago
[dead]
reply
t9tokenbudget 3 hours ago
[dead]
reply
fami-hn 2 days ago
The growth makes sense, but in our repos the files only stayed useful once we treated them like code. Habits that helped: keep the root file short and put rules next to the code they apply to (one per package or directory), so an agent working in the mobile app isn't reading backend conventions. Write rules as checks rather than vibes ("run the typecheck before finishing", not "write clean code"). Delete anything an agent has demonstrably stopped needing, because stale rules get followed just as faithfully as good ones. And every so often, give an agent a task and read what it actually did against the file; that's the only way to see which lines are ignored.
reply
trollbridge 6 hours ago
Could you share the agent instructions you used to write this comment?
reply
nokapad 5 hours ago
[dead]
reply
binaryturtle 6 hours ago
What about all the instruction files that just tell any agents to <bleep> off? Do those count too? :)
reply
Birkoff 6 hours ago
I guess the agent files go the same way as skills. Smart instructions are all around, but evals that would show the impact rarely happen.

In the end I think we create a lot of noise with carelessly crafted agents.

reply
raffraffraff 7 hours ago
It's the rise of standard operating procedure docs that should have existed already, but everybody was too lazy to write them. Laziness has just gotten a new engine. Our incentives have changed.
reply
slurpyb 3 hours ago
Claude write an article with this data
reply
themgt 6 hours ago
You are a Static Analysis Engineer. You generate Python code that checks source files for a specific constraint.

The solution is Python generated by You Are An Expert LLM fed Markdown interpolated by Python processing instructions in Markdown, make no mistakes?

I'm just not sure any more, is this is computer science? Are we still sneering at "vibe-coders"?

https://github.com/reSHARMA/InstructGuard/blob/b4e4a4e04afd3...

reply
Hasz 4 hours ago
There is a significant difference between using one agent to build deterministic checks against the output/products of another and just prompting your agent to fix <insert rule>

Building good, deterministic guardrails and letting agent go hogwild inside the bounds is faster and if you setup your constraints, better.

reply
BarryMilo 5 hours ago
It's more art than science now. Computer art!
reply
AIShill101 5 hours ago
I mean if it works, it works.
reply
matreshka15 6 hours ago
[dead]
reply
mangod12 3 hours ago
[dead]
reply
jkondo 5 hours ago
[dead]
reply
yunyang088 6 hours ago
[dead]
reply
claudiopi 5 hours ago
[dead]
reply
srikondapalli1 4 hours ago
[dead]
reply
aadieng100 5 hours ago
[dead]
reply
Nik0laich 2 hours ago
[dead]
reply