export
kcap export <session> --format atif --output <new-file.json> [--scope tree|root] [--redact-values <file>]Writes a stored session as an ATIF-v1.7 trajectory, for Harbor or any other ATIF reader. The session is read through the server’s usual access checks, so you can export only what you can open. --format atif is the one format, and the output file must not already exist
| Option | Meaning |
|---|---|
--scope tree | The default: the session with its stored subagent streams embedded. A subagent stream that cannot be read fails the export |
--scope root | The parent stream only; the ids of the subagents left out are listed under extra.kcap |
--redact-values <file> | A UTF-8 file with one exact value per line, replaced wherever it appears in stored values and property names. Matching is literal and case-sensitive, not automatic detection of personal data. A replacement that makes two property names identical fails the export |
Secret redaction runs again on export. The file holds the stored text, not image attachments. Tool names, arguments and result text are left as the agent wrote them; extra.kcap adds what kcap stored beside them, such as a tool call’s kind, command, path and working directory and a result’s error flag or exit code, plus counts of the events that are not chat. Nothing is inferred: an unknown agent version or repository starting state is left out, and a session with missing tool calls fails to export