# Diffing saved JSONL batches of AI outputs locally by ID

> Source: <https://dev.to/mrfrost1110/diffing-saved-jsonl-batches-of-ai-outputs-locally-by-id-1g77>
> Published: 2026-12-06 09:36:11+00:00

**Key takeaway:** Diffing two saved JSONL output batches by id locally catches semantic changes like a priority flipping from high to low that JSON schema validation passes, without re-running the model.

When you change a prompt or swap a model, JSON schema validation checks whether the output shape is valid, but a ticket changing from `high` priority to `low` still passes the schema.

Eval runners like [Promptfoo](https://www.promptfoo.dev/docs/guides/evaluate-json/) handle end-to-end runs well, and [Ajv](https://github.com/ajv-validator/ajv) handles schema checks. I needed something smaller: I already had two exported JSONL files (`baseline.jsonl` and `candidate.jsonl`) on disk and wanted to diff them by `id` locally without calling the model again.

I wrote a small Rust CLI for this called [batchdiff](https://github.com/mrfrost1110/batchdiff).

`fixtures/baseline.jsonl`:

```
{"id":"T-01","priority":"high"}
{"id":"T-02","priority":"low"}
```

`fixtures/candidate.jsonl`:

```
{"id":"T-01","priority":"low"}
{"id":"T-02","priority":"low"}
{"id":"T-03","priority":"medium"}
```

Run it against the included fixtures:

```
git clone https://github.com/mrfrost1110/batchdiff.git
cd batchdiff
cargo run -- fixtures/baseline.jsonl fixtures/candidate.jsonl
```

Output:

```
T-01 | /priority | high → low | changed
T-02 | unchanged
T-03 | /priority | medium | added
Summary | 1 changed, 1 unchanged, 1 added
```

If you want the binary on your `PATH`, you can also install it directly:

```
cargo install --git https://github.com/mrfrost1110/batchdiff
batchdiff baseline.jsonl candidate.jsonl
```

`id` fields, or scoped with `--field <path>`
`--ignore <path>` (for example `--ignore meta/latency_ms`)`--format markdown` for pull requests`2` and line numbers on malformed JSON, missing or blank Everything runs locally with no network calls.

Repo: [https://github.com/mrfrost1110/batchdiff](https://github.com/mrfrost1110/batchdiff)

If you save LLM extraction outputs to JSONL before shipping prompt changes, how are you diffing them today, and what breaks most often in your workflow?
