Review JSON from AI agents before it lands
Coding agents write config files, fixtures and API payloads in seconds. Here's how to check that JSON in Pandia before it reaches your project, with the agent waiting for your answer.
An agent that writes JSON is fast and usually right. When it's wrong, the mistake is small and easy to miss: a number written as a string, a key that doesn't exist, a field from last year's API. Reading 400 lines of JSON in a chat window is not a review. You want the data in a proper viewer, checked against a schema, and a way to fix it before the agent moves on.
The pandia command does that. The agent hands the JSON to Pandia and waits. You read it in the
Tree, Grid or Code view, fix what's wrong, and press Save. The agent gets your corrected JSON back. Nothing
leaves your machine.
Set up the command
- Download Pandia and open it.
- Open Settings → Behavior → terminal command and click Install pandia command.
- In a new terminal, run
pandia --helpto check it works.
The agent runs commands in your terminal, so once pandia works there, it works for the agent.
See the command-line docs for every option.
1. Review JSON before it's written
Ask the agent to pipe its draft into Pandia instead of writing the file directly:
cat draft.json | pandia --wait - > config.next.json && mv config.next.json config.json Pandia opens the draft in a tab named stdin, with a bar saying a terminal is waiting.
Edit anything you like, press Save (⌘S) to send it back, then close the tab. The
command prints the JSON you saved, and mv puts it in place.
If you close the tab without saving, nothing is sent back and the command exits with code 3, so
&& stops before mv. That's why the command writes to config.next.json
first: > empties its target as soon as the command starts, so redirecting straight into
config.json would leave it blank.
2. Check it against a schema
If the file has a JSON Schema, add --schema. The Schema panel shows every error while you
review, and the exit code tells the agent whether the result passed:
cat draft.json | pandia --wait - --schema config.schema.json \
> config.next.json && mv config.next.json config.json A document with a top-level $schema loads its schema on its own; --schema wins
when both are present. Exit codes with --wait:
| Code | Meaning |
|---|---|
| 0 | You closed the tabs and the Schema panel showed no errors. |
| 1 | The Schema panel showed errors, a file didn't open, or Pandia quit before you closed the tabs. |
| 2 | The command was mistyped. |
| 3 | Piped input was closed without saving, so nothing was sent back. |
3. Let the agent read the result
Add --json and the command prints one JSON report when you close the tabs, instead of the
document. The agent can read it, fix each error and ask you again:
pandia --wait --json config.json --schema config.schema.json {
"exitCode": 1,
"files": [
{
"path": "/work/config.json",
"opened": true,
"saved": true,
"valid": false,
"errorCount": 1,
"errors": [{ "pointer": "/retries", "message": "\"3\" is not of type \"integer\"" }],
"problem": null
}
]
} Each error names its location as a JSON Pointer, so /retries tells the agent exactly which
value to change. valid is null when no schema ran, and problem says
why a file didn't open.
4. Review changes to an existing file
When the agent edits a file you already have, ask it to write the new version next to the old one and open both in Compare:
pandia --wait --diff config.json config.new.json Compare matches the two documents by structure, not by line. Keys in a different order are not a change, and an array item that moved shows as one move, not as hundreds of changed lines. Close the tab when you're done, and tell the agent whether to keep the new version.
5. Work with files too big for the agent
A multi-gigabyte log export or API dump doesn't fit in an agent's context. Pandia opens it instantly, so you can do the looking:
- Open it with
pandia events.json. - Find what matters in the Tree, or filter the array in the Grid.
- Right-click a value and choose Copy → Path for its exact location, such as
$.items[3].status, or Copy → Value for its JSON. - Paste just that into the agent instead of the whole file.
Tell your agent to do this every time
Most agents read a project instructions file, such as AGENTS.md or CLAUDE.md. Add
a short note there so the agent asks for review on its own:
## JSON review
Before writing a JSON file, hand it to me in Pandia:
cat draft.json | pandia --wait - > draft.reviewed.json && mv draft.reviewed.json <target>
The command waits until I close the tab. Exit 3 means I closed it without
saving: stop and ask me what to change. If a schema exists, add --schema <path>. The command waits until you close the tab, which can take minutes. If your agent stops commands that run long, raise its time limit for this one.
Chat review or Pandia review
| Task | Reading it in the chat | Reviewing in Pandia |
|---|---|---|
| Spot a wrong type or missing field | By eye | Schema panel lists each one |
| Fix a value before it's written | Ask the agent again | Edit it and press Save |
| See what changed in an existing file | A text diff | A structural Compare |
| Files over a few MB | Too big to paste | Opens any size |
| Data stays on your machine | Depends on the agent | Yes |
Frequently asked questions
Does my JSON leave my machine?
No. Pandia runs locally and opens what the agent pipes in from a temporary file that only your user account can read. The file is deleted when you close the tab.
Which AI agents does this work with?
Any agent that can run a shell command: Claude Code, Cursor, Codex CLI, Aider and others. They all call the same pandia command.
What happens if I close the tab without saving?
Nothing is sent back. The command prints nothing and exits with code 3, so a script or agent that checks the exit code stops instead of writing an empty file.
Can the agent fix schema errors on its own?
Yes. With --json, the command prints a report that lists each schema error with a JSON Pointer to the bad value, which the agent can read, fix and run again.