Oodle / Workshop materialBack to workshop hub
Masterclass

Recipe: recalc on change

A source value changes, a downstream calculation reruns and flags what moved.

Recipe: recalc on change

For anyone whose Build brief idea is still blank. Swap in your own systems and this is yours in ten minutes.

The pain it copies: a number changes somewhere upstream (a rate, an income figure, a pricing input), and someone has to redo a downstream calculation by hand, then eyeball whether the result moved enough to matter. Michelle's affordability recalc is the reference case: 10 to 15 minutes down to about 2.

The five blocks

  • Trigger: a source value changes, or (simplest to build today) you run it on demand against the latest value.
  • Input: the changed value, plus whatever else the calculation needs. Pull it from wherever it lives today: a spreadsheet, an internal API, a database query, a form.
  • Work: rerun the calculation with the new input. Reuse the existing logic if you can find it; don't re-derive it from scratch.
  • Check: compare the new result against the last known result. Flag it if the move is bigger than a threshold you pick (a percentage, an absolute amount, a pass/fail line).
  • Output: the new result, the old result, the size of the move, and whether it crossed your threshold, in whatever format the next person reads: a doc, a comment, a message.

Swap in your own systems

  • Don't have a "recalculation" in mind? Any repeated manual comparison works: two versions of the same number, a before/after, a this-week-vs-last-week.
  • No API for the source value? Start with a file or a copy-pasted number and automate the fetch later.
  • To make the Trigger real: a Claude Code routine on a schedule covers "check when the value usually changes." An API trigger covers "recompute the moment it changes."

Done when

It ran once on a real (or realistic) changed value, produced a comparison you didn't compute by hand, and you can point at the line that says whether the move mattered.

Original Markdown
# Recipe: recalc on change

For anyone whose Build brief idea is still blank. Swap in your own systems and this is yours in ten minutes.

**The pain it copies:** a number changes somewhere upstream (a rate, an income figure, a pricing input), and someone has to redo a downstream calculation by hand, then eyeball whether the result moved enough to matter. Michelle's affordability recalc is the reference case: 10 to 15 minutes down to about 2.

## The five blocks

- **Trigger:** a source value changes, or (simplest to build today) you run it on demand against the latest value.
- **Input:** the changed value, plus whatever else the calculation needs. Pull it from wherever it lives today: a spreadsheet, an internal API, a database query, a form.
- **Work:** rerun the calculation with the new input. Reuse the existing logic if you can find it; don't re-derive it from scratch.
- **Check:** compare the new result against the last known result. Flag it if the move is bigger than a threshold you pick (a percentage, an absolute amount, a pass/fail line).
- **Output:** the new result, the old result, the size of the move, and whether it crossed your threshold, in whatever format the next person reads: a doc, a comment, a message.

## Swap in your own systems

- Don't have a "recalculation" in mind? Any repeated manual comparison works: two versions of the same number, a before/after, a this-week-vs-last-week.
- No API for the source value? Start with a file or a copy-pasted number and automate the fetch later.
- To make the Trigger real: a [Claude Code routine](https://code.claude.com/docs/en/routines) on a schedule covers "check when the value usually changes." An API trigger covers "recompute the moment it changes."

## Done when

It ran once on a real (or realistic) changed value, produced a comparison you didn't compute by hand, and you can point at the line that says whether the move mattered.