> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mythos.new/llms.txt
> Use this file to discover all available pages before exploring further.

# Workspace editor

> Edit your project files by hand in the in-browser code editor — open any file, save with Ctrl+S, autosave and Prettier-on-save, with a live preview.

The workspace editor is a code editor built into your project's workspace. Click any file in the file
tree and edit it directly — like VS Code or Cursor, in the browser. When you save, the change is
committed to your project's repo and the preview updates so you see the result right away.

It's the developer-facing half of Mythos: where prompting Mythos to build is the conversational loop,
the editor is the hands-on one for when you'd rather change a line yourself than describe the change.

<Note>The editor is for **developers** comfortable reading code. You don't have to use it — you can
build and change everything by [prompting Mythos](/features/building-and-editing). Edits you make in
the editor don't cost credits, because no build runs.</Note>

<Note>**The editor vs a build.** A build runs the agent and costs credits. Saving a file in the editor
is a direct edit — it commits your exact change and runs no agent, so it's free.</Note>

## Why use it

* **Precise changes.** Fixing a typo, nudging a value, or tweaking a className is faster to do by hand
  than to describe.
* **No credits spent.** Hand-edits commit directly, so iterating in the editor doesn't draw down your
  balance.
* **Same source of truth.** Your saves land in the same git repo as agent builds, so the editor and
  chat stay in sync.

## Prerequisites

* A project that's already been built, so there are files to edit.
* A **desktop browser.** The editor is desktop-only (see Limitations).

## How to edit a file

<Steps>
  <Step title="Open the code view">
    In the workspace, switch to the code view to see your project's file tree.
  </Step>

  <Step title="Pick a file">
    Click any file in the tree. It opens in the editor with syntax highlighting.
  </Step>

  <Step title="Make your change">
    Type directly in the editor. A dot appears next to the filename and in the tree to mark the file
    as having unsaved changes.
  </Step>

  <Step title="Save">
    Press **Ctrl+S** (**Cmd+S** on Mac) or click **Save**. Mythos formats the file with Prettier,
    commits it to your repo, and pushes it to the preview.
  </Step>

  <Step title="See it live">
    The preview updates without a full reload, so your change shows up in place.
  </Step>
</Steps>

## What happens on save

When you save, Mythos:

1. **Formats** the file with Prettier (for supported file types — TypeScript, JavaScript, CSS, JSON,
   Markdown, and more), then adopts the formatted version back into the editor so you see the tidy
   result instantly.
2. **Commits** the file to your project's git repo — the same repo agent builds write to.
3. **Pushes** it to the live preview so the change appears without a manual refresh.

<Tip>You don't have to remember to save. **Autosave** kicks in about a second after you stop typing,
so a save runs on its own — but Ctrl+S is there when you want to save immediately.</Tip>

## Good to know

* **Autosave is automatic.** Roughly 800 ms after you stop typing, a dirty file saves itself.
* **Each file keeps its own undo history.** Switch between files and your undo stack and cursor
  position for each one are preserved — they don't get mixed together.
* **One file at a time.** The editor has a single active file; there's no multi-tab view yet.
* **Light theme.** The whole workspace, editor included, is light.
* **The preview is HMR-driven.** Changes hot-swap into the running preview rather than triggering a
  full rebuild.

## Limitations

* **Desktop only.** The workspace IDE doesn't run on small screens — open it on a narrower screen and
  Mythos shows a message asking you to switch to a desktop instead of a broken editor.
* **Some files are protected.** You can't hand-edit core build plumbing (lockfiles, certain config
  files). Trying to save one of these is rejected — this keeps a stray edit from breaking the build.
* **Single active file.** No multi-tab editing, no cross-file find-and-replace yet.
* **A save can fail.** If the commit can't land (for example, a network blip on GitHub's side), your
  unsaved text is kept in the editor and a save-failed indicator appears so nothing is lost.

## Troubleshooting

| Problem                                                     | Fix                                                                                                                                   |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| The editor won't open / shows a "switch to desktop" message | You're on a screen too small. The editor is desktop-only — open the workspace on a desktop browser.                                   |
| A save was rejected                                         | The file is protected build plumbing. Change app code instead, or [prompt Mythos](/features/building-and-editing) to make the change. |
| You see a save-failed indicator                             | The commit didn't land. Your text is still in the editor — press Ctrl+S to retry.                                                     |
| You're previewing an old version and can't edit             | Editing is locked while [viewing an earlier version](/features/version-history). Return to the latest version to edit.                |

## FAQ

<AccordionGroup>
  <Accordion title="Does editing in the editor cost credits?">No. Hand-edits commit directly without running the agent, so they don't spend credits. Only agent builds and edits do.</Accordion>
  <Accordion title="Do I have to press save?">No. Autosave runs about a second after you stop typing. Ctrl+S (Cmd+S) saves on demand.</Accordion>
  <Accordion title="Does it format my code?">Yes. Save runs Prettier on supported file types and shows you the formatted result.</Accordion>
  <Accordion title="Can I use it on my phone?">No. The editor is desktop-only; on small screens Mythos asks you to switch to a desktop.</Accordion>
  <Accordion title="Are my edits saved to the same place as agent builds?">Yes. Both write to your project's private git repo, so the editor and chat stay in sync.</Accordion>
  <Accordion title="Can I edit multiple files in tabs?">Not yet — the editor works one active file at a time, though each file keeps its own undo history.</Accordion>
</AccordionGroup>

## Related

* [Building and editing](/features/building-and-editing) — change your project by prompting instead.
* [Version history](/features/version-history) — every save is a commit; revert if a change goes wrong.
* [Credits & pricing](/introduction/credits-and-usage) — hand-edits are free; agent builds cost credits.
