Skip to content

Workspaces & files ​

A workspace is a git clone or a plain folder that you and the assistant can browse and edit, from the Files section. The assistant's file tools are confined to it.

A file tree on the left and a file's contents with a git diff on the rightA file tree on the left and a file's contents with a git diff on the right
Browsing a workspace — a file tree alongside file contents and git diffs.

Git repositories and local folders ​

New workspace offers three kinds:

  • Git repository — cloned into a local working copy you can pull, commit and push. Needs git on the server. The GitHub token is added to each git command and never written to the clone.
  • New folder — an empty folder with no git behind it. The same file tools apply.
  • Existing folder — a folder already on this machine, opened in place: give its absolute path (~ works). Files are read and edited where they are, and removing the workspace only forgets it: the folder and its files stay on disk. A folder inside a git repository gets the git tools on its current branch: the workspace sits on the repository and shows only that folder. The name defaults to the folder's name. A folder can be attached once, and never one overlapping Precursor's data directory. Only someone at this machine can attach a folder: a paired phone can't.

Syncing with git ​

The bar above a git workspace shows its branch and where it stands against the remote:

Bar showsMeans
↓ 2 behindPull has commits to bring in (checked on open and on Refresh, without touching files).
Cloud icon with a slashThe remote couldn't be reached; hover for git's message.
Push 2Two local commits aren't on the remote.
not publishedThe branch isn't on the remote; Publish pushes and tracks it.
  • Pull and Push act on the checked-out branch, even if you switched it in a terminal or VS Code. With a detached HEAD both are off.
  • Pull only fast-forwards. When both sides have moved, it offers to merge (see Merging and conflicts).
  • Committing: see Reviewing and committing.

Branches ​

The branch name in the bar opens the branch picker:

  • Branches: those in this working copy. The one checked out is ticked, and a branch not pushed yet is marked not published.
  • On the remote: branches only the remote has. Picking one fetches it and creates a local branch that tracks it, even in a clone made from a single branch.
  • Create: type a new name and choose Create. The branch starts from the current commit, and any uncommitted changes come along. It stays local until you Publish it. A name already taken, here or on the remote, isn't offered.
The branch picker open under the branch name, listing local branches and branches only on the remoteThe branch picker open under the branch name, listing local branches and branches only on the remote
Switching or creating a branch.

Switching never throws work away: it is refused with uncommitted changes (the message names the files), during a merge, with a detached HEAD, or when the other branch would overwrite untracked files. Precursor never forces or stashes. Unsaved editor edits are confirmed first; the open file is then reloaded from the new branch, or closed if it doesn't exist there.

Merging and conflicts ​

When your branch and the remote have both moved on, the bar offers Merge remote changes (refused while you have uncommitted changes).

  • A clean merge records a merge commit. Push sends it.
  • A conflict, where both sides changed the same lines, stops the merge. A Merge in progress bar stays up until you finish, and the Changes tab lists the conflicted files first. Committing single files is off meanwhile.

Click a conflicted file to see what happened, and your version beside the incoming one:

  • Text conflicts: Resolve in the editor opens the file with each conflict tinted, yours in green and theirs in blue. Above each one, choose Accept current (yours), Accept incoming (theirs) or Accept both, or edit the text yourself. Each choice can be undone. Save, then Mark resolved. That is refused while a conflict is left in the saved file: a <<<<<<< or >>>>>>> line, or a ======= line between them. A Markdown heading underlined with ======= is fine.
  • Binary files, and files one side deleted: these can't be merged line by line. Choose Keep yours or Keep theirs. Keeping the side that deleted the file deletes it. You're asked first, because the other side's changes to that file are dropped.
A merge in progress: the banner with Abort and Complete merge, the conflicted file in the Changes tab, and the file in the editor with Accept current, Accept incoming and Accept both above the conflictA merge in progress: the banner with Abort and Complete merge, the conflicted file in the Changes tab, and the file in the editor with Accept current, Accept incoming and Accept both above the conflict
Resolving a merge conflict in the editor.
  • Finishing: once no conflict is left, Complete merge records the merge commit.
  • Backing out: Abort merge (after a confirmation) puts your branch and files back as they were before the merge.

The merge runs as git merge and ignores your git config (rebasing pull, merge.ff, conflict style), so it behaves the same everywhere.

Reviewing and committing ​

In a git workspace the left pane has three tabs:

  • Files: the tree.
  • Changes: every file that differs from the last commit.
  • History: the commits on the branch (see History).

Review & commit in the bar opens Changes; the last pane used is remembered.

The Changes tab listing three changed files with checkboxes and a commit message, and a side-by-side diff of one of themThe Changes tab listing three changed files with checkboxes and a commit message, and a side-by-side diff of one of them
Reviewing a change before committing it.
  • See what changed: click a file to compare the last commit with your working copy in the editor's diff view, side by side or inline. On a phone it is always inline. The diff is read-only; the file icon opens the file for editing. Unchanged stretches of a long file are folded away.
  • Choose what goes in: untick the files to leave out of this commit. They stay changed, for a later one.
  • Commit records the ticked files in this working copy only (Cmd/Ctrl+Enter in the message box). Commit & Push also sends them.
  • Discard (the arrow on a file) puts it back as the last commit has it, and asks first. A new file doesn't exist in the last commit, so discarding it deletes it. The confirmation says so and its button reads Delete file. Discarding a rename restores the old name.

In the editor, margin bars mark lines changed since the last commit (green added, blue modified, red wedge removed), refreshed on open and save.

History ​

History lists the commits on the checked-out branch, newest first, with Load more for older ones.

  • Opening a commit: a commit opens to its message and the files it changed. Click a file to see its diff against the commit before it.
  • Merges: a merge is marked with an icon, and its files are compared with its first parent, the branch that was merged into.
  • The first commit: it has nothing before it, so its files show as added.
  • One file's history: File history (the clock beside an open file's name) narrows the list to the commits that changed that file, following it across renames. Opening one of those commits shows that file's change straight away. The cross beside "History of …" goes back to the whole branch.
The History tab with a commit opened to the file it changed, and that file's diff against the previous commitThe History tab with a commit opened to the file it changed, and that file's diff against the previous commit
What a past commit changed.

The Definitions workspace ​

Once Agents mode is on, or once you edit a summary template, the list starts with a built-in Definitions workspace holding your definition files (agents, workflows, summary templates). It can't be removed while it holds definition files, and the assistant can only read it.

Editing help:

  • As you type: the editor knows the file format, so it suggests keys (Ctrl+Space) and underlines unknown keys and wrong types. This works for any *.agent.yaml, *.workflow.yaml or *.summary.yaml file, in any workspace.
  • On save: in the definitions folder, the full check runs, including cross-file checks such as an agent path that points nowhere or a role this instance doesn't have. Its errors and warnings are listed under the editor and underlined in the file. Click one in the list to jump to its line.
A workflow definition open in the editor, with an agent path underlined and the check below saying there is no agent file at that pathA workflow definition open in the editor, with an agent path underlined and the check below saying there is no agent file at that path
The check's findings, marked in the file.

The sandbox ​

Every file operation goes through safe_join, which rejects paths outside the workspace root and blocks .git. The same sandbox backs the workspace tools of the precursor and drawio MCP servers. Paired with the command runner, the assistant can edit, test and review a repository inside a conversation.

Working with files ​

File typeOpens as
Markdowneditor + rendered Preview
HTMLeditor + sandboxed preview frame
.drawiothe diagram editor
Images (PNG, JPEG, GIF, WebP, BMP, ICO, AVIF), PDFview-only
Anything elsethe editor
  • Refresh file (circular arrow by the file actions) reloads the file from disk, keeping edit/preview mode; it asks before dropping unsaved edits.
  • Refresh files (circular arrow in the Files header) reloads the tree and git status after an assistant, command or other app changed files.
  • Every action on a file or a folder is in its menu: right-click the row, press Shift+F10 (or the menu key) on a focused row, or use its ⋯ button (shown on hover, always on phones).
    • A folder: New file here, New folder here, Rename, Move to workspace… and Delete.
    • A file: Open, Open in new tab (and Open to the side when there is room), Rename, Move to workspace…, Download, Copy path (its full path on disk) and Delete.
    • Only what applies is listed: nothing moves out of the Definitions workspace, so it has no Move to workspace…. Double-clicking a name still renames it, and the header's buttons create a file or folder at the root.
  • Deleting a folder or a whole workspace (trash icon in its header) needs you to type its name (a Copy button helps). The dialog says how many files go and whether they can come back (in git, committed files are restorable from Changes until you commit). Folders holding definition files can't be deleted; a symlinked folder loses only the link. Removing a git workspace deletes the local copy, never the remote.

The editor ​

Files open in Monaco, the editor core of VS Code:

  • Highlighting and editing: syntax highlighting, find and replace (Cmd/Ctrl+F), multiple cursors, folding, and the command palette (F1).
  • Saving: Cmd/Ctrl+S saves, in the editor, in the diagram editor, or with the focus anywhere else on the file's page (a preview, the toolbar, the tree).
  • YAML and JSON: these files are checked as you type, and a syntax error is underlined where it is.
  • Previews: switching a Markdown, HTML or diagram file to Preview and back keeps your undo history, cursor and scroll position.

It follows the app theme and works on phones. Monaco is downloaded the first time you edit a file.

A Markdown file open in the Monaco editor, with line numbers and syntax highlightingA Markdown file open in the Monaco editor, with line numbers and syntax highlighting
Editing a file in Monaco.

Opening in VS Code ​

Open in VS Code beside a file's path opens that file; the one in the workspace bar opens the working copy. Both are vscode://file/… links to the server's copy, so they work only when VS Code runs on the same machine. Copy local path copies the absolute path.

Discussing a workspace ​

Press Discuss in the workspace header to open a real chat or topic beside the files, with all its features; a chat started here is listed in Chats.

A workspace with a chat open beside the file, and the picker listing discussions that attach filesA workspace with a chat open beside the file, and the picker listing discussions that attach files
Pressing Discuss offers a new chat, the discussions already attaching files from this workspace, or any other chat or topic.

The picker offers:

  • New chat — a fresh chat about the open file.
  • Continue a discussion — the chats and topics that already attach files from this workspace, those attached to the open file first. Archived chats are left out.
  • Open another — search any chat or topic. One discussion is open at a time; Switch returns to the picker.

While it is open:

  • The file you view, and each file you move to, is attached to the discussion and sent with each turn, so "this" means the open file.
  • The URL carries the discussion (/ws/<slug>/<file>?chat=<chat> or ?topic=<id>), so reloads, links and Back keep it.
  • The panel title links to the full chat or topic.
  • Drag the left edge to resize (320–800 px, at most 65% of the window). On narrow screens it is a full-width overlay; when too narrow for the composer's pickers it uses compact mode.

Artifacts ​

Files attached to a conversation are its artifacts, listed in the Artifacts section of the chat or topic stats panel (count on the collapsed rail).

  • A file the assistant creates or modifies through the workspace tools is attached automatically, from a chat, a topic or the workspace panel. Reading a file never attaches it.
  • Attach adds one by hand; the detach button removes the link without touching the file.
  • Clicking an artifact opens the workspace on that file with the conversation beside it.
  • Links follow the path. A file renamed or moved in Precursor follows; one renamed or deleted elsewhere stays listed, marked missing.

Moving a file to another workspace ​

Move to workspace… (in a row's menu in Files) moves a file or a folder to another workspace, into the folder and under the name you pick. It is a move, not a copy: the file leaves its old place. A canvas you want to keep, for instance, moves out of the Canvas workspace into a git workspace where it is versioned.

Nothing that pointed at the file breaks:

  • The conversations it is attached to list it at its new place.
  • Links that name the old place (canvas blocks and links in messages, the Open chips on tool calls) lead to the new one, and an interactive canvas keeps its saved state, which moves beside it (.state/<name>.json).
  • A rename made in Precursor after the move is followed too. A rename or delete made outside it (git, an editor) can't be: the old link then says the file was moved or deleted, and where it was last seen.

The move is refused, and nothing changes, when a file of that name already exists at the target, for definition files, into the Canvas workspace, into a git workspace with unresolved conflicts, while a reply is being written in a conversation using the file, and for more than 500 files at once. A target with uncommitted changes is fine: commit the moved file with them.

Jumping from a conversation to the file ​

A tool call that reads or writes a workspace file (drawio or the precursor workspace tools, including read_diagram and read_file) carries an Open chip in the transcript. It opens the file in Files with the tree unfolded to it; Back returns to the conversation. Failed calls and folders get no chip.

Editing diagrams ​

A .drawio file (yours, or one the drawio MCP server wrote) opens in an embedded draw.io editor, with an XML / Diagram toggle for the raw mxGraph source. Saving (Cmd/Ctrl+S) and git diff work as for any file.

  • Theme: follows the app (an open diagram reloads, keeping unsaved edits but not draw.io's undo history). The sun/moon button in the file header overrides it for all diagrams.
  • Self-hosted and offline: Precursor serves draw.io at /drawio/ with offline=1&stealth=1; diagram content never leaves your machine.
  • One-time install: draw.io isn't in the wheel (~53 MB download). The first time you open a diagram, the Files pane offers to download the pinned release into <data_dir>/drawio/<version>/. PRECURSOR_DRAWIO_VERSION pins another release; PRECURSOR_DRAWIO_DOWNLOAD_URL uses an internal mirror (see configuration). Old versions are removed on upgrade.

See the architecture reference for the data model.

Released under the MIT License.