Call stack diffs | Oskari Mantere
Inspired by HumanLayer’s “Program Design” section in Why Software Factories Fail, I’ve recently added a permanent system instruction for coding agents to communicate all planned changes or implementations inline as call stack diffs:
LLMRun.generate()<br>└─ llmClient.streamChatCompletions()<br>- └─ iterator.next()<br>- └─ wait indefinitely<br>+ └─ withProviderInactivityTimeout()<br>+ ├─ race iterator.next() against 30s timeout<br>+ ├─ event received → reset timer → yield downstream<br>+ └─ timeout<br>+ ├─ abort provider request<br>+ └─ throw ProviderInactivityTimeoutError<br>+ ↳ LLMRun.retryBackup()
I find this much faster to scan than the prose which these language models tend to produce by default. The red/green highlighting visually stands out from the rest of the session transcript, so you can quickly parse the behavioral changes on a high level. This is especially useful when working out the design in back-and-forth conversation or when resuming work after switching sessions.
This diff does not replace the supporting explanations or documentation, rather it’s like a pseudocode but better at showing the location of changes in the actual program, using real function and class names in an informal but maximally compressed representation.