---
title: "Every run should leave a receipt"
description: "When agents work in multi-step workflows, “it worked” isn’t enough. What a run record should contain, and how PaneScale’s workflow runs provide it."
url: "https://panescale.com/blog/every-run-leaves-a-receipt"
published: "2026-10-10"
updated: "2026-10-29"
category: "Practice"
---

# Every run should leave a receipt

When agents work in multi-step workflows, “it worked” isn’t enough. What a run record should contain, and how PaneScale’s workflow runs provide it.

A workflow that runs an agent, then your tests, then a browser check, then waits for your approval is a small pipeline. Pipelines fail in interesting ways: a step times out, an output is malformed, a condition skips something you expected to run. When that happens a week later, you want to know exactly what happened — not reconstruct it from memory.

That is what a receipt is for.

## Why agents need receipts more than scripts do

A shell script that ran yesterday will do the same thing today, given the same inputs. An agent step won’t: the model may choose a different approach, read different files, or phrase its output differently. That non-determinism is part of what makes agents useful — and it means that “what happened” can’t be reconstructed by running the workflow again. The only reliable record is the one written while it ran.

Anthropic’s guidance on building agents makes a related point: agents work best when they get ground truth from the environment at every step — tool results, test output — rather than relying on their own account. A receipt is that ground truth, kept.

## What belongs in a receipt

### The inputs

The brief, the version of the workflow, the trigger that started it — manual, interval or a new commit — and the commit it ran on.

### Every step, in order

For each step: what it received, what it produced, how long it took, how many tokens it used if it reported them, and whether it passed, failed, was skipped by a condition or was stopped.

### Evidence of change

Agent steps that may edit files should leave **Git evidence**: what the working tree looked like before and after the step. That turns “the agent updated the docs” into a list of files with line counts.

### The decisions

Approval steps record who approved and when — or that the run was rejected.

### An explanation when it fails

When a step fails, the receipt should say where and why in plain language, not just exit code 1.

## A receipt, read

Here is the shape of a receipt for a “review release” workflow — build and browser check in parallel, then a Git review, then a go/no-go report — that failed:

| Step | Result | Time | Note |
| --- | --- | --- | --- |
| Brief | — | — | Release 2.4, commit `a1b2c3d`, started by hand |
| Build | passed | 1 min 12 s | `npm run build`, exit 0 |
| Browser check | failed | 38 s | Checkout page: button “Pay now” not found |
| Git review | skipped | — | Condition “build and browser passed” not met |
| Go/no-go report | stopped | — | Waiting on skipped step |

Reading it takes ten seconds: the build is fine, the browser check failed on one page, and everything after it correctly didn’t run. Without the receipt, the same information is scattered over three terminal scrollbacks — if they still exist.

## How PaneScale does it

Workflow runs in PaneScale keep all of the above automatically:

- a **step log** with inputs, outputs, durations and tokens,
- **Git evidence** for agent steps,
- a **failure analysis** that points at the step and the cause,
- an exportable **receipt** of the whole run.

Because every number comes from what PaneScale recorded, the receipt is the same whether the run succeeded or not, and whether anyone was watching. When a step fails, **Retry unfinished steps** runs the rest again without repeating what already passed.

## Design steps that leave good receipts

The receipt can only be as clear as the workflow. A few habits make both better:

- **Name results.** Save a step’s result under a name and refer to it later as `{{key}}`. “Cause: {{cause}}” in a later instruction is easier to follow in a receipt than an unnamed blob of text.
- **Ask for JSON where the next step parses it.** A step whose result format is JSON can be validated; a malformed answer fails *that* step, with a clear reason, instead of confusing the next one.
- **Use conditions on purpose.** “Only open a draft if the tests passed” is a condition worth writing down. A skipped step with a stated reason is a feature of the receipt, not a gap in it.
- **Set timeouts.** A step that can hang should have a limit, so the receipt says *timed out after 10 minutes* instead of ending in silence.
- **Put an approval before anything irreversible.** With an automatic trigger, agent steps change files on every run, without you watching. An approval step makes the receipt show exactly where a person said yes.

## Use receipts to improve workflows

Receipts aren’t only for incidents. Every few weeks, look at the last ten runs of a workflow:

- Which step fails most often? Usually it needs a clearer instruction or a better check.
- Which step takes longest? Maybe it can run in a parallel group.
- Which outputs feed the next step badly? Ask for JSON and turn on the JSON check.

A workflow you can inspect is a workflow you can improve. See [Workflows](https://panescale.com/docs/workflows) for the details.

## Questions about receipts

### Do receipts contain my code?

A receipt records what the steps received and produced and what changed in the project — file names and line counts for agent steps. Keep it where you would keep any other build record, and review it before sharing it outside your team.

### Can I compare two runs?

Yes — that is one of the best uses of a receipt. Two runs of the same workflow on different commits, side by side, show which step changed its result and how long each took. A step that suddenly takes three times as long is often the first sign of a problem in the code it checks.

### What if a step doesn’t report tokens?

Then the receipt says so. A command step uses no model tokens at all, and CLIs that don’t report usage are shown as not reported rather than estimated — the same rule as everywhere in PaneScale.

## Sources

- [Building effective agents](https://www.anthropic.com/research/building-effective-agents) — Anthropic on ground truth from the environment and workflow patterns such as chaining and parallelization
- [JSON Schema](https://json-schema.org/) — the standard for validating structured step outputs
- [Visibility of system status](https://www.nngroup.com/articles/visibility-system-status/) — Nielsen Norman Group on keeping people informed about what a system did
- [Measured, not estimated](https://panescale.com/blog/measured-not-estimated) — why token numbers in a receipt are never guessed
