Planning (Agentic Pattern) with code improves performance

For applications where the task can plausibly be done by writing code, letting LLM express its plan in software code that you can just execute for the LLM can be a very powerful way to let it write rich plans.