# Attaching files

Images, PDFs and text files go to the agent with a message, as each agent takes them. The rest of
the composer is in [The composer](/docs/sessions-composer/).

## Adding files

- **Attach files**, the button left of `/` in the composer, opens your system's file picker, where
  you can pick several files at once. It shows only where the session's agent takes files.
- You can also drag files from your computer anywhere onto the transcript. While they're over it, it
  shows "Drop files to attach them".
- Or paste them into the message box with Cmd+V (Ctrl+V on Windows and Linux):
  - An image on the clipboard, such as a screenshot or an image copied from a browser, attaches as
    `Pasted image 1.png`, then `Pasted image 2.png`.
  - Files copied in Finder or Explorer attach under their own names.
  - Text pastes as text, as it always has. When an app copies text together with a picture of it,
    as a spreadsheet does with its cells, the text is what pastes.

  Like the button, dropping and pasting attach only where the session's agent takes files.

The files sit above the message as a row of chips, a thin line between them and the message. The
row scrolls sideways, and a file you add, picked, dropped or pasted, brings it to its end, so the
file shows. Each chip shows a thumbnail for an image or its file type's icon for any other
file, the file's name, and an image's size. The X on a chip takes it off. The files belong to the
message you're writing: switching to another session lets them go.

A file the session's agent can't take has its chip outlined, with the reason in its tooltip and
under the message box, and **Send** waits until you take it off.

## Opening a file

A chip opens its file in a preview over the transcript, with an X at its top right; Escape closes it
too.

- An image, an SVG file, a font, a PDF, and a CSV or TSV table show in the same preview Files has,
  with its zoom, its pages and its sample (see [Previews](/docs/diff-and-files/#previews)). An
  SVG's or a table's **Source** shows its text, read only.
- A Markdown file shows formatted, as a reply is; a link to a page opens in your browser, while a
  link to a file does nothing, as the file's words aren't the agent's. **Source** shows its text
  instead; a link to one of its lines opens its text at that line.
- A text or code file shows read only, in the editor the Files view has.
- Any other kind, such as a video or a sound, shows its icon and name: "There's no preview for this
  kind of file yet." A link to one inside the session's folders opens it in Files, which plays it.
- A file over 5 MB isn't read for a preview: "This file is too large to preview."

Once you send the message, the transcript keeps its chips at its top, above your words, or alone
where you typed none, and each opens the same preview. Moontors keeps the files with the session.

## What each agent takes

|             | Images | PDFs | Text and code files |
| ----------- | ------ | ---- | ------------------- |
| Claude Code | yes    | yes  | yes                 |
| Codex       | yes    | —    | yes                 |
| Gemini CLI  | yes    | yes  | yes                 |

- Images are PNG, JPEG, GIF and WebP.
- A text file is known by its extension, by a name such as `Dockerfile`, `Makefile`, `LICENSE` or
  `go.mod`, or as a dotfile such as `.bashrc` or `.env.local`. A file none of these names goes as
  text when its start holds no binary data.
- With Claude Code, a file its service couldn't read, of a kind the model doesn't read, or past what
  the conversation holds, gets a note in the transcript: the agent leaves it out of the conversation
  from then on.

## Limits

Moontors says why before anything is sent when:

- a file is over 5 MB;
- the session's agent doesn't take its kind;
- a message's files together come to more than the agent takes in one request, counted as it sends
  them: 32 MB for Claude Code and 20 MB for Gemini CLI. An image or a PDF counts a third more than
  its size, as it goes encoded, though Claude Code shrinks a large image first;
- with Codex, the message's words and text files together run past 1,048,576 characters, the most
  Codex takes in one message;
- with Gemini CLI, the message starts with `/` or `$`, which Gemini CLI takes as its own command,
  leaving the files behind;
- the message is a command the agent runs itself, such as `/review` or `/init`, which takes no
  files: send them with a message of their own. Moontors' own commands, such as `/compact`, leave
  the files in the composer.

More limits are in [Known limits](/docs/known-limits/).