Why coding agents copy your bad code: a screenshot shows self-reinforcing style mimicry

QuixiAI · x · 2026-11-07

截图展示了一个编程 Agent 的真实对话:被质问「为什么写 List.new() 而不是 []」时,Agent 坦白自己是在照抄周围源代码的风格,同时按规范(D93)把写法改成 [],并主动执行了「Fix shitty code」指令修复相关调用点。配文发问「为什么 Agent 会这样,以及怎么修」,指向 LLM 的上下文模仿倾向——Agent 会无意识地继承代码库中的坏习惯,这已成为实践中的常见痛点。

Related event: Coding Agents Admit to Copying Surrounding Code Style(2 posts)→

Original post →

More from coding & agent

coding & agent channel →