Harness Notes

Image input

Updated 2026-11-22,

On this page

How to give each harness a screenshot, mockup or diagram from its terminal, what it accepts, and whether the image survives in the saved session.

Getting an image in

QuestionCodex CLIchecked at 0.162.1
Paste from the clipboard

Copy an image (or an image file in Finder or Explorer), then press Ctrl+V in the composer; Alt+V and Ctrl+Alt+V also work, and the shortcut list shows Ctrl+Alt+V under WSL. Codex reads the system clipboard, saves it as a temporary PNG and inserts an [Image #1] placeholder. Your terminal's own paste (Cmd+V, Ctrl+Shift+V) only sends text, so it attaches an image only if the pasted text is a path to an image file.

Under WSL, if the Linux clipboard has no image Codex runs PowerShell to fetch the image from the Windows clipboard.

Image paste does not work on Android/Termux, and over SSH it reads the clipboard of the machine running Codex, not your local one.

Ctrl+V is a reserved key: you cannot rebind it in tui.keymap.

Attach an image file

Start with codex -i shot.png "prompt" or --image a.png,b.png (comma-separated or repeated). Inside the TUI, paste or drag-and-drop a single image path (quoted, shell-escaped, file:// and Windows paths work) or pick a .png, .jpg, .jpeg, .gif or .webp file from the @ file search. Each becomes an [Image #N] attachment. An image path you just type as plain text is not attached; it stays text that the agent can open with view_image.

A pasted or dropped path only attaches if Codex can read the image's dimensions; otherwise it is inserted as text.

The top-level -i takes several values, so a prompt written right after it can be read as another image path. Put the prompt first or end the image list with --.

Images in scripted runs

Yes: codex exec -i shot.png "Explain this error" (or --image a.png,b.png), and codex exec resume --last -i shot.png "follow-up" or codex exec fork <id> -i ... for later turns. Stdin is read only as prompt text, so you can't pipe image bytes. Pass image files with -i and the prompt as an argument or on stdin.

codex exec fork with -i but no prompt fails with Forking with images requires a prompt.

codex debug prompt-input -i shot.png "text" prints the model input Codex would build, without running a turn.

Images through the SDK or API

App Server turn/start (and turn/steer) accepts input items { "type": "localImage", "path": "/abs/shot.png" } and { "type": "image", "url": "data:image/png;base64,..." } or { "type": "image", "fileId": "..." }, each with an optional detail of auto, high or original. The TypeScript SDK takes { type: "local_image", path } entries and passes them to codex exec --image. The Python SDK has LocalImageInput(path) and ImageInput(url).

Remote http(s) image URLs are rejected with remote image URLs are not supported; use an inline data URL instead, even though the App Server docs show an https:// example.

localImage paths are read on the machine running the app server. The TUI connected to a remote app server sends local images inline, up to 32 MiB per message.

ACP is available through the separate codex-acp adapter. It turns ACP image blocks into image items, and the turn fails if a block has an http(s) URI. It also rejects images when the current model is text-only.

What is accepted

QuestionCodex CLIchecked at 0.162.1
Formats, limits and resizing

PNG, JPEG, GIF and WebP are accepted. PNG, JPEG and WebP are sent unchanged when no resize is needed, and anything else, including GIF, is re-encoded as PNG. Images are scaled down to at most 2048 px on the long side and 2,500 32-px tiles, so roughly 1600x1600 for a square image, and the model is told the original and new sizes. With detail: original on models that support it, the limit is 6000 px and 10,000 tiles. There is no attachment count limit, and files over 1 GiB are refused.

An unreadable or unsupported file (for example SVG, BMP or HEIC) does not stop the turn. The model gets a text note saying the image is invalid or unsupported.

detail: low is not supported, and the image is replaced with a note asking for high, original or auto.

Clipboard pastes are always saved as PNG.

An image with no text

Yes in the TUI: attach or paste an image and press Enter with no text, and the message is sent as just [Image #1]. In App Server, a turn/start whose input contains only an image item is accepted, since only an empty list is refused. codex exec still needs a prompt argument or stdin text.

Models that can't see images

If the model's catalog entry doesn't list image input, the TUI refuses the attachment with Model <name> does not support image inputs. Remove images or switch models. and keeps your draft. On a model switch, path pastes stop attaching. Images already in the history (or sent through exec or the API) are replaced with the text image content omitted because you do not support image input before each request, and view_image refuses to run.

If the model catalog can't be read, the TUI assumes the model supports images.

Afterwards

QuestionCodex CLIchecked at 0.162.1
Kept in the saved session

Yes. Each image is saved inline as a base64 data URL inside the session rollout under ~/.codex/sessions, so codex resume and codex fork send the same pixels again, still labelled with their original path. Local compaction keeps only the text of earlier messages and drops their images. OpenAI-hosted (remote) compaction can keep recent images within a 64,000-token retained-message budget.

--ephemeral sessions are not written to disk, so nothing is kept.

Rollouts with screenshots can get large because the bytes are stored inline.

0.164.0 adds local viewed/generated artifact previews in the owned fullscreen transcript when a Kitty/Sixel presentation protocol is available. The cell image_path is loaded by transcript layout; this is display support, separate from model image input, attachment persistence and headless output. No terminal rendering probe was run.

The agent opening images itself

Yes. The built-in view_image tool (feature view_image, on by default) lets the agent load any local image file by path and send its pixels to the model. On some models it can ask for detail: original to keep full resolution. There's no built-in screenshot tool, so the agent captures screenshots with a shell command (for example screencapture or Playwright) and then opens them with view_image.

The tool is unavailable on text-only models, and App Server clients see each use as an imageView item.

Notes and sources

Codex CLI, 38 sources
Paste from the clipboard, 5
Attach an image file, 5
Images in scripted runs, 3
Images through the SDK or API, 8
Formats, limits and resizing, 6
An image with no text, 4
Models that can't see images, 7
Kept in the saved session, 8
The agent opening images itself, 5