quiet robot

Recipe: Try boldly, rewind if it breaks

An agent tries a bold change on a saved checkpoint. If the tests break, the files go back to the checkpoint and it tries another way. What it does, when to use it, how to make it yours, and what a run costs.

View as Markdown

Saves a checkpoint, then lets an agent try a bold restructuring. If the tests break, the files go back to the checkpoint and the agent tries another way, told what went wrong. If a limit stops the run, the sandbox rewinds to the checkpoint too, so a failed exploration never leaves a mess.

At a glanceNotes
LevelAdvanced
CategorySafety
ShapeCheckpoint, try, rewind on failure, retry
PlanFree and up
Needs a Claude keyYes
Limits it comes with3 loops, 900 seconds, $0.90
Try boldly, rewind if it breaks, as it is on the canvas.Save a checkpoint (Run command), Agent tries a bold fix (Agent), Do the tests pass? (Decide), Rewind to the checkpoint (Run command), Keep the change? (Approval), Commit it (Run command), Rewind and stop (Run command). Arrows: Save a checkpoint to Agent tries a bold fix; Agent tries a bold fix to Do the tests pass? on Done; Do the tests pass? to Rewind to the checkpoint on No; Rewind to the checkpoint to Agent tries a bold fix; Do the tests pass? to Keep the change? on Yes; Keep the change? to Commit it on Approved; Keep the change? to Rewind and stop on Denied.DoneNoYesApprovedDenied>_ RUN COMMANDSave a checkpoint◉ AGENTAgent tries a bold fix◆ DECIDEDo the tests pass?>_ RUN COMMANDRewind to the checkpoint✋ APPROVALKeep the change?>_ RUN COMMANDCommit it>_ RUN COMMANDRewind and stop
Try boldly, rewind if it breaks, as it is on the canvas.
Try it nowSimulateRun

Opens it in the Playground as a flow of your own. Simulate shows what a run costs. Run asks before it starts.

The steps

StepBlockWhat it does
Save a checkpointRun commandWrites the shopping-cart module and its tests, and commits them as the checkpoint.
Agent tries a bold fixAgentAn agent restructures the module, told which try this is and what the last check said.
Do the tests pass?DecideRuns the tests.
Rewind to the checkpointRun commandPuts every file back as it was at the checkpoint, then goes back to the agent.
Keep the change?ApprovalA person reads the change, then approves to keep it.
Commit itRun commandCommits the change.
Rewind and stopRun commandPuts the files back and stops. Nothing is kept.

When to use it

  • An agent should try something risky, like a refactor or a migration, without leaving a half-done change behind.
  • You want each retry to start from a clean state, not from the last broken try.
  • You want the run to clean up after itself when it hits a limit.

Run it

The quick way: choose Try it now under the drawing. It opens the recipe in the Playground as a flow of your own, after you sign in if you aren't yet. Simulate opens it and shows the forecast, and Run opens it and asks before it starts, with what the run will likely cost. From the dashboard instead:

  1. In the dashboard sidebar, open Agent Playground → Recipes and find Try boldly, rewind if it breaks. Choose Advanced to filter the list. In the builder, Recipes in the toolbar lists them too.
  2. Choose Use this recipe. It becomes a flow of your own, so changing it never changes the recipe.
  3. If you haven't yet, save your Claude key on the Secrets page. The builder offers Add a key… in the step's key list if it's missing.
  4. Choose Simulate to see the forecast, then Run.
  5. When the run waits for a person, approve or deny it from the banner, from Approvals, or from the approval email.

What you'll see: If the first try breaks the tests, Rewind to the checkpoint runs and the agent's second try starts from clean files. Once the tests pass, the run waits for a person at Keep the change?.

Make it yours

  1. Clone your repository in Save a checkpoint; the step commits the starting point.
  2. Change the agent's goal to the change you want explored, and the test command in Do the tests pass?.
  3. For changes outside git, like a database, take a sandbox snapshot instead and restore it in the rewind step. If stopped, go back to under the flow's limits rewinds the whole sandbox when a limit stops the run.

What a run costs

These are the builder's own forecast for the recipe as it comes, with its limits, rounded. Simulate shows the same numbers for your version, and they change as you change the flow.

NotesTypical1 in 10 runsAt most
Sandbox time$0.003$0.005$0.01
Claude, on your key$0.13$0.30the run's spend limit
How long it takesabout 4 minutesabout 7 minutes900 seconds

A typical run uses $0.003 of sandbox time, so about 300 runs cost $1, and every plan includes $5 of usage a month. The time includes a person taking a minute or two to answer the approval. The clock, and the sandbox, keep running while the run waits. Claude is billed by Anthropic to your own key, at their usual prices. The run counts it toward its spend limit, so it can't overspend, but we don't charge you for it. At most is the most a run could cost with these limits: it stops at $0.90 or 900 seconds, whichever comes first.

  • Agent PlaygroundQuickstart: build and run your first flow
  • Agent PlaygroundBlocks
  • Agent PlaygroundRecipes
  • SandboxesQuickstart: your first sandbox
  • SandboxesMCP server
  • SandboxesAPI reference
  • InsightsAll posts