Dependencies & post-hooks
Use case: order work correctly — some tasks must run before, and some after, a task — and diagnose failures automatically.
Demonstrates: dependencies, post-hooks, failure hooks · Guide: Dependencies
Prerequisites: none
Run it
Section titled “Run it”rune deployExpected output
Section titled “Expected output”buildingtestingdeployingnotify: deployed ✓deploy: build test && notify — build and test are dependencies (run first); notify is
a post-hook (runs after deploy succeeds). Each task runs at most once per invocation.
Then try the failure hook — rune flaky fails on purpose and runs its post-mortem:
checkingdiagnosing: diagnosediagnose: flaky failed with exit 3The invocation still exits non-zero (hooks never change the exit code), and over MCP the diagnostic reaches the agent as a fix suggestion in the same tool response.
How it works
Section titled “How it works”See the Runefile: prerequisites go after the colon, post-hooks after &&, failure hooks
after ||. The hook body reads RUNE_FAILED_TASK and RUNE_FAILED_EXIT_CODE from its
environment.