The take file
A take is a JSON Lines file, one record per line:
- a header with the format version, the test ID, when it was recorded and the version of Retake that recorded it (takes recorded before Retake wrote its version lack it);
- for each exchange, a request record (method, path, allow-listed headers, JSON body)
and a response record (status, allow-listed headers, body). A streamed response
has no body: it is followed by one event record per server-sent event (event
name,
id, data, and a millisecond offset) and a stream_end record saying how the stream ended; - a resource record after an exchange that created or deleted an uploaded file or a message batch (see Server-side resources);
- a footer with the wrapped command’s exit code. A take without a footer is incomplete, and replay refuses it.
Content stored with --allow-unscanned lives in blob files next to the takes, in
_blobs/ (see Blobs), so a take that uses them is no longer a single file.
Secrets in any record are replaced by placeholders such as
<redacted:anthropic-api-key:1> (see Redaction). Nothing else is recorded
about the machine, the user, the repository or the SDK; the models are in the request and
response bodies.
Every record is described by the JSON Schema
schema/take-v1.schema.json; the rules across lines (header
first, footer last, consistent exchange numbers) are in schema/README.md.
Abridged, from examples/refund/_main.take:
{"type":"header","format":1,"test_id":"_main","recorded_at":"2026-12-04T16:08:38.386Z"}
{"type":"request","exchange":0,"provider":"anthropic","method":"POST","path":"/v1/messages","headers":[["anthropic-version","2026-10-21"],["content-type","application/json"],["accept","*/*"]],"body":{"max_tokens":1024,"messages":[...],"model":"claude-haiku-5-5","tools":[...]}}
{"type":"response","exchange":0,"status":200,"headers":[["content-type","application/json"],["request-id","req_..."]],"body":{...}}
...
{"type":"footer","run_exit":0}