Trace to file

Overview

A per-chat toggle (off by default) appends every new event for that chat to a project-relative NDJSON file. A one-shot "Export trace" action writes the same shape to a path the user picks without leaving the toggle on. The file is the user's source file — no rotation, no TTL, no auto-cleanup — and deleting either the trace or the chat leaves the other untouched.

Usage

NDJSON shape

One event per line, each with { ts, type, ...payload }:

typePayload
user messageThe message the user sent
assistant messageThe model's reply text
tool calltool_call — name and arguments
tool resulttool_result — the tool's output
system eventNon-message system events (e.g. authorization decisions)
errorFailed turns surfaced as errors

Behavior