Feature request: option to export the entire session

Open 💬 9 comments Opened Mar 2, 2026 by abanoub-ashraf
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

the title sums it up, something like /export maybe

View original on GitHub ↗

9 Comments

etraut-openai contributor · 4 months ago

Can you provide more details about your intended use case?

abanoub-ashraf · 4 months ago

So, like sometimes I wanna export my entire chat with Codex to go continue somewhere else or validate something so I want something like /export that can give me the whole chat of the session as md file or pdf

phuturesh · 3 months ago

Rollouts in .codex/sessions/ may help. But I do think /export-ing a more portable rollout together with /imports can help us work better with teamates or on somewhere else.

MeXenon · 3 months ago

Hey @abanoub-ashraf and @phuturesh,

I was running into this exact same problem! I constantly needed to export clean, readable markdown versions of my Codex sessions to continue workflows or debug agent reasoning. Wading through the raw .jsonl payloads manually was driving me crazy.

@etraut-openai — to answer your question about the intended use cases, here is exactly why the community needs this feature: often we need to parse historical sessions and strip out the massive hidden IDE payloads, isolate terminal commands, or dynamically clip giant output blocks so they don't break our context window when passing the session into another model.

Since an official export command doesn't exist yet, I went ahead and built an open-source Terminal UI to solve this for us:

🚀 Codex Session Export

It natively reads your Codex session directory and gives you a fully interactive interface where you can:

  • Instantly export your entire session (or multiple parallel sessions) into a clean Markdown .md file.
  • Filter out the noise (it has a "Clean Chat" mode that automatically strips out the invisible IDE XML, system prompts, and open tab data).
  • Dynamically clamp huge terminal outputs so giant payloads don't distract from the actual code.

It's just a pure Python script with zero complex dependencies. I added a rapid one-liner shortcut in the repository's documentation so anyone can download and launch it instantly out of the box.

I built this specifically to handle these advanced daily use-cases. Let me know if it helps, and if you guys find it useful in your workflows, I'd really appreciate a ⭐️ on the repository!

GaoSSR · 2 months ago

Cross-linking from #17241 because my main target is the Codex CLI/TUI use case described here: exporting the entire current session with something like /export.

I prepared a reference branch that adds a built-in /export slash command in codex-rs/tui:

https://github.com/GaoSSR/codex/tree/feat/export-current-session-markdown

The implementation exports the current session as Markdown, based on the current rollout path tracked by the TUI. It includes visible user/assistant messages and intentionally excludes system/developer instructions, base instructions, reasoning, and tool events.

This is meant to address the “export my entire chat with Codex” workflow discussed in this issue. If this direction aligns with the intended solution, I’d be happy to submit a PR if the team would like to invite one.
@etraut-openai

linux-devil · 1 month ago

I need this especially while changing devices

MeXenon · 1 month ago
I need this especially while changing devices

Hi, you can check my project ( https://github.com/MeXenon/codex-session-export ) right now, this is the most advanced, powerful codex session export as markdown, if you find it useful, I would be happy if you leave a star :)

ahmojo · 1 month ago

Maintainer disclosure: I maintain an unofficial tool in this area. If the immediate need is local session export rather than a supported Codex feature, cct can export local Codex sessions into a .codexbundle, inspect/dry-run it, and import it into another local Codex home: https://github.com/ahmojo/codex-claude-transfer
. It works against local JSONL files only, and bundles can contain sensitive prompts/code/output, so they should be treated like private artifacts.

The Tool also works for Claude Code and it also Supports Exporting your Claude Sessions to Codex and also your Codex Sessions to Claude to some extend it was newly implemented because of that it maybe isn't perfect.

ahmojo · 1 month ago
I need this especially while changing devices

Hey you could checkout my project ( https://github.com/ahmojo/codex-claude-transfer ) it includes many other features rather than only exporting and importing your Codex Sessions it can also do the same for Claude Code sessions! Would be awesome if you could check it out and leave a start or review