How to delete TRAE CLI sessions, and what you lose
they are rollout files under ~/.trae/cli/sessions, one per session, and prompt history is a separate file beside them
TRAE CLI writes each session to disk as it runs. 2.0 ships as traex and is a closed-source fork of codex-rs, so the files are Codex rollouts under TRAE's own home instead of ~/.codex. The store is ${TRAE_HOME:-~/.trae}/cli, and there are two separate things in it: the rollouts, which are the conversations, and history.jsonl, which is your prompts. Deleting one does not touch the other.
How to delete TRAE CLI sessions
traex resume <id> lists and reopens sessions, and traex archive <id> hides one without deleting it — the rollout moves to archived_sessions/ and stays on disk. Beyond that the sessions are files. The path is dated, so a day of work is a directory, and a rollout that has been compressed ends in .jsonl.zst, which a pattern ending in .jsonl does not match.
# what is there, newest first ls -t ~/.trae/cli/sessions/*/*/*/rollout-*.jsonl* | head # one session — the id is what traex resume takes rm ~/.trae/cli/sessions/2026/10/17/rollout-*<id>.jsonl* # one day rm -rf ~/.trae/cli/sessions/2026/10/17 # every session, including the ones traex archived rm -rf ~/.trae/cli/sessions ~/.trae/cli/archived_sessions # your prompts, which the lines above do not touch rm ~/.trae/cli/history.jsonl
If TRAECLI_HOME is set it moves the whole cli directory, and TRAE_HOME moves the home above it; all of the above moves with either.
What is in a rollout
JSON Lines, appended as the session runs. The first record is session_meta and carries the session id and the working directory; the rest are Codex's own events — turn_context, response_item, event_msg — plus TRAE's history_mutation records for tool calls, which Codex does not write. Because the file is appended to while the session is live, the last line of an interrupted session can be torn — a reader has to tolerate that, and rm does not care either way.
It is plain text and it is verbatim: whatever a command printed into the conversation is in the file. Treat the directory the way you treat your shell history. The format registry documents every field.
An archived session is not deleted
traex archive <id> moves one rollout into archived_sessions/ beside sessions/; the bytes are all still there, and so is the prompt in history.jsonl. Nothing leaves the disk until someone runs rm, which is why the commands above name the archive directory as well when they mean “everything”.
What you lose
The rollouts are what any later search over your own work reads — including traex resume, which lists what is on disk. Delete them and the record of what the agent ran goes with them: the commands, their output, and the edits, none of which are recoverable from a summary.
deja reads these files with the Codex reader and files them under trae, so a decision made in TRAE answers a question asked in Claude Code or Cursor. A session it has already indexed stays searchable after the file goes; only deja forget drops one on purpose. In the screen bare deja opens, a deleted session sits under the Deleted tab — but TRAE is one of the agents deja does not write a rollout back for, because TRAE CLI records turns its own way since 0.208 and no rebuilt rollout has been checked against it yet. That is a reason to index before deleting, not a reason to keep gigabytes.
The same question for Codex · Where every agent stores history · The same question for Claude Code · The TRAE CLI format registry
Found this useful? Star deja-vu on GitHub.