Export chat session in the Codex Desktop App as a markdown file

Resolved 💬 5 comments Opened Apr 9, 2026 by anth0nycodes Closed Jul 6, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

I'm aware that for the Codex CLI, you can copy the chat session text with /copy then just convert that text into a markdown file, but is there any equivalent for the Codex Desktop App? I wasn't able to find a solution. Thanks!

View original on GitHub ↗

5 Comments

GaoSSR · 4 months ago

I looked into this and agree that a built-in Markdown export would be useful, especially for reviewing a session later, sharing context, or feeding the transcript back into an LLM to extract durable project guidance.

I also took a look at the current rollout/session structure. A small TUI-scoped implementation seems possible without changing the core protocol:

  • add a /export slash command
  • read the current session rollout path already tracked by the TUI
  • export only user-visible UserMessage and AgentMessage events
  • exclude system/developer instructions, base instructions, reasoning, and tool events
  • write Markdown to {CODEX_HOME}/exports/codex-session-<thread-id>.md
  • preserve Markdown readability, while wrapping messages that contain triple-backtick fences in a larger fence so the exported document remains valid

I prepared a reference branch here:
https://github.com/GaoSSR/codex/tree/feat/export-current-session-markdown

Local verification on that branch:

  • cargo fmt -- --config imports_granularity=Item --check
  • cargo test -p codex-tui session_export --lib
  • cargo test -p codex-tui slash_export_handles_missing_path --lib
  • cargo test -p codex-tui side_conversation_hides_commands_without_side_flag --lib
  • cargo clippy -p codex-tui --lib --tests -- -D warnings

Would this direction align with the intended solution for this issue? If so, I’d be happy to submit a PR if the team would like to invite one.

GaoSSR · 4 months ago

@etraut-openai

etraut-openai contributor · 4 months ago

@GaoSSR, this feature request is for the app, not the TUI.

GaoSSR · 4 months ago

https://github.com/openai/codex/issues/17241?issue=openai%7Ccodex%7C13267#event-24348658965 look this,thanks,for app,I make a skill:https://github.com/GaoSSR/codex-export-skill @etraut-openai

GaoSSR · 4 months ago

Thanks for clarifying. You're right, I misunderstood this issue's scope. My implementation targets the Codex CLI/TUI flow, so I'll keep the CLI-specific discussion in #13267. @etraut-openai