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

# Files, changes and terminal

> Work beside your chat in Dev view: review and discard your agent's changes, open and edit files, run commands in a terminal and let your agent use it.

Each chat in a worktree has a side panel with that worktree's changes, its files and its terminals. Use it to see what your agent changed, fix a line yourself or run a command, without leaving Wonder.

**Before you start** · Desktop app · Free plan

The side panel belongs to a worktree: a separate copy of your repository, on its own branch and in its own folder.

## Switch to Dev view

Dev view gives your chat the main column, with the side panel next to it: **Changes** on top and the terminal below. Drag the divider between them to resize.

![Dev view with the repository sidebar on the left, the chat in the middle, and the side panel on the right showing All changes with two changed files above a zsh terminal, and Publish to GitHub at the top](https://mintcdn.com/wonder-0722b0f6/OUBpIoF3FzXesr-c/images/work-with-your-code/dev-view.webp?fit=max\&auto=format\&n=OUBpIoF3FzXesr-c\&q=85\&s=32b2a1bd7ed0f525d5f60e3e95ff2c80)

* Click **Code** (the curly brackets) on the switch at the top right of the window, or press <kbd>⌘</kbd> <kbd>⇧</kbd> <kbd>.</kbd>.
* To go back, click **Design** (the palette) on the same switch, or press <kbd>⌘</kbd> <kbd>⇧</kbd> <kbd>.</kbd> again. Your chat, files and terminals stay with the worktree.

You can also choose **Switch to dev view** or **Switch to canvas view** in <kbd>⌘</kbd> <kbd>K</kbd>.

To show or hide the side panel, press <kbd>⌘</kbd> <kbd>J</kbd> (**Toggle changes & terminal**) or click the panel button in the chat's header. Pressing <kbd>⌘</kbd> <kbd>J</kbd> while the canvas is showing switches to Dev view with the panel open.

## Review your agent's changes

The menu at the top of the panel picks what it lists:

| View | Shows |
| - | - |
| **All changes** | Everything on this branch that differs from its base branch, committed or not. |
| **Uncommitted** | Only the changes that aren't committed yet. |
| **All files** | Every file in the worktree. |
| **Pull request** | The worktree's pull request, once it has one. See [Commit, push and pull requests](https://wonder.design/docs/commit-push-and-pull-requests.md#follow-checks-and-reviews). |

Each changed file shows the lines added and removed and its status, such as **Modified**, **New file** or **Deleted**. Click **Show as tree** to group the files by folder.

1. Click a file to open its diff in a tab beside your chat.
2. Click **Switch to split diff** to see the old and new versions side by side, or **Show unchanged lines** to see the whole file.
3. To hand the change back to your agent, click **Add to chat** in the tab, or right-click the file and choose **Add changes to chat**.

To have another model check the work, click **Review** at the top of the panel. See [Choose models and reviewers](https://wonder.design/docs/choose-models-and-reviewers.md).

## Discard changes

Hover a file or folder in the list and click **Discard changes**, or right-click it and choose **Discard changes**. Discarding throws away the uncommitted changes to that file. It can't be undone.

Wonder asks first when:

* the file is new since the last commit, so discarding deletes it (**Delete this file?**);
* you discard a whole folder (**Discard changes in this folder?**);
* your agent is working in the worktree and may be editing the file.

Committed changes stay. To undo those, ask your agent.

## Open and edit files

1. Choose **All files** in the panel's menu and click a file. It opens in a tab beside your chat.
2. Edit it, then press <kbd>⌘</kbd> <kbd>S</kbd> or click **Save**. A dot on the tab means it has unsaved changes. Wonder doesn't save files on its own.

A file you open replaces the previous one in the same tab, shown in italics. Double-click the file or the tab to keep it open.

* Select some lines and press <kbd>⌘</kbd> <kbd>L</kbd> to add them to your chat.
* A Markdown or SVG file opens as a preview. To edit it, click **Show code** or press <kbd>⌘</kbd> <kbd>⇧</kbd> <kbd>V</kbd>, and press it again for the preview.
* If you close a tab with unsaved changes, Wonder asks **Save changes to '…'?** with **Save**, **Don't save** and **Cancel**.

### Open a file in your editor

Click **Open in** in the file's tab, or right-click the file in the list. The menu lists **Finder**, **Terminal** and the editors Wonder finds on your Mac, such as **Cursor**, **Visual Studio Code**, **Zed** or **Xcode**. **Copy path** copies where the file is.

The app you used last becomes the button's default.

## Use the terminal

The terminal runs in the worktree's folder, so its commands act on the same copy of your code as your agent.

* Click **+** (**New terminal**) or press <kbd>⌘</kbd> <kbd>T</kbd> for another terminal. Switch between them with <kbd>⌃</kbd> <kbd>Tab</kbd>, and close one with <kbd>⌘</kbd> <kbd>W</kbd>. The panel always keeps at least one.
* Double-click a terminal's tab, or right-click it and choose **Rename**, to name it. A tab shows the program running in it otherwise, with a green dot while it runs.
* Press <kbd>⌘</kbd> <kbd>F</kbd> to search the output and <kbd>⌘</kbd> <kbd>K</kbd> to clear it. <kbd>⌘</kbd>-click a link to open it in your browser.
* Select some output and press <kbd>⌘</kbd> <kbd>L</kbd>, or right-click and choose **Add selection to chat**, to show it to your agent.

Closing a terminal that's still running a program asks first, because it stops everything running in it.

A worktree can have up to 8 terminals open, across all windows.

## Let your agent run commands in the terminal

Your agent can run a command in one of the worktree's terminals, so you see it run, and read what a terminal printed. There's no switch for this: it follows the chat's [permission mode](https://wonder.design/docs/permission-modes-and-approvals.md).

* Before running a command, Wonder asks **Run this command in the terminal?** and shows the command and which tab it runs in. Only **Full access** runs it without asking.
* Before reading a tab your agent didn't run anything in, Wonder asks **Read this terminal tab?**, since it may show your own commands.

While it works, the chat says **Running a command in the terminal**. Afterwards, click **Ran in a terminal tab** in the chat to open that terminal.

## Set up your shell

The terminal starts your own login shell, the one `$SHELL` names, such as zsh or bash. To use a different shell, change your login shell.

**Settings > Agents > Terminal > Shell setup** picks which startup files run in new terminals:

* **Wonder's defaults** (the default): Wonder's prompt, keys, history, completion and aliases, with your own startup files on top. Yours win where they differ.
* **Only my own**: just your own startup files.

Either way, Wonder keeps the Git it includes first on `PATH` and marks prompts so your agent can tell where a command ends. The setting applies to terminals you open after changing it.

## If something goes wrong

* **"No uncommitted changes."** or **"No changes on this branch yet."** Your agent hasn't changed anything in this worktree, or its changes are committed. Choose **All changes** to see committed changes too.
* **All changes can't list the branch.** The message says why, for example that the branch shares no history with its base or that no Git remote is chosen. **Uncommitted** still lists your changes.
* **"Couldn't read this worktree's changes."** Try again. If it keeps failing, check that the worktree's folder still exists.
* **"This file is too large to open in a tab."** Open it in your editor with **Open in**.
* **Wonder won't open a file in your editor.** Wonder doesn't open worktrees that can hold code from a fork in apps that could run it. Use **Finder** instead.
* **"Too many terminals are open".** Close a terminal in this worktree or another window, then click **Retry**.
* **"Wonder can't find this worktree's folder".** Its drive isn't connected, or the folder moved. Connect the drive or put the folder back, then try again.
* **Your terminal is missing your prompt or aliases.** Check **Shell setup**, then open a new terminal.

## Related

* [Apply a design to your code](https://wonder.design/docs/apply-a-design-to-your-code.md)
* [Commit, push and pull requests](https://wonder.design/docs/commit-push-and-pull-requests.md)
* [Permission modes and approvals](https://wonder.design/docs/permission-modes-and-approvals.md)
* [Choose models and reviewers](https://wonder.design/docs/choose-models-and-reviewers.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.