postrundocs Back to siteSign in
Browse docsTroubleshooting

Troubleshooting

Start with postrun doctor

postrun doctor

It checks everything below in a few seconds, without changing anything, and gives one fix for each problem. Most of this page explains what those checks mean. If you report a problem, send what postrun doctor prints, and the end of ~/.postrun/postrun.log if it asks for it.

Installing

npm says EBADPLATFORM

Postrun runs on macOS and Linux. Windows is not supported yet; on Windows, install it inside WSL.

Postrun needs Node 22.13 or newer

Postrun needs Node 22.13 or newer; this is Node 20.18.0.

Postrun uses the SQLite built into Node 22.13 and later, so it has nothing to compile. Install a newer Node from nodejs.org, or with nvm: nvm install 22. Then run postrun setup again.

If you switch Node versions with nvm, start at login keeps pointing at the old one. postrun doctor notices; run postrun autostart on to fix it.

Not recording

Postrun is not running

Postrun is not running, so nothing is being recorded. Start it with: postrun start

Run postrun start. Claude Code's hooks keep writing while Postrun is stopped, and on start it catches up on every session it missed. To have it start whenever you log in: postrun autostart on.

Postrun could not start

postrun start and postrun setup print the last lines of ~/.postrun/postrun.log when the background process does not come up. The usual cause:

could not start the review app: port 1234 is in use by another program

Run postrun setup: it moves to the next free port and remembers it. Or choose one with postrun setup --port 4321.

Telemetry receiver not running

warn  Telemetry receiver not running (port 4318 in use): cost and token counts are missing

Another program, often an OpenTelemetry collector, holds port 4318. Postrun keeps recording from hooks, so every prompt, command, edit and reply is still there. To get cost and token counts back, run postrun setup: it picks a free port and points Claude Code at it. Restart Claude Code afterwards.

Sessions do not appear

A Claude Code session is missing

Check these in order:

  1. Is Postrun running? postrun status.
  2. Was Claude Code restarted after setup? Claude Code reads settings.json only when it starts. Quit any session that was open during setup and start claude again.
  3. Has the session finished a turn? A Claude Code session is written at the end of each assistant turn and when it ends, after a 4 second pause. It does not appear while its first turn is still running.
  4. Is Claude Code still set up? postrun doctor checks the hooks in settings.json. If something removed them, run postrun setup.

A Claude Code session shows "cost not recorded"

The session was recorded from Claude Code's hooks alone, because no telemetry arrived for it. The log says, once per session:

claude-code <id>: recorded from hooks only (no OTel data: the receiver was not running, or this claude started before setup), so its cost and token counts are missing

Every prompt, command, edit, read and final reply is still there. Only cost, token counts and permission decisions need telemetry. It happens when Postrun was stopped, when Claude Code was started before setup, or when your Claude Code telemetry goes to another endpoint (setup leaves that alone, and postrun doctor says so).

Telemetry arrives in the wrong format

The log says:

telemetry: /v1/logs: got application/x-protobuf, expected application/json. Set OTEL_EXPORTER_OTLP_PROTOCOL=http/json before launching claude.

The receiver accepts OTLP over HTTP with JSON bodies only. Setup sets OTEL_EXPORTER_OTLP_PROTOCOL to http/json in settings.json, so something else, often a variable exported in your shell profile, is overriding it. Remove the override and restart Claude Code.

A Cline session is missing

  • Postrun reads Cline 4.1.x sessions from ~/.cline/data/sessions. The older VS Code task folders are not read.
  • A session caught mid-write is retried on its next change. The log says messages file not parseable yet (mid-write?); will retry on next change.

Claude Code setup

settings.json is not valid JSON

postrun setup: <path> is not valid JSON (<reason>); fix it by hand, nothing was changed

Fix the file by hand, then run postrun setup again. Setup also refuses to merge, and writes nothing, when env or hooks is not an object, or a hook event's value is not an array:

settings "env" is not an object; refusing to merge
settings hooks.Stop is not an array; refusing to merge

The hook script is missing or from another version

postrun doctor reports it; postrun setup puts the current script back in ~/.postrun/bin. The hooks in settings.json point there, so updating or moving Postrun does not break them. An older hook that pointed into a checkout of the repository is recognised as Postrun's and updated in place.

The review app

Connect this browser

The review app shows Connect this browser when the browser does not have this computer's key, so the local API refuses it. Run:

postrun open

It opens the app with the key, and that browser stays connected. Each browser (and each port, after postrun setup --port) connects once. If you replaced ~/.postrun/ingest-token, connect again.

No cost data for a session started before an update

Setup gives Claude Code a telemetry key, and Postrun adds it to older setups when it starts. A Claude Code session that was already open keeps its old settings, so its telemetry is dropped and it shows not recorded for cost. Every prompt, command and edit is still recorded. Restart that Claude Code session.

server offline

The card at the bottom of the sidebar says Not running, or the list shows Could not load sessions. Postrun is not running: postrun start. The page catches up on its own when it is back.

misdirected request (421)

misdirected request: this server only answers to 127.0.0.1 or localhost

The request's Host header was not 127.0.0.1, localhost or [::1]. This guard stops DNS rebinding attacks. It also blocks custom hostnames, /etc/hosts aliases, and tunnels or proxies that pass their own hostname. Open http://127.0.0.1:1234/ or http://localhost:1234/ directly. The telemetry receiver applies the same rule.

too many live connections

GET /api/events returns 503 with {"error":"too many live connections"} when 32 streams are already open. Close some review app tabs or other stream clients.

Ingest API errors

StatusMessageFix
401missing or invalid bearer token (see ~/.postrun/ingest-token)Send authorization: Bearer <token> with the current contents of the token file. If the file was deleted or replaced, Postrun keeps the token it loaded at start: postrun restart.
410session ... was deleted; it is not recorded againThe session was deleted in Postrun. Push it under a new id if you need it again.
413body larger than 8388608 bytesSplit the session into several smaller batches. The 8 MB limit also applies after gzip decompression.
413too many steps in one batch: ...At most 5000 items of each kind per batch. Split it.
415content-type must be application/json, got ...Send content-type: application/json.
415unsupported content-encoding ...; use gzip or noneSend gzip, or no content-encoding.
409step seq already taken in this sessionA different step id is already stored with that seq. Give each step a unique seq, and reuse the same id when re-sending a step.
400invalid batchRead details: each entry has a path into your body and a message. Common causes: a timestamp without a timezone, null for an optional field, an unknown field, or a value outside a closed enum.
400batch references unknown or mismatched recordsA turn or step names a segment, actor or turn that is neither in the batch nor already stored, or its session_id does not match session.id. Send parents before or with their children.
405method not allowedUse POST.

If the token file was edited or truncated, Postrun refuses it. Delete ~/.postrun/ingest-token and run postrun restart to create a new one, then update any adapter that reads the old token.

Export

file exists

<path> exists; add --force to overwrite it

Add --force, or choose another name with -o.

no session

No session <id>. List them with: postrun sessions

Check the id with postrun sessions.

Unknown command "login"

Your Postrun is older than 0.2.0. Update with npm install -g postrun@latest, then run postrun setup.

This computer isn't signed in

This computer isn't signed in to Postrun, or its sign-in was removed. Run: postrun login

Run postrun login. You also see this after signing the computer out in Settings at app.postrun.app, or after deleting your account.

postrun login waits 10 minutes for you to click Connect, and only accepts the browser tab it opened. Run postrun login again and use the new tab.

Email links work once and expire after 10 minutes. Some work email systems open links to scan them; the link opens a page with a Sign in button for that reason, so scanning alone doesn't use it up. Send yourself a new link.

Too many sign-in emails

At most 5 sign-in emails go to one address in an hour. Wait, then try again, or use GitHub.

You can make 30 links an hour and keep 200 live at once. Turn off links you no longer need at app.postrun.app.

Only reports made by Postrun can be shared

app.postrun.app only hosts reports Postrun's exporter made. Share with postrun share or the Share link button rather than uploading a file yourself.

Removing Postrun

postrun uninstall takes Postrun out of Claude Code and stops it. If you already ran npm uninstall -g postrun without it, Claude Code still calls the hook script in ~/.postrun/bin, which keeps writing to ~/.postrun/captures but nothing reads it. Install Postrun again and run postrun uninstall, or remove the hooks whose command ends in .postrun/bin/capture-hook.sh from ~/.claude/settings.json by hand.