LLM codegen fails and how to stop 'em — Danilo Campos, PostHog
Apr 30, 2026 · 19:18
Danilo Campos, who builds the PostHog wizard, explains how to make LLM code generation reliable by sharing practical strategies from a system that helps 15,000 users per month. He identifies 'Model ROT'—models becoming stale—and counters it by shoving fresh Markdown documentation into context. To avoid weird architecture, he maintains 'model airplanes': thin, auth-shaped simulacra that provide correct integration patterns. He limits improvisation by breadcrumbing the agent step by step, starting with detecting business-value files before even mentioning PostHog. Campos stresses that human errors (contradictory instructions, missing tools) are the biggest threat, solved by asking the agent after each run what could be improved. He also details locking down tool usage to prevent shenanigans like reading .env files, replacing that with a limited key-check and write tool. The core shift: code is a depreciating asset, so 90% of the wizard's value is now in Markdown files and prose, which improve with better models.