The System One EventUtahGo To Event Page →

Docs

Set up Midium, use every part of it, run it for your team, and build on it.

Changes & undo

Midium changes your real files directly and records every change, so you can see what changed and put it back. Approvals decide how much a chat asks first.

For everyone

How it works#

When Midium changes files, in Chat, in Code, or in a scheduled run that's allowed to write, it changes your real files right away. There's no separate copy to review and apply. Instead every change is recorded as it happens, so you can see exactly what changed and undo it.

Each chat turn (or each scheduled run) is one change. It includes:

  • files the model created, edited or deleted;
  • folders it created or deleted;
  • files changed by commands it ran, such as tests, builds, scripts, git checkout and package installs;
  • in Code, edits you made yourself in the editor.

Undo a turn#

After a turn that changed files, a card under the reply says Changed N files on disk and lists each file as Created, Edited or Deleted.

  1. Check the list.
  2. Click Undo. Every file goes back to how it was before that turn, and folders the turn created are removed once they're empty again.

The card stays after you reload the chat or stop a reply.

To undo a single file in Code, open it (the Changed tab of the file tree lists every file the chat changed) and click Undo this file.

A file can only be undone while it's still exactly as that turn left it. If a later turn, another chat or you changed it since, undo the newer change first. Midium tells you: Newer edits sit on top — undo those first.

Settings → Changes#

Settings → Changes lists everything Midium has changed in your files, newest first.

  • Recent changes: each change shows where it came from (a chat turn or a scheduled task). Undo a whole change, or open it to see each file's diff and undo one file.
  • Approvals at the top sets the default approval level for new chats.
  • Staged before: edits Midium held for review before it wrote to files directly. Only shown if you have some left over (see below).

Approvals#

Each chat has one of three approval levels:

LevelWhat happens
Ask before writingEvery file change and file-changing command waits for your OK.
Ask for risky actions (default)Edits go straight to your files (undoable). Commands that can't be undone ask first.
AutoNo approvals. Edits are still undoable; pushes, publishing and sends are not.

Whatever the level, every file change is still recorded.

Change it for one chat: in the desktop app, use the approvals menu in the window's title bar, left of the terminal and browser toggles. In a browser, it's at the chat's top-right. A shield icon means one of the two Ask levels; a lightning bolt means Auto.

Change the default: in Settings → Agent under Approvals, or at the top of Settings → Changes.

On Ask before writing, the approval card offers Allow, Allow all edits this turn and Don't allow.

What asks first#

Undo puts your files back; it can't take back something that left your Mac. On both Ask levels, these commands show a card ("Allow this command? It can't be undone.") with the reason:

  • git push, and gh commands that change something on GitHub.
  • Publishing a package (npm publish, cargo publish, docker push and similar).
  • Sending data to a server with curl, wget and similar tools. Reading a page doesn't ask.
  • ssh, and copying to another machine with scp or rsync.
  • Commands that control other apps with AppleScript.
  • A command that changes files somewhere Midium can't track for undo.

In Code, a change outside the project folder also asks: Trust that folder, Allow once (no undo) or Don't allow. Changes in Apple apps (a calendar event, a note, a mail draft, running a shortcut) ask unless the chat is on Auto, and sending an email or message always asks.

If you click Don't allow, the command doesn't run and the model is told not to try another way.

Trusted folders#

Chat has no project folder, so the first time a command changes files in a folder, Chat asks Trust <folder>?. The folder is the one the command works in, or the whole git repository it's part of. Code asks the same when it changes files outside its project.

Once you trust a folder, Midium keeps a copy of each file there before a command changes it, so undoing the turn takes it back, and Chat and Code don't ask again for that folder. Pushing, publishing and sending data still ask. Code doesn't search a trusted folder unless a command or path names it.

Your home folder itself, Midium's own folder, folders that hold keys and passwords, and folders outside your home folder can't be trusted. Settings → Agent lists your trusted folders: remove one (Midium asks again next time), show it in Finder, or use Trust a folder… to trust one ahead of time. On Auto, a folder is trusted without asking.

What isn't recorded#

  • Ignored folders. In a git repo, Midium follows git's file list, so ignored folders such as node_modules and build output aren't recorded.
  • Very large changes. A command that changes thousands of files or hundreds of megabytes records what it can and lists the rest as not undoable.
  • Background processes. Dev servers, watchers and long builds run on your real files, but their own changes aren't recorded.
  • Anything outside your Mac: see the list above.

Scheduled runs#

A scheduled run is read-only unless Let this run change files is ticked. With it on, the run's changes are recorded like a chat turn and show up in Settings → Changes, where you can undo them. Nobody is there to approve a card, so anything that would ask is refused and the run reports what it would have done. See Scheduled runs.

Staged before#

Older versions of Midium held edits in a separate copy for review instead of writing them. If you have edits like that left over, Settings → Changes shows them under Staged before, grouped by project folder:

  • Apply writes them to your files as one change, which you can undo like any other. A file that changed since it was staged is skipped and left as it is now.
  • Discard throws the held edits away. Your files aren't touched, and this can't be undone.

Once a group is applied or discarded, it's gone from the list.

Something here wrong or out of date? Tell us.