← sources

How do you document AI generated code when nobody knows why it exists?

source: reddit (reddit:AI_Agents)published 2026-09-14 11:23ingested 2026-09-15 02:36

retained text

i've been writing up a payments service this week that is maybe seventy percent agent built by now. first time anybody has sat down with the whole thing properly.

there is a hardcoded skip in the nightly reconcile. one account id, sitting in a list on its own. nothing in the code says why it is there. no ticket linked to the commit. the pr description is two lines about what the change does, the commit is called 'handle reconcile edge case', and it went in eight months ago.

nobody who works here now was in the room when that got decided, because there was no room.

so if you are running agents at any volume, get somebody to record why and not what. coderabbit's summary of that pr is still sitting there and it describes the skip accurately. i could already see the skip.

document fetched 2026-09-15 00:20 · canonical https://reddit.com/r/AI_Agents/comments/1wg0ok5/how_do_you_document_ai_generated_code_when_nobody