User Guide

Files and Second Brain

Edit Markdown notes in a TipTap workspace confined with Go os.Root, detect external edits, and browse files on paired Loom nodes.

The Files page gives you a direct editor over your Second Brain folder—the local directory where you and your coding agents keep Markdown notes, plans, and references. By default it uses SECOND_BRAIN_DIR (~/second-brain), changeable directly from the page or Settings.

Formatted TipTap editor and conflict safety

  • Rich Markdown editing: .md files open in a vendored TipTap rich-text editor with a floating toolbar (headings, bold, italic, strikethrough, inline code, links, lists, checklists, quotes, dividers, tables, local images, undo) and a / slash menu for inserting blocks. Other text files open as plain text (up to 2 MiB), and images render inline.
  • Autosave with conflict detection: Edits save automatically and send the file's original modified timestamp (POST /api/files/write). If an agent or external editor modified the file on disk in the meantime, Loom returns 409 and asks whether to reload or keep your version instead of silently overwriting.
  • External change markers: Files changed outside the editor during the last 24 hours are flagged in the folder tree.
  • Safe deletion: Deleting an entry (POST /api/files/op) moves it to .trash inside the workspace rather than permanently removing it.
  • Tree hygiene: Dotfiles and node_modules stay hidden, and up to 5,000 entries load cleanly. Images load only from inside the folder—external image URLs are never fetched.

os.Root confinement boundary

Every Second Brain file request passes through Go's os.Root API relative to the configured workspace directory:

  • Absolute paths, .. traversal, hidden path segments, and symlinks resolving outside the folder are rejected at the filesystem layer.
  • Newly created notes and directories receive owner-only permissions.
  • Every write route requires POST behind Loom's session authentication and Go same-origin protection.

Discussions can save any reply directly into your Second Brain folder, while keeping automatic prompt injection strictly opt-in—moving a discussion into a sidebar folder never sends your files to a model.

Browsing files on paired nodes

When you switch to machine scope (scope=machine), Loom lets you inspect, edit, and manage directories on the local host or any paired Linux node by its saved machine ID:

  • On Unix hosts, machine scope starts at / with the service account's filesystem permissions; on Windows it starts at the account home directory.
  • Requests to a paired node travel directly over its authenticated machine Bearer link without requiring SSH.
  • Disabling a node's terminal module (loom node init --no-terminal) also disables remote file browsing and workspace creation on that node.

Files HTTP routes

RoutePurpose
GET/POST /api/files/rootRead or update the active Second Brain root ({path, create})
GET /api/files/treeFolder tree with sizes, timestamps, and outside-change markers
GET /api/files/list?path=List a single directory in the active scope
GET /api/files/read?path=Read UTF-8 text content (up to 2 MiB)
GET /api/files/raw?path=Serve image bytes or download other file types as attachments
POST /api/files/writeSave {path, content, modified, create} (409 on concurrent disk change)
POST /api/files/opCreate folder, rename, move, or trash (mkdir, rename, delete)

Continue with Machines and Nodes to pair additional hosts.