Files moving from Codex to ChatGPT through the ChatGPT Clipboard Upload skill

# ChatGPT Clipboard Upload A Codex skill that transfers local files into an existing ChatGPT conversation through the Codex in-app browser. It avoids the native file picker, preserves the relationship between generated attachment names and original filenames, and supports both individual uploads and ZIP bundles. ## The problem this solves ### Codex could not reliably complete attachments on its own Codex can automate the ChatGPT page through its in-app browser, but the obvious attachment routes were not dependable enough for an unattended workflow. The native file picker crosses from the webpage into an operating-system dialog, while screen coordinates, the moving plus-button menu, desktop drag-and-drop, and platform-specific file-drop formats are brittle or unavailable through the semantic browser controls. That meant a Codex task working on its own could prepare files and compose a prompt, but could not reliably finish the attachment step without human help or a risky coordinate-based workaround. ### Clipboard automation solved the upload but lost the filename A reliable upload path was found by reading the exact file bytes, writing them to the in-app browser clipboard as an attachment, focusing the ChatGPT composer, and issuing the browser automation paste command. This successfully created a real ChatGPT attachment card without opening the native picker. However, the supported clipboard payload carries the MIME type and binary contents, not a dependable original filename. ChatGPT therefore generates a UUID-based attachment name with a MIME-derived suffix. A file such as `project-notes.txt` can arrive as something like `526f75de-7ea0-4f6a-beb2-0c3a40bd3309.plain`. With several attachments, those generated names make it difficult to tell which file is which. ### The solution: sequential uploads plus a filename manifest This skill pastes files one at a time so every new attachment card has one unambiguous source. After each paste, it reads the generated name from the card's accessibility label and records the relationship to the original basename. It then appends a manifest to the prompt: ```text Attached-file name map (generated name -> original basename): - 526f75de-7ea0-4f6a-beb2-0c3a40bd3309.plain -> project-notes.txt ``` Before sending or reporting success, the skill verifies the attachment count, generated names, original basenames, and existing composer content. When separate uploads fail or preserving a directory of filenames matters more, it creates a ZIP bundle instead. ChatGPT may still rename the outer ZIP, but the original inner filenames remain intact. The result is an unattended upload workflow that is both automatable and traceable: Codex can attach the actual bytes, ChatGPT can identify the files by their original names, and the user can request either immediate sending or staging only. ## Features - Uploads files through the in-app browser clipboard without screen coordinates or a native picker. - Works with new or existing signed-in ChatGPT conversations. - Maps ChatGPT's generated UUID attachment names back to the original basenames. - Preserves inner filenames with a ZIP fallback when separate attachments are unsuitable. - Sends the message when the original request asks to send, or leaves it staged when staging-only is requested. - Preserves text and attachments already present in the composer. - Includes a cross-platform Python helper for safe ZIP creation. ## Requirements - Codex with access to the Codex in-app browser and Browser skill. - An existing, signed-in ChatGPT tab open in that browser. - Authorization to upload the selected local files to that conversation. - Python 3 only when the ZIP fallback helper is needed. ChatGPT's current file-type, size, and attachment-count limits still apply. ## Install Ask Codex to install the skill directly: ```text Use $skill-installer to install the skill from https://github.com/dev-newb/chatgpt-clipboard-upload ``` For a manual user-level installation on macOS or Linux: ```bash git clone https://github.com/dev-newb/chatgpt-clipboard-upload.git \ "$HOME/chatgpt-clipboard-upload" mkdir -p "$HOME/.agents/skills" ln -s "$HOME/chatgpt-clipboard-upload" \ "$HOME/.agents/skills/chatgpt-clipboard-upload" ``` For a manual user-level installation on Windows PowerShell: ```powershell git clone https://github.com/dev-newb/chatgpt-clipboard-upload.git ` "$HOME\chatgpt-clipboard-upload" New-Item -ItemType Directory -Force "$HOME\.agents\skills" | Out-Null Copy-Item -Recurse "$HOME\chatgpt-clipboard-upload" ` "$HOME\.agents\skills\chatgpt-clipboard-upload" ``` Codex detects skill changes automatically. Restart Codex if the skill does not appear. ## Use Upload files and send them in one workflow: ```text Use $chatgpt-clipboard-upload to upload and send these files to the currently open ChatGPT conversation: /path/to/notes.txt and /path/to/reference.png ``` Stage attachments without sending: ```text Use $chatgpt-clipboard-upload to stage /path/to/report.pdf in the currently open ChatGPT conversation, but do not send it. ``` Request a single ZIP bundle: ```text Use $chatgpt-clipboard-upload to bundle and send the files under /path/to/source as one ZIP in the currently open ChatGPT conversation. ``` The skill may also activate implicitly when a request clearly matches its description. ## How it works 1. Resolves the exact local files and the target ChatGPT conversation. 2. Claims the matching existing ChatGPT tab and verifies that it is signed in. 3. Writes one file at a time to the in-app browser clipboard and pastes it into the composer. 4. Reads the generated filename from the new attachment card. 5. Adds a manifest mapping each generated name to its original basename. 6. Verifies the staged attachments and existing composer content. 7. Sends when requested, or stops with the message staged when requested. The skill follows the active browser's confirmation rules but does not add a separate approval gate. ## macOS and Windows compatibility The preferred clipboard workflow has been verified in Codex on macOS. The Playwright automation call uses `Control+v` on both macOS and Windows; this is the in-app browser automation chord, not the manual macOS keyboard shortcut. A person pasting manually on macOS still uses Command-V. The ZIP helper uses Python's standard library and supports POSIX and Windows paths. Run it with an available Python 3 launcher, such as `python3` on macOS/Linux or `py -3` on Windows. ## Limitations - Supports the Codex in-app browser only; it does not target Chrome, Edge, CDP, or desktop drag-and-drop. - Requires an existing ChatGPT tab selected from the user's active request. - Depends on ChatGPT's current composer and attachment-card accessibility labels. - Cannot preserve the original outer filename through the raw clipboard payload; the manifest or ZIP fallback handles that limitation. ## Repository layout ```text chatgpt-clipboard-upload/ ├── .gitignore ├── README.md ├── SKILL.md ├── promo.png ├── agents/ │ └── openai.yaml └── scripts/ └── make_upload_zip.py ``` The installable instructions are in [`SKILL.md`](./SKILL.md).