Letter to Past Me: Three Mistakes That Cost a Day of Agent Runs
Description and use
An automation recipe that prevents wasted time when using an LLM agent by running each prompt in a disposable worktree, logging wall‑clock time, and stopping on empty diffs.
Problem
Repeated agent runs on a dirty working tree, unchecked token usage, and running loops on the same machine caused wasted time and lost work.
Outcome
The recipe reduces wasted agent iterations from a full day to a few minutes, ensures reproducibility, and keeps sensitive data local.
Workflow
- Create a disposable worktree per prompt using fresh.sh
- Point the agent to the new worktree and capture the diff before cleanup
- Remove the worktree after each run
- Run ledger.sh to log wall‑clock time, exit status, and diff lines for each iteration
- Use gate.sh to stop the loop when an iteration produces zero diff lines
- Review the ledger to decide when to stop the loop and merge changes
Evidence
The model was never the problem. My loop was.
The fix is a disposable worktree per prompt.
MonkeyCode is an open-source project that the operator describes as offering free model access and a free server option.
- Record date: 2026-09-20T03:15:26.427Z