Copy/export current turn or last N turns including the full execution trace
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What variant of Codex are you using?
CLI and App
What feature would you like to see?
Codex needs a first-class way to copy/export the current turn (or the last N turns) with the complete visible execution history between user prompts — not only the final assistant report and not the entire conversation.
The desired operation is conceptually:
- Copy current turn
- Copy last 2 turns
- Copy since selected user prompt
A "turn" here means everything from a selected user prompt until the next user prompt/current point, including the user prompt, Codex commentary/progress messages, visible command executions and outputs, test/build results, errors, file-change/diff context that is part of the transcript, and the final assistant report.
Why the existing copy/export options are not enough
Today there are two useful extremes, but the practical middle is missing:
/copyin the CLI is convenient for the final assistant response, but it does not capture the complete work performed during the turn.- Full conversation export / Copy as Markdown can capture much more history, but on a long-running coding session it includes many old turns that are irrelevant to the current handoff.
The common workflow is:
- Discuss/plan a substantial coding task elsewhere (for example in ChatGPT).
- Paste one execution specification into Codex.
- Let Codex work autonomously for a long time, running commands, tests, builds, fixes, etc.
- Bring the result back for architectural/review discussion.
At step 4, the useful payload is everything Codex did since the last user prompt, not just its final summary and not six hours of prior session history.
Terminal selection is also a poor workaround because long output may have scrolled out of the terminal buffer or be awkward to select cleanly.
Requested UX
CLI
A minimal design could be:
/copy-turn # current/most recent user turn
/copy-turn 2 # last two user turns
/copy-turn --since <turn-id>
or integrate the same choices into /export / /copy with an interactive picker.
The key requirement is that this remain a one-command / very-low-friction action.
Codex App
In the message/turn menu:
Copy turn
Copy last 2 turns
Copy from here to latest
The important UX goal is roughly two clicks from the transcript to a complete, paste-ready Markdown representation of the selected turn/range.
Suggested Markdown output
For example:
# User prompt
...
# Codex execution
## Commentary
...
## Command
npm test
## Output
FAIL ...
## Commentary
...
## Command
npm run build
## Output
PASS ...
## Changes / diff context
...
# Final response
...
The exact serialization can follow the existing transcript model; the important part is preserving the useful visible execution trace rather than collapsing it to the final report.
Why this matters
This is particularly valuable when Codex is used as an implementation agent while another ChatGPT conversation acts as the product/architecture/review context. Without turn-scoped export, users are forced to choose between a lossy final summary and an unnecessarily huge full-session export.
It also removes a major practical difference between "Codex worked for 30 seconds" and "Codex worked for 45 minutes": both can be handed off cleanly in one operation.
Acceptance criteria
- A user can copy/export one complete user turn without manually selecting terminal text.
- A user can copy/export the last N turns or a range beginning at a selected user prompt.
- The export includes the user prompt, visible intermediate Codex messages, visible command/tool execution results, relevant change/diff transcript content, and the final response.
- The output is clean Markdown suitable for pasting into ChatGPT, an issue, or documentation.
- The operation is available with very low friction (one CLI command or approximately two clicks in the App).
- It does not require exporting the entire thread.
Related functionality
This is adjacent to requests for copying a specific assistant response, but it is a different unit of selection: the requested object is the entire user turn and its execution trace, not one assistant message.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names the existing /copy and full conversation export or Copy as Markdown behavior, plus the transcript model, but no files or tests. Start by locating those CLI entry points and the current export serialization, then determine how turns and visible execution traces are represented. Done means a low-friction export of one turn, a range, or the last N turns with the specified Markdown contents.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100