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.
25 Comments
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:
@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.
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.
@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
.jsonlfile and then processing it withjqor 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:
<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:
I think ultimately something built directly into
codexitself that solves the sort of thing that my tool orcodexerare doing would be ideal; but for now at least there are some workarounds.Yep, it would be great if there were something like
/exportin Claude CodeAnother 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).
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@Damecek @saahityaedams @0xdevalias @udaykumar1997 you can give
wayloga try.repo:https://github.com/shayne-snap/waylog-cli?tab=readme-ov-file#-installation
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.
I had to slightly tweak the
jqpart of the example listed in the issue description to get any text printed to my terminal.This is what I ended up using:
It feels like it might be missing things, but at least I got something
+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.
This is very much needed. Please implement it.
Hey! I ran into the same friction and built a small Codex skill to solve this: jinghan23/codex-export
It parses
~/.codex/sessions/**/*.jsonland exports any session to a clean Markdown transcript. A few things beyond thejqone-liner workaround mentioned here:--listto browse recent sessions without needing the UUID--briefmode to strip tool calls and keep only the conversationInstall via clawhub:
npx clawhub@latest install codex-exportanother 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
We recently added a
/copycommand 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.@etraut-openai Thanks for mentioning that. If
/copyis already working, is/copy-allan easy patch for now as well?+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
/copycommand, which might be all I need. I'll try that.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:
Install using: pip install harness-recall
Hope it helps!
kept running into the same thing, wanting to grab a full session transcript and so ended up building a
/exportcommand 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
/diffand/copyare 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?
Hey, I have built a tool for exporting entire codex session logs / conversations, with options: https://github.com/ezyyeah/codex-export
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.
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.
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.
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.
sorta surprised even codex cloud doesn't have a share link