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

# Safe Mode

> Control whether MoxyCode applies fixes automatically or waits for your approval.

<iframe width="100%" height="400" src="https://www.youtube.com/embed/YOUR_VIDEO_ID" title="MoxyCode Safe Mode" frameBorder="0" allowFullScreen />

MoxyCode has two fix modes — **Safe Mode** and **Auto Fix Mode**. Safe Mode is the default for all users. It gives you full control over every fix before it touches your code.

## The two modes

|                        | Safe Mode                     | Auto Fix Mode                 |
| ---------------------- | ----------------------------- | ----------------------------- |
| **Default**            | Yes                           | —                             |
| **Apply Fix button**   | Manual — you click it         | Automated — skipped           |
| **Save to confirm**    | Required                      | Required                      |
| **Undo Fix available** | Yes                           | Yes                           |
| **Applies to**         | Deploy errors + Code Analysis | Deploy errors + Code Analysis |

## Safe Mode

In Safe Mode, MoxyCode generates a fix and waits for you to review it before applying anything to your code.

**Deploy errors:**

1. Click **Analyze & Generate Fixes**
2. Review the Fixed Code, What Changed, and Overall Summary
3. Click **Apply Fix** to apply the change
4. Click **Save File** in the notification to confirm, or **Undo Fix** to revert

**Code Analysis:**

1. Click **MoxyCode: 💡 Explain & Fix** on a flagged line
2. Review the fix in the Code Analysis panel
3. Click **Apply Fix** to apply the change
4. Click **Save File** in the notification to confirm, or **Undo Fix** to revert

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/safe-mode-status-bar.png" alt="MoxyCode Safe Mode in the VS Code status bar" />
</Frame>

## Auto Fix Mode

In Auto Fix Mode, MoxyCode generates and applies fixes automatically — the Apply Fix button is skipped. You still see the notification with changed lines highlighted in green, and you still need to save the file to confirm.

**Deploy errors:**

1. Click **Analyze & Generate Fixes**
2. Fix is generated and applied automatically
3. Click **Save File** in the notification to confirm, or **Undo Fix** to revert

**Code Analysis:**

1. Click **MoxyCode: 💡 Explain & Fix** on a flagged line
2. Fix is generated and applied automatically
3. Click **Save File** in the notification to confirm, or **Undo Fix** to revert

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/auto-mode-status-bar.png" alt="MoxyCode Auto Fix Mode in the VS Code status bar" />
</Frame>

<Warning>
  In Auto Fix Mode, fixes are applied to your code immediately after generation. Always use Safe Mode when working against production orgs or any org with live users.
</Warning>

## Switching modes

Click **MoxyCode: Safe** or **MoxyCode: Auto** in the VS Code status bar at the bottom of the screen to toggle between modes.

* Switching to Safe Mode shows: *"MoxyCode: Safe Mode enabled — fixes require manual approval"*
* Switching to Auto Fix Mode shows: *"MoxyCode: Auto Fix Mode enabled — fixes apply automatically"*

The mode persists across sessions — MoxyCode remembers your last setting.

<Frame>
  <img src="https://mintlify.s3.us-west-1.amazonaws.com/moxycode/images/mode-toggle.png" alt="Clicking the MoxyCode mode toggle in the status bar" />
</Frame>

## When to use each mode

**Use Safe Mode when:**

* Working against a production org or any org with live users
* Applying fixes with a Medium or Low confidence rating
* Applying fixes rated Minor Risk or Review Needed
* You want to understand every change before it goes into your code

**Use Auto Fix Mode when:**

* Working in a personal development sandbox
* Iterating quickly through multiple deploy-fix cycles
* All generated fixes are High Confidence and Safe fix rated
* You are familiar with the codebase and comfortable with automatic changes

<Tip>
  A good default workflow: use Safe Mode everywhere, switch to Auto Fix Mode only in your dev sandbox when you need to move fast.
</Tip>

## Common issues

<AccordionGroup>
  <Accordion title="Mode toggle not appearing in the status bar">
    The MoxyCode mode toggle appears in the VS Code status bar at the bottom of the screen. If it is not visible, make sure MoxyCode is installed and active — open any supported file (`.cls`, `.trigger`, `.js`, `.html`) to activate the extension. If it still doesn't appear, run **Developer: Reload Window** from the Command Palette.
  </Accordion>

  <Accordion title="Fix was applied before I could review it">
    You are in Auto Fix Mode. Click **MoxyCode: Auto** in the status bar to switch back to Safe Mode. If a fix was already applied that you want to revert, click **Undo Fix** in the notification or use `Cmd+Z` / `Ctrl+Z` in the editor.
  </Accordion>

  <Accordion title="I saved the file before reviewing the fix">
    Use `Cmd+Z` / `Ctrl+Z` to undo the save and the applied fix. VS Code maintains undo history across saves so you can still revert.
  </Accordion>
</AccordionGroup>

<CardGroup cols={2}>
  <Card title="Fix Deployment Errors" icon="wrench" href="/workflows/fix-deployment-errors">
    Learn how fixes are generated and applied
  </Card>

  <Card title="Offline Mode" icon="wifi-slash" href="/configuration/offline-mode">
    Run MoxyCode fully local with no internet connection
  </Card>
</CardGroup>
