<aside> 💡 This page gives you the five checks to run when your Claude Code agent reports a failed run, plus the prompt to build them.

</aside>

The five checks

Run these in order before you rerun anything. Together they stop an agent from redoing work it has already finished.

A pass proves the file exists. It still needs a review.

The prompt is in the last section. Paste it into ChatGPT (Codex) or Claude Code.

How to set it up

  1. Find where Claude Code saves its session transcript for each run, and make your script read the end of it when a run reports an error.
  2. Take the last assistant answer in that transcript and check that it was written during the current run, not an earlier one.
  3. Look for the output file on disk, such as the finished video, and mark the run as failed if the file is missing.
  4. Run your own checks on the file, such as no black ending frame, the keyword present and the guide present, using ffmpeg for the video checks.
  5. Count the retries for an empty reply and stop at 3.
  6. Send yourself a phone alert, for example through Telegram, when the cap is reached.
  7. Log each run saved by the transcript check, so you can see how often a reported failure was really finished.
  8. Keep a human review step, because a passing file is not proof the output is good.

<aside> ⚠️ Watch out: a pass only proves the file exists. It does not prove the video is good, so it still needs a review.

</aside>