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

QuestionClaude Codechecked at 2.1.299
Paste from the clipboard

Yes. Press Ctrl+V to paste an image from the clipboard (also Cmd+V in iTerm2; Alt+V on Windows; on WSL both Ctrl+V and Alt+V work). The image appears as an [Image #N] chip at the cursor so you can refer to it in your text, and you can rebind the key through the chat:imagePaste action in ~/.claude/keybindings.json.

Linux needs xclip or wl-paste to read the clipboard; WSL2 falls back to PowerShell.

Over SSH the remote machine cannot see your local clipboard; copy the file across with scp and give Claude its path.

Attach an image file

Drag an image file onto the terminal, or paste or type its path (for example Analyze this image: /path/to/screenshot.png). A dragged or pasted image path is attached as an image straight away; a path Claude only sees as text, or an @path/to/image.png mention, is opened with the Read tool, which also hands Claude the pixels. There is no launch flag for attaching a local image to an interactive session.

A Read(...) deny rule that matches the path stops a pasted or dragged image from being attached.

Pasted and attached images are also saved to a per-session images/ folder in Claude Code's temp directory, so Claude can open or copy them as files.

Images in scripted runs

Yes. The simplest route is to name the file in the prompt, as in claude -p "Describe the UI in ./screenshot.png", and Claude reads it with the Read tool. To send the image itself, use claude -p --input-format stream-json --output-format stream-json --verbose and write one JSON user message per line on stdin whose message.content holds an image block with base64 data. A plain-text -p prompt cannot carry image bytes.

Each stream-json message must be a single newline-terminated JSON line.

Reading an image path in -p needs Read permission for that path, for example via --allowedTools Read.

Images through the SDK or API

Yes, through the Agent SDK (TypeScript and Python) in streaming-input mode: yield a user message whose message.content is an array such as [{type: "text", text: "..."}, {type: "image", source: {type: "base64", media_type: "image/png", data: "<base64>"}}]. Single-message (plain string) prompts cannot attach images. If an image block's source is missing or malformed, Claude gets a text note such as [Image could not be processed: ...] and the session continues.

Claude Code has no built-in ACP server; the SDK and --input-format stream-json are the structured inputs.

What is accepted

QuestionClaude Codechecked at 2.1.299
Formats, limits and resizing

PNG, JPEG, GIF and WebP are sent as images; macOS TIFF screenshots, WSL BMP clipboards and CMYK JPEGs are converted first. Claude Code downscales anything over 2000x2000 px and compresses pasted, attached and Read-tool images to the same token budget, re-encoding a still-over-500KB result as JPEG. Requests are capped at 32 MB, and when the API's per-request image count or Claude Code's total image size cap would be exceeded, the oldest images and PDFs are dropped in batches.

An image Claude Code cannot decode or resize is refused with a message telling you to convert it to PNG, JPEG, GIF or WebP.

PDFs are separate: Read takes up to 20 pages per call for PDFs over 10 pages, and the API limit is 100 pages / 20 MB.

An image with no text

Not documented

The terminal docs don't say whether a prompt holding only a pasted image is accepted; a paste does leave an [Image #N] chip in the prompt text. The VS Code extension explicitly lets you send an attached image without typing anything, and Remote Control accepts images sent without a caption.

Models that can't see images

Not documented

Claude Code runs Claude models, which all accept images, so there is no documented fallback for a model that can't see them. If the API refuses an image (too large, too many, or unprocessable), Claude Code swaps that image for a text placeholder or drops the oldest images and retries, and Claude no longer sees them.

Behaviour with a non-Claude model behind ANTHROPIC_BASE_URL or an LLM gateway is not documented.

Afterwards

QuestionClaude Codechecked at 2.1.299
Kept in the saved session

Partly

The session transcript (~/.claude/projects/<project>/<session>.jsonl) keeps every message, including image content, so --resume, --continue and forks reload it; the separate copies of pasted images in the temp images/ folder are deleted after cleanupPeriodDays. Images do not survive compaction: /compact or auto-compaction replaces them with a text summary, and in long sessions the oldest images are also dropped from requests once size or count limits are hit.

With --no-session-persistence or CLAUDE_CODE_SKIP_PROMPT_HISTORY nothing is written, so there is nothing to resume.

If Claude needs a dropped or compacted image again, share it again.

The agent opening images itself

Yes. The Read tool returns PNG, JPEG and other image files as visual content Claude can see, resized and recompressed to fit the model's limits, and reads PDFs page by page. Images returned by MCP tools (for example browser screenshots from Claude in Chrome or Playwright) are shown inline and also saved to the session's tool-results folder so Claude can crop or reuse the full-size file.

For fine detail in a large screenshot, ask Claude to crop the region first (for example with ImageMagick), since the copy it sees may be downscaled.

Read detects the format from the file bytes, not the extension; a non-image saved as .png is read as text.

Notes and sources

Claude Code, 13 sources
Paste from the clipboard, 4
Attach an image file, 3
Images in scripted runs, 4
Images through the SDK or API, 2
Formats, limits and resizing, 4
An image with no text, 1
Models that can't see images, 2
Kept in the saved session, 4
The agent opening images itself, 3