codex - 💡(How to fix) Fix [Feature Request] Auto-copy resume command to clipboard on Ctrl+C or app close [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17771Fetched 2026-04-15 06:28:39
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×1unlabeled ×1

Code Example

codex resume 019d8b21-218a-7e52-83ab-524ced01f3e0

---

codex resume 019d8b21-218a-7e52-83ab-524ced01f3e0
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

I’d like to request a small UX improvement for Codex that would be very helpful in real usage.

Problem
When I stop Codex with Ctrl+C or close the app/session, I often want to continue later using the resume command, for example:

codex resume 019d8b21-218a-7e52-83ab-524ced01f3e0

Right now, I need to manually copy the session ID first. This becomes inconvenient especially when:

  • I hit usage limits
  • I want to switch accounts
  • I need to close Codex quickly and continue later

Requested feature
On Ctrl+C, graceful shutdown, or window/app close, automatically copy the full resume command to the clipboard, for example:

codex resume 019d8b21-218a-7e52-83ab-524ced01f3e0

Why this helps
This is a small change, but it would make session recovery much faster and smoother. The main benefit is reducing friction when users need to:

  • switch accounts
  • recover after limit exhaustion
  • reopen Codex and continue immediately

Suggested behavior
If possible:

  1. On exit, Codex detects that the current session is resumable
  2. It copies codex resume <session_id> to the clipboard automatically
  3. It also prints a message like: Resume command copied to clipboard: codex resume <session_id>

Optional improvements

  • Add a setting/flag to enable or disable this behavior
  • Fallback to printing the resume command clearly if clipboard access fails
  • Support this on macOS, Linux, and Windows

This is a small update, but it would be very helpful in daily workflows.

Thanks.

Additional information

No response

extent analysis

TL;DR

To address the requested feature, modify the Codex CLI to automatically copy the resume command to the clipboard upon exit, either by pressing Ctrl+C, closing the app, or session termination.

Guidance

  • Identify the current session ID generation and storage mechanism in Codex to integrate it with the proposed clipboard functionality.
  • Develop a cross-platform approach to access and manipulate the system clipboard, considering macOS, Linux, and Windows compatibility.
  • Implement a fallback mechanism to print the resume command if clipboard access fails, ensuring users can still recover their sessions.
  • Consider adding a configurable setting to enable or disable the automatic clipboard feature, allowing users to choose their preferred behavior.

Example

No specific code example can be provided without knowing the internal implementation details of Codex. However, the general approach would involve:

# Pseudocode example of copying resume command to clipboard
session_id = get_current_session_id()
resume_command = "codex resume " + session_id
copy_to_clipboard(resume_command)
print("Resume command copied to clipboard: " + resume_command)

Notes

The implementation details may vary based on the programming language and frameworks used by Codex. Ensuring compatibility across different operating systems and handling potential security considerations related to clipboard access are crucial.

Recommendation

Apply workaround: Modify the Codex codebase to integrate the proposed feature, as it seems to be a specific enhancement rather than a bug fix that would be addressed by an upgrade to a fixed version. This approach allows for a tailored solution that meets the exact requirements outlined in the feature request.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING