# Files

The **Files** page browses the server from the *files root* (Settings -> System, default `/root`).
Nothing outside that folder is reachable from the UI.

## Browse

- Breadcrumbs at the top, folders first, then files with size and date. On a computer the folder's listing sits
  in the second bar next to the sidebar (see [Sessions](sessions.md#layout)), with **Filter this folder** and
  its toolbar; a file you click opens in the page, beside it. On a phone the folder is the page itself until you
  open a file (no empty viewer, nothing to open first); with a file open, **☰** at the top left shows the folder
  again (opening a folder keeps it open, opening a file closes it).
- Search finds files and folders by name in the workspace.
- Drag files from your computer onto the page to **upload** them into the current folder - or
  onto a folder row to upload them straight into that folder. One upload is limited to 2 GB, and
  the server refuses an upload that would leave less than 1 GB free on its disk ("Not enough free disk
  space"). Both limits are `upload_max_mb` and `upload_min_free_mb` in
  `/var/lib/claude-maxxing/config.json` (`upload_max_mb: 0` removes the size limit; no restart needed).
  Empty files are uploaded too; a dropped folder is skipped (a message says so): drop the files inside it.
- Drag a file or folder onto another folder (or onto a folder of the breadcrumb at the top) to
  **move** it there; dragging one of the selected items moves the whole selection. Desktop browsers only; on a phone use *Rename or move* in the item menu.

## Preview

Almost every file opens in a preview. Thumbnails (images, videos, first page of PDFs) need `ffmpeg` and
`pdftoppm` (installed by the installer).

| File | What you see |
|---|---|
| Images (also TIFF, converted on the fly) | the picture, zoomable |
| Videos, audio | the built-in player; videos have a **quality** button (Auto, Original, 1080p, 720p, 480p, see below) |
| PDF | the document; on a phone (and any browser with no PDF reader of its own) page by page: two fingers, a double tap or **− / +** zoom, the bar shows the page you are on |
| Word, PowerPoint, OpenDocument text and slides (`.docx`, `.pptx`, `.odt`, `.odp`) | the text of the document as a page: headings, lists, tables, links, its pictures, one section per slide with its notes |
| Excel, OpenDocument sheets (`.xlsx`, `.ods`) | a table per sheet (tabs at the bottom), with the column letters, the row numbers and a filter |
| Markdown | rendered, or the source |
| CSV / TSV | a **table**: click a column to sort, filter rows, numbers right-aligned |
| HTML | the **page itself** with its images, styles and scripts (see below), or the source |
| Archives (zip, tar, tar.gz, gz) | the **list of what is inside**, with sizes, without extracting anything |
| Fonts (woff, woff2, ttf, otf) | a **specimen** in several sizes, with your own sample text |
| Code, text | highlighted, with line numbers |
| Anything else (old `.doc` / `.xls` / `.ppt`, 7z, rar...) | a card with **Download** |

Office documents are read by Harness Maxxing itself, with nothing to install: you get the words and the numbers
of the file (values as the file stores them, formulas already computed), not its layout, fonts or charts -
**Download** gives the original. A very large document is cut, and says so.

**Text size and where you were.** Markdown (rendered or source), code and text files have **− 100% +** in the
toolbar (on the Files page of a smaller window, or on a phone, the **T** button opens it): the text gets larger or
smaller and the passage you are reading stays in place; click the percentage to go back to 100%. Ctrl/⌘ + wheel
or a pinch (trackpad, or two fingers on a phone or tablet) over the text does the same. The size is kept in this browser. Each text file also remembers
where you were: switching **Preview**, **Edit** and **Split**, or opening the file again (even after a reload),
brings you back to the same passage.

**Video quality**: the player plays the **original** whenever your browser can decode it, at full sharpness (text
in a screen recording stays readable). A lighter copy is used only when the original cannot be played here (HEVC,
ProRes or AV1 on some browsers: "Preparing a copy this browser can play…" shows while it is made) or keeps stalling or
dropping frames. Auto also follows your connection: the player measures its speed while a video plays and remembers it
for 30 minutes, so on a slow connection (or with the browser's data saver on) the next videos start directly on a copy
the connection carries, and on a fast one they stay on the original. The copy is 1080p for a video above 1080p, 720p for a heavy one at most 1080p. The player's quality
button (next to the speed) lists **Auto** (the default, as above), **Original** and the lighter copies; a quality you
pick switches at the same moment when its copy is ready. The server makes a copy once (H.264, built to start playing
at once), one video at a time and at low priority, and only once you press play: opening a video to look at it
starts no encoding. With **Auto**, a change of source while the video plays waits until you pause, unless the
original cannot keep up. Your choice is remembered on this device. Copies are kept up to 4 GB in total (the least
recently played go first, never one played in the last 30 minutes) and need `ffmpeg`.

**HTML pages run isolated**: they get their own sandbox, separate from Harness Maxxing. Their scripts run,
but they cannot use your session, read the API or your cookies. Links that open a new tab or window keep
that sandbox (a site opened this way may ask you to open it directly to sign in). Relative images, styles, scripts,
fonts, audio and video next to the page (and in its sub-folders) load normally; data and documents do not (`.json`,
`.csv`, `.txt`, `.md`, `.pdf`...: a page cannot read your notes or exports next to it - inline the data in the page or
in a `.js` file instead). The link is valid for 2 hours and ends when you sign out: reopen the file after that.

**← / →** (or the arrows in the toolbar) go to the previous / next file of the folder - any type, not only
pictures. The **fullscreen** button opens the file viewer (see below) on the files of the folder.

- **Images** appear at once (thumbnail first, then a light version of large pictures); the full
  original loads quietly right after, so zooming (+, -, 0, double-click, the mouse wheel) stays
  instant. The wheel zooms by 5 % around the pointer (Shift + wheel scrolls); a zoomed image is moved by
  dragging it (the hand). On a touch screen, pinch with two fingers to zoom around them (and move the picture
  while pinching), drag a zoomed picture with one finger, double-tap to switch between fitted and 100 %; the page
  itself never zooms.
- **Videos and audio** play in the built-in player; click it, then: Space or K play/pause, ←/→ 5 s, J/L 10 s, ↑/↓
  volume, M mute, F full screen, 0-9 jump to 0-90 %, < / > slower / faster; the speed and quality buttons open
  the device's own list (the system picker on a phone, never cut off, also in full screen), speeds 0.5× to 4×;
  picture in picture and full screen from the buttons. The poster image appears at once. On a phone or a tablet,
  tap the speaker to show the volume slider, tap it again to mute (on an iPhone or iPad the slider also works,
  on top of the device's volume buttons). On a touch screen, a first tap on a playing video shows the controls, a
  second one pauses. The player's box has the video's shape from the start: nothing jumps when it loads.
  - **Kept in this browser**: the volume, mute and speed, and where you stopped in each audio or video file longer
    than 15 s. Opening it again resumes there ("Resumes at 12:34 · From start" until you press play), except in its
    first 3 or last 5 seconds.
  - **The file changes while it plays** (Claude rewrote it): the player keeps playing what it had and shows
    **File changed · Reload**.
  - **Connection lost** (the server restarting after an update, a network drop): the player stays, shows
    "Connection lost, resuming…" and continues at the same moment as soon as the server answers again (three quick
    tries, then a **Retry** button and a quiet check every few seconds). Only a file this browser cannot play at all
    shows a card with **Download**.
  - **Short clips without sound** (15 s or less) play like a GIF: muted, looping, controls on hover or tap.

## The file viewer

Files clicked in a session (attachments, pictures, files Claude read or wrote, paths in its answers) open
in the **file viewer**, a side panel - or fullscreen with its button (remembered; always fullscreen on a
phone).

- **← / →**, the arrows in its bar, or a **swipe** on a phone: previous / next file **of the
  conversation**, in reading order. The next ones are preloaded.
- A **diagram** of an answer opens here too: fitted to the window, **+ / -** or the wheel (5 % per notch) to zoom, drag to move
  around, double-click to switch between fitted and enlarged (on a touch screen: pinch, one finger to move, double
  tap), **Source** for its code.
- A **folder** opens as a grid with thumbnails; click a file to open it, then ← / → browse that folder.
  **Parent folder** goes one level up. Several files can be selected, downloaded or deleted there too (see
  [Select several files](#select-several-files)).
- The bar keeps the name, **Preview / Source**, **Edit** (text files: markdown, txt, code, CSV, HTML: the file in the
  Files page, ready to edit - a new tab on a computer, in place on a phone), the text size, ← / →, fullscreen and close.
  The rest is in its **⋮** menu: copy, download, Open in Files, Parent folder (on a phone, Edit too).
- **Open in Files** opens the file in the Files page - a new tab on a computer (the viewer stays open), in place
  on a phone.
- **Copy the text** copies what the file says: a text, code or CSV file as it is, a PDF as the text read in its
  pages (a scan has none), a workbook as cells that paste into a spreadsheet. A Markdown or HTML file and a Word
  document give two choices: the **source** (Markdown for a document) or **plain text**, the words as you read them
  without the marks. In the **⋮** menu of the viewer; in the Files page, in the menu of the file.
- **Download** (also on a phone; a picture on screen is saved at once, without downloading it again); on a folder,
  **Download as zip**. **Esc** to close.
- **Quote a document in the session** (a file opened from a session, in Preview): select a passage, **Quote** (the
  same pill as in a reply), add a note if you like, Enter. The passage goes into the **Quote** card of that session's
  message box, like a passage quoted from a reply: its note under it, the file it comes from on its last line. Quote
  as many as you want, on several files; the passages already quoted stay highlighted. Nothing is sent: you send
  them with your message. **Send to a session** and **New session with it**, under **Quote**, put the passage in
  the message box of another session or of a new session of the same topic instead.

## Edit

Text files up to 2 MB open in an editor with syntax highlighting. Markdown, CSV and HTML have **Preview / Edit / Split** (the HTML preview shows the saved file). **Save** checks that the file
did not change on disk meanwhile (for example because Claude edited it): if it did, you get a
conflict warning instead of overwriting the other change. Reload, then re-apply your edit.

## Select several files

In a folder (the Files page list or grid, and the folder grid of the file viewer):

- **Long press** a file (a finger, or the mouse button held still for half a second) to start a selection; then a
  **tap** adds or removes a file, and a long press on another file adds every file in between.
- With a mouse: **Shift + click** selects everything from the last file clicked to this one, **Ctrl + click**
  (**Cmd + click** on a Mac) adds or removes one file, **Ctrl + A** selects the whole folder.
- A bar at the top shows how many are selected, with **Download** (several files or folders come as one zip, same
  limits as below), **Delete** (one confirmation for all of them, with their names) and **...** for the other
  actions. **Esc** or the cross ends the selection.
- **Right click** a file (or **Shift + F10** / the menu key on the focused file) for its menu: *Open*, *Download*,
  *Copy path*, *Rename or move*, *Delete* - and *Open in Files* in the viewer. On a selected file, the menu acts on the
  whole selection.
- Without a selection a click opens the file, as before.

## Rename, move, delete, download

- Rename and move from the item menu.
- **Delete moves to the trash**: Settings -> **Trash** lists what was deleted (files, folders,
  topics and projects with their sessions, sessions) - **Restore** puts it back where it was (under a new name
  such as `blog-restored` when the place is taken; a long name is shortened to make room; a topic whose project
  is also in the trash comes back after its project),
  *Delete forever* or *Empty the trash* frees the space. Items older than 30 days are removed
  automatically.
- The workspace folder itself (and the folders that hold it) cannot be moved or deleted from here,
  and a topic folder with a running session cannot be moved or deleted until that session is stopped
  (the same rule as the workspace sidebar).
- Download any file from its menu: the browser saves it with its progress, whatever its size, under its real name
  (accents included).
- **Download as zip** in a folder's menu (and in the viewer of a folder) downloads the whole folder, sub-folders
  included, as one zip made while it downloads. Up to 2 GB (before compression) and 100,000 files and folders; a bigger folder
  says so, download its sub-folders instead. Links that point outside the files root are left out.
- **iPhone / iPad, app added to the home screen**: **Download** opens the share sheet (*Save to Files*, AirDrop,
  Messages...) for files up to 50 MB (when reading the file took more than a moment, tap **Save** on the **File
  ready** notice to get the share sheet); a bigger file opens inside the app, where the system offers to save or share
  it - swipe from the left edge of the screen to come back. *Open the original* also stays in the app (Safari,
  outside the app, would not be signed in).

## Tips

- Attachments sent in sessions and from Telegram live in `<topic>/attachments/`.
- A file path printed by Claude in a session is clickable and opens in the file viewer.
