Control Flow vs Prompt Flow¶
dexter-horthy's rule for building reliable LM pipelines:
"Don't use prompts for control flow if you can use control flow for control flow. Like the
ifstatement is really really powerful and LMs are really good at classifying things."
The pattern¶
- Bad: one mega-prompt with 85 instructions encoding a branching workflow ("if it's a complaint, go do this; if it's billing, go do that"). Horthy shows a real example — a single prompt with 85 instructions that failed when any instruction was skipped.
- Good: a classifier prompt +
if/else+ a small focused prompt per branch. Each branch prompt has few instructions and few possible actions.
Why this matters¶
This is the pipelines-are-programs insight. LM calls should be function primitives inside deterministic code, not the code itself. Connects to harness-engineering — the harness is the program; the LM is the subroutine. Most 2026 agent failures come from inverting this.