getbelay.dev

belay

Pre-alpha

Guides

Checked

belay on GitHub

How to see what Codex changed in your repo

/diff shows the git diff of the working tree. For each turn or each tool call, record the directory before and after: by hand, or from Codex’s hooks.

What Codex has

  • /diff: “show git diff (including untracked files)”. The end state only.
  • No undo: 0.172.0 has no undo or rewind command.
  • Transcripts under ~/.codex: commands and their output, not the files they changed.
  • The sandbox limits where Codex can write; it doesn’t report what it changed there.

Per turn, by hand

With the binary:

belay check --scope .             # before the turn; prints the checkpoint's id
belay diff --scope . --since ID   # after it, with that id

diff keeps its capture as a new checkpoint. For the next turn, take its id from belay log --scope . (the last line, kind diff) and pass it to --since.

Per tool call

Codex runs PreToolUse and PostToolUse hooks around shell commands, apply_patch and MCP tools. A hook can call belay watch step --scope . --session S --begin ID before a call and --finish ID after. The rerun recorded 135 Codex runs this way; the wrapper it used is published as it ran.

Calls that change nothing on disk, like the ChatGPT account tools Codex offered, show up in the transcript, not in belay’s record.

Sources

Checked 2026-11-28: Codex 0.172.0 slash_command.rs, Hooks, Sandboxing, Advanced configuration.