This is a good resource https://howborisusesclaudecode.com/
My best takeaway from the site was: Every time you see Claude Code / Codex doing something you don't want, ask it to add to AGENTS.md. Specially if they churn a lot doing something, and eventually find a way. I ask it to store the way it made something work. It's a constant gardening of AGENTS.md and it has really working well.