# Show HN: Belay – deterministic semantic diffs of what a coding agent changed

> Source: <https://github.com/Allexsen/belay>
> Published: 2026-11-25 12:54:02+00:00

**Key takeaway:** Belay v0.1.0-alpha.11 records directory checkpoints and emits semantic diffs of agent changes across pip, dpkg, git refs and reflogs up to 16 MiB, plus system files like passwd, sudoers, cron and systemd units, without modifying the files it inspects.

**Intent:** record what changed on a system, explain it in semantic terms rather than as a path
list, and make it reversible.

**Status: pre-alpha.** The checkpoint and diff engine runs (below); the formats it writes are drafts
that may still change, and the latest pre-release is v0.1.0-alpha.11. Nothing that changes your files
exists yet.

Tested against 2,115 published agent runs: [results](https://github.com/Allexsen/belay/blob/main/bench/replay/RESULTS.md).

**Pre-alpha. The most useful contribution right now is real-world
use.** Run belay around something you actually do (an agent session,
a build, an install) and compare its report with what really
happened. If it missed a change, invented one, or buried the real
change in noise, open an issue with the receipt. That's the data
I need the most.

- `belay check` ,`mark` ,`diff` and`log` (see[docs/cli.md](https://github.com/Allexsen/belay/blob/main/docs/cli.md) ): record a directory as a
checkpoint, record what changed since the last one, show the difference, list checkpoints. They
need no privileges and only read the directory they are given; belay writes only under its own
state directory.
- Interpreters that explain changes to pip installs, dpkg's package database, git refs, hooks,
reflogs (kept and read in full up to 16 MiB each) and small text files
([docs/spec/diff-v1.md](https://github.com/Allexsen/belay/blob/main/docs/spec/diff-v1.md) ). Added recently: users and groups
(`etc/passwd` ,`etc/group` ), sudoers, cron, systemd units and timers, ssh`authorized_keys` , the
trust store (`etc/ssl/certs` ), and the keys of nginx, sshd and ini-style configuration files
([docs/cli.md](https://github.com/Allexsen/belay/blob/main/docs/cli.md#--system-a-whole-machine-by-its-roots) ). They recognise the files by
their paths, in any scope;`--system` is what reads them on a whole machine.
- `belay baseline export` and`belay verify` : a checkpoint kept as a bundle, and a directory compared
with it and judged against a protect spec.
- `--docker` : a container's layers read from the host.
- `belay watch` : a running record of a directory while an agent works in it, one line a step, with
anything in a sensitive place first ([docs/cli.md](https://github.com/Allexsen/belay/blob/main/docs/cli.md#watch-a-running-record-of-a-directory) ,
pinned in[test/expect/watch-v1.md](https://github.com/Allexsen/belay/blob/main/test/expect/watch-v1.md) ); and a[Claude Code plugin](https://github.com/Allexsen/belay/blob/main/claude-plugin/README.md) around it.
- `belay watch --system` ,**experimental** : the same running record for a whole machine's`/` ,
read by a list of roots.`watch start --system` takes the first capture,`watch step --system` prints a step's line, and`watch receipt --system` and`watch stop --system` print the receipt in
sections (installed, services, user, cron, sudo, ...). It is new, slow on large machines, and its
output may change ([docs/cli.md](https://github.com/Allexsen/belay/blob/main/docs/cli.md#watch---system) , pinned in[test/expect/watch-system.md](https://github.com/Allexsen/belay/blob/main/test/expect/watch-system.md) ).
- pybelay, Python bindings around the binary, with a reward helper and an
[Inspect integration](https://github.com/Allexsen/belay/blob/main/python/README.md#using-belay-with-inspect) . The integration runs belay inside
the sample's sandbox, or with`where="host"` on the eval's machine, reading the sample's Docker
container from outside; that mode needs root for belay.
- The manifest format, version 5 ([test/expect/manifest-v5.md](https://github.com/Allexsen/belay/blob/main/test/expect/manifest-v5.md) , built on[version 4](https://github.com/Allexsen/belay/blob/main/test/expect/manifest-v4.md) ,[version 2](https://github.com/Allexsen/belay/blob/main/docs/spec/manifest-v2.md) and[version 1](https://github.com/Allexsen/belay/blob/main/docs/spec/manifest-v1.md) ; belay still reads versions 1 to 4) and the diff format
(diff.v1, a draft).
- Tests on Linux (x86_64, arm64), on macOS 15 or later (Apple silicon), and inside a Docker container as an unprivileged user, in CI on every change.

No `commit`, `discard`, restore or undo: belay records and explains, and changes nothing. The
session engine under `src/session/` (namespaces and overlays) is not part of the `belay` binary.
No stable release.

Today belay only records and reports; it contains nothing. The session engine, when it ships, is
meant as a **safety** boundary, not a **security** boundary — built for accidents, not for hostile
code; it will not contain a process that is actively trying to escape. See [SECURITY.md](https://github.com/Allexsen/belay/blob/main/SECURITY.md).

What a checkpoint does not see: anything outside the scope, anything below a mount point inside it,
belay's own state directory and the paths you exclude (left out, and named in every manifest), and
network effects (pushes, API calls, emails).
On filesystems with coarse timestamps some same-size rewrites can be missed; the limits are in
[docs/spec/manifest-v1.md](https://github.com/Allexsen/belay/blob/main/docs/spec/manifest-v1.md). A file being written while it is read is
marked and reported unknown where the kernel can say so, and counted where it can't
([docs/cli.md](https://github.com/Allexsen/belay/blob/main/docs/cli.md#a-file-being-written-while-it-is-read)).

```
make check
```

`make` needs a C11 compiler and GNU make, on Linux or macOS; `make check` also needs python3. The
binary is `bin/belay`.

Sign-off required (`git commit -s`), no CLA. See [CONTRIBUTING.md](https://github.com/Allexsen/belay/blob/main/CONTRIBUTING.md).

Apache-2.0. **The core stays Apache-2.0, permanently.** If paid offerings ever exist they will be
separate products — never features removed from or withheld by this repository.
