Trusting AI Code
prompt -> ai-design.md -> ai-pr changes ... this topic alone deserves a blog post in-itself
This basic feedback loop is what I've become accustomed to for nearly any majorly AI-generated code or project, where at every step of the way I want to iterate and review, rather than all-or-nothing having successful output.
Much like coaxing a team of interns to the right path, one of the crucial day0-instructions I give is to literally write down every single character that they type into a Terminal, before hitting enter. As-in, I'd prefer if they typed out full bash-histories into a Notes.app, before actually copy-pasting the same thing into a Terminal.app.
Same thing with any code from Stackoverflow.com to their Visual Studio Code.app. It's really all the same ... that "Clear Writing indicates Clear Thinking".
The point is that the best engineers I've had the privilege to work with, don't trust; and hence why we do iterative review, at all.
--
Some more concrete tips:
- Claude isn't the only choice, but they did a fantastic job of socializing
claude-md-filesso here we are ... for stupider models this may require similar but different paradigm (and maybe some post-training magic... so who's distilling who then? ;) ) - Global Claude memory lives in
~/.claude/CLAUDE.mdas higher-priority- See example: https://github.com/joseph-zhong/dotfiles/blob/master/claude/CLAUDE.md
- Another commendable but maybe slightly overhyped example: https://github.com/multica-ai/andrej-karpathy-skills/blob/main/CLAUDE.md
- Project-specific memory is pretty niche IMHO, if you can't be consistent across projects, should it be memory at all versus the immediate prompt?
- In some cases I can see this, similar to
source ~/kube/admin-creds.shfor cloud infra folks reading this ... but for something truly so sensitive would you trust AI at all? We barely trust one another here... - At Meta we actually did this a lot since the monorepo is f*cking insane, but at that point it was basically equivalent of doing
~/.josephz/my-claude-files/[...].mdwhich is basically the same as~/my-tlm-pet-project/our-claude-files/[...].mdwhich is quite useful for oncall or pair-programming
- In some cases I can see this, similar to
All in all: ... these are just rules that we've already been using for years, and tell (usually ignorant) people when we don't trust them; honestly people just mostly suck at articulation and writing them explicitly, but otherwise learn extraordinarily quickly that AI doesn't.