Skip to content

Copy/Export Message as Markdown #2880

Closed

Description

@0xdevalias

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:
    • ⇒ 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

Activity

  1. added
    enhancement
    on Aug 29, 2025
  2. dlukt commented on Aug 29, 2025

    @dlukt

    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.
    
  3. 0xdevalias commented on Aug 30, 2025

    @0xdevalias
    Author

    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.

  4. udaykumar1997 commented on Sep 18, 2025

    @udaykumar1997

    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.

  5. 0xdevalias commented on Oct 3, 2025

    @0xdevalias
    Author

    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).
    Image Image

    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 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.

  6. tsingyu42 commented on Oct 12, 2025

    @tsingyu42

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

  7. saahityaedams commented on Nov 26, 2025

    @saahityaedams

    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).

  8. Damecek commented on Nov 26, 2025

    @Damecek

    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

  9. marked Copy Transcript #3732 as a duplicate of this issue on Nov 27, 2025
  10. added
    TUI
    on Nov 27, 2025
  11. shayne-snap commented on Dec 31, 2025

    @shayne-snap
  12. 15 remaining items

  13. KernelBypass commented on May 31, 2026

    @KernelBypass

    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.

  14. blain3white commented on Jun 9, 2026

    @blain3white

    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.

  15. cowwoc commented on Jun 10, 2026

    @cowwoc
    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.

  16. fcnjd commented on Jun 30, 2026

    @fcnjd

    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.

  17. yosun commented on Jul 15, 2026

    @yosun

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

  18. deepakmodidev commented on Jul 26, 2026

    @deepakmodidev

    any update on this, maintainers !

  19. etraut-openai commented on Aug 6, 2026

    @etraut-openai
    Contributor

    /copy and a configurable copy shortcut copy the latest response as Markdown.

  20. etraut-openai commented on Aug 7, 2026

    @etraut-openai
    Contributor

    A new /export command will be included in the next release.

  21. StephenCarboni commented on Aug 15, 2026

    @StephenCarboni

    What happened to this? I've got no /export command.

  22. etraut-openai commented on Aug 15, 2026

    @etraut-openai
    Contributor

    It will be included in 0.148.0. If you want to try it now, you can install 0.148.0-alpha.19.

  23. cowwoc commented on Aug 18, 2026

    @cowwoc

    @etraut-openai I tested this feature in codex-cli 0.148.0-alpha.22. I resumed a long session and ran /export from the main thread. The filename selection worked but as soon as I hit ENTER codex just sat there for ~4 minutes while it exported a ~200MB file.

    1. The /export command help says it export[s] the conversation as markdown but in fact it exports the entire session, across multiple conversations (compactions). The process either needs to get faster or we need a follow-up option to export only the past X conversations.
    2. Codex needs a visual indicator for long processes to differentiate hangs from long waits. Providing an ETA or percent-done indicator would be best. It doesn't have to be perfect; we just need to know if the wait is closer to 2 minutes or 20 minutes...

    I just checked, the session is 6 days old and contains 124 compactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions