The Code/X ArchiveView on X
Kun Chen

@kunchenguid

many people asked me how to write CLAUDE.md or AGENTS.md, and i see lots of bad advice flying around

so i took some time to write down a guide in blog.kunchenguid.com/p/your-agentsmd-is…

tl;dr
- handwrite your user level AGENTS.md
- for project level ones, you don't write it. you train it like a neural net

i also open sourced my private solution "backpass" at github.com/kunchenguid/backpass - it samples your past agent sessions for a repo, distill key learnings and losses, synthesize them, and produce a gradient descent step as a proposal that you can review and apply to improve your AGENTS.md and project level skills

easiest way to run it is just "npx -y backpass" in your repo

hope it helps! please share with whoever you think can benefit from it

blog.kunchenguid.com

Your AGENTS.md is a Neural Net

And here’s how to properly train it with gradient descent

481161.3K2.7K