Copy/Export Message as Markdown

Open 💬 25 comments Opened Aug 29, 2025 by 0xdevalias
💡 Likely answer: A maintainer (vjain419, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

It would be useful to be able to copy/export messages as markdown sometimes, to add to external documentation / GitHub issues / etc.

Currently the main options/workarounds we seem to have are to:

  • Copy the terminal output as plaintext
  • Manually extract it from the session log (eg. ~/.codex/sessions/2025/08/29/rollout-2025-08-29T14-50-52-620223ff-1234-12ab-1234-1234567890ab.jsonl)
  • Programmatically extract it from the session log, eg:
  • ```shell

⇒ SESSION_LOG=~/.codex/sessions/2025/08/29/rollout-2025-08-29T14-50-52-620223ff-1234-12ab-1234-1234567890ab.jsonl; tail -n 1 "$SESSION_LOG" | jq -r '.content[0].text' | subl
```

Off the top of my head, this might make sense to have as part of the Ctrl+T transcript viewer, since I believe it already has the ability to select older messages.

Are you interested in implementing this feature?

Unfortunately I don't have the capacity nor familiarity with rust to do so at the moment.

Additional information

See Also

View original on GitHub ↗

25 Comments

dlukt · 10 months ago

You can tell it to do that, e.g. keep a summary of changes in a separate directory per change, auto commit and push and close corresponding issues etc. Also add comments to issues etc. It does it very well

My "question" was:

I wish you could save the summary (or after task complete report, what I see you respond here explaining what you've done) of what you'd done in a special directory "changes" with a dedicated file per summary.
0xdevalias · 10 months ago
You can tell it to do that

@dlukt Sure; but my need is not a systemic 'keep a running log of things' so much as it is a "oh, that is useful and I want to go and manually keep that fragment somewhere for future reference"; and it feels somewhat inefficient to burn tokens/LLM inference cycles on that when a comparatively 'cheap' / efficient 'copy as markdown' could be implemented in the TUI / similar.

udaykumar1997 · 10 months ago

Thanks for opening this — I’d love to see an “export transcript” option. Being able to quickly save sessions as Markdown or plain text (or download JSONL) would make it much easier to share examples, create docs, and debug with teammates.

0xdevalias · 9 months ago
I’d love to see an “export transcript” option. Being able to quickly save sessions as Markdown or plain text (or download JSONL) would make it much easier to share examples, create docs, and debug with teammates.

@udaykumar1997 While I agree that something built in for that sort of thing could be a better UX; we can achieve a fair bit of those features currently by finding the appropriate .jsonl file and then processing it with jq or similar.

---

I've got some tooling that I was iterating on the other week for this, but haven't yet actually finalised and committed it to my dotfiles:

⇒ codex-chat --help
usage: codex-chat [-h] [--list [COUNT]] [--latest] [--search SEARCH]
                  [--prompt-count PROMPT_COUNT] [--include-empty]
                  [--view {messages,transcript}] [--transcript] [--show-noise] [--no-pager]
                  [--utc] [--color {auto,always,never}] [--no-color] [--root ROOT]
                  [session]

List and view Codex session transcripts.

Positional Arguments:
  session               Index, substring, or path to open.

Optional Arguments:
  -h, --help            show this help message and exit

  Session Selection:
    --list [COUNT]        List recent sessions and exit (default COUNT=15; use 0 for all).
    --latest              Open the most recent session.
    --search SEARCH       Only include sessions whose contents match this ripgrep pattern.
    --prompt-count PROMPT_COUNT
                          Number of recent sessions to show when prompting interactively
                          (default: all).
    --include-empty       Include setup-only sessions in listings and pickers.

  Viewing Options:
    --view {messages,transcript}
                          Interactive view mode (default: per-message browser).
    --transcript          Alias for --view transcript.
    --show-noise          Include system instruction messages instead of summarising them.

  Output Formatting:
    --no-pager            Do not invoke $PAGER; print directly.
    --utc                 Display timestamps in UTC.
    --color {auto,always,never}
                          Color output mode (default: auto).
    --no-color            Disable color output (equivalent to --color=never).

  Configuration:
    --root ROOT           Codex sessions directory (default: ~/.codex/sessions).

<img width="662" height="156" alt="Image" src="https://github.com/user-attachments/assets/b818463d-8211-488c-bf8a-dba2acde5e42" />

<img width="669" height="510" alt="Image" src="https://github.com/user-attachments/assets/43ccfc3e-39a8-4515-810f-97d48c308e99" />

---

That said, while I haven't personally used this next tool, I saw it mentioned on another issue recently, and in many ways seems to have similar features to what the tool I was building has as well:

  • https://github.com/andylizf/codexer
  • > Codexer
  • > Fast TUI to browse Codex logs and jump straight into any session.
  • > Codexer is a Textual-based terminal UI for browsing and searching coding-assistant session logs (Codex/Claude/other JSONL transcripts). It lets you filter by keywords, restrict to a specific working directory, and jump through sessions with a colorful, keyboard-friendly interface.

I think ultimately something built directly into codex itself that solves the sort of thing that my tool or codexer are doing would be ideal; but for now at least there are some workarounds.

tsingyu42 · 9 months ago

Yep, it would be great if there were something like /export in Claude Code

saahityaedams · 7 months ago

Another adjacent (and narrow) use case I'd love is "export to github gist". I often use github gists to share code snippets with team members and find myself doing the same with codex sessions (ie. copy codex session text from terminal -> paste it into github gist -> share link). I'd love if codex could do this E2E with a slash command (ie. create a github gist with the gh cli and just give me the link to share).

Damecek · 7 months ago

afaik you should be able to do this once the thread is saved in file via gh gist create ~/.codex/sessions/2025-22-11.md

shayne-snap · 6 months ago

@Damecek @saahityaedams @0xdevalias @udaykumar1997 you can give waylog a try.

  1. brew install shayne-snap/tap/waylog
  2. waylog pull

repo:https://github.com/shayne-snap/waylog-cli?tab=readme-ov-file#-installation

venkatd · 5 months ago

I want to mention that my primary reason for copy transcript is wanting to refer to previous conversations.

For example, I will have a really long refactoring session. From there, I'd like codex to scan that session, compare w/ existing skills and suggest modifications to guardrails/skills. That way it can "learn" for the next time.

If I could wave a wand, I'd rather have codex learn automatically. But there I worry that it remember noise. I wouldn't trust it to remember the right things. So given current model capabilities, I'd want a recap of learnings. Then an interface to approve what to learn and what to discard.

Tobbe · 4 months ago

I had to slightly tweak the jq part of the example listed in the issue description to get any text printed to my terminal.

This is what I ended up using:

cat rollout-2026-02-22T09-26-25-019c85f5-84b2-7850-98cd-8575616e9f1a.jsonl | jq -r '.. | objects | select(has("text")) | .text'

It feels like it might be missing things, but at least I got something

vjain419 contributor · 4 months ago

+1 from me on this feature request.

Exporting transcript/messages to Markdown directly from the TUI (especially via the transcript viewer) would make it much easier to share sessions in docs/issues without manual log extraction.

kopyl · 4 months ago

This is very much needed. Please implement it.

jinghan23 · 4 months ago

Hey! I ran into the same friction and built a small Codex skill to solve this: jinghan23/codex-export

It parses ~/.codex/sessions/**/*.jsonl and exports any session to a clean Markdown transcript. A few things beyond the jq one-liner workaround mentioned here:

  • Works with Codex Desktop app sessions too (not just CLI)
  • --list to browse recent sessions without needing the UUID
  • --brief mode to strip tool calls and keep only the conversation

Install via clawhub: npx clawhub@latest install codex-export

lifeinchords · 3 months ago

another point of reference: https://github.com/daaain/claude-code-log/
excellent utility for Claude Code usage. Please adopt for Codex. In meantime @jinghan23 thank you, that sounds great

etraut-openai contributor · 3 months ago

We recently added a /copy command that copies the most recent message as markdown. I realize this feature request goes beyond that, but I wanted to mention this as a partial solution in case some of you find it useful.

lifeinchords · 3 months ago

@etraut-openai Thanks for mentioning that. If /copy is already working, is /copy-all an easy patch for now as well?

jpivarski · 3 months ago

+1, and in fact, I'd even like a mode in which the output is printed to the terminal in raw markdown without word wrapping—just use the terminal as a plain-text terminal. Then copy-paste would be easy.

(I've already set up gptel in Emacs to get ChatGPT output as raw text and read the markdown/LaTeX directly, which makes it so much easier to manipulate. I'm looking for the same feature in Codex because now I have to choose between the convenience of raw text in Emacs versus the obvious advantages of having an agent. Also, I'm hoping it's not too big of an ask because it's a matter of turning _off_ a feature, the renderer. At least, I hope that's easy.)

Edit: I just noticed the comment above about the /copy command, which might be all I need. I'll try that.

timothydillan · 3 months ago

For anyone landing here, I built harness-recall (https://github.com/timothydillan/harness-recall), which tackles this across multiple tools in one CLI. It reads sessions from Codex, Claude Code, and Cursor (more to come), indexes them, and exports to Markdown, HTML, or JSON (your choice).

Building on the great tools already shared in this thread:

  • Cross-tool: one index across Codex + Claude Code + Cursor sessions
  • hrc search "query" for full-text search across all sessions
  • hrc browse for an interactive TUI

Install using: pip install harness-recall

Hope it helps!

shubh73 · 3 months ago

kept running into the same thing, wanting to grab a full session transcript and so ended up building a /export command that saves the conversation as a plain text file in the working directory.

it's pretty minimal, auto-generated filenames, collision handling, works during running tasks. tried to keep it consistent with how /diff and /copy are structured.

https://github.com/user-attachments/assets/ce35095e-75a3-4461-8d72-d115402e84e7

branch: shubh73:feat/tui-export
https://github.com/openai/codex/compare/main...shubh73:codex:feat/tui-export?expand=1

lmk if a pr would be welcome?

ezyyeah · 1 month ago

Hey, I have built a tool for exporting entire codex session logs / conversations, with options: https://github.com/ezyyeah/codex-export

KernelBypass · 1 month ago

Github Copilot has both "Copy" (single message) and "Copy All" (Entire thread copied to clipboard as markdown).
It works great!

Please implement that. It's such an essential feature.

blain3white · 1 month ago

For a full-session alternative while this is tracked: I'm the author of Clean My Agent, which reads Codex session files and exports complete conversations to Markdown — not just individual messages.

cowwoc · 1 month ago
  1. Copy to clipboard is slower but more flexible
  2. Export to file is fast but problematic for headless environments

My take on this is that ultimately the Transcript functionality is underpowered (slow, impossible to search) but ultimately the right place for this functionality. So it should be fixed/improved.

fcnjd · 20 days ago

Same here, I was searching something like ctrl+o followed by v in Claude Code. I'd appreciate most if the transcript mode opened by ctrl+t would allow pressing ctrl+g from there, and then sends everything as it's already available in the TUI pager to $VISUAL and $EDITOR by temp file or similar.

yosun · 5 days ago

sorta surprised even codex cloud doesn't have a share link