> For AI agents: the complete documentation index is available at https://docs.heys.ai/workstation/en/llms.txt, the full documentation bundle is available at https://docs.heys.ai/workstation/en/llms-full.txt.

# Code Projects and Remote Workspaces

When HeyS writes code or edits scripts, it needs a stricter way of working than it uses for documents: read before changing, change only the lines that need changing, and run the tests itself afterwards. This page covers "code projects" and the set of tools built for them: separate worktrees, the Changes panel, verification badges, the Git panel, the built-in terminal, background processes, and confirmation before acting. Finally, it explains how to put a project on a Linux server or in WSL so the agent works on that machine.

## Code projects \{#code-projects}

### How a code project differs from a regular project

Once a project is set as a code project, the agent works the way a programmer does:

| Aspect               | In a code project                                                                                                                                                           |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Reading and editing  | Reads the relevant code before acting; changes only the lines that need changing instead of rewriting whole files; reads large files by line range                          |
| Verification         | Runs the build, type checks and tests itself after changing code; adds tests for new or changed behavior; when fixing a bug, first writes a failing test that reproduces it |
| Answer               | Organized as "changes / verification / risks", with `file:line` when it cites code                                                                                          |
| Project instructions | `AGENTS.md` and `CLAUDE.md` in the repository are read automatically, and the agent follows the conventions in them                                                         |
| Interface            | A **Code** badge appears next to the session title; **Changes**, **Git** and **Terminal** panels appear on the right                                                        |

Whether or not it is a code project, each time the agent changes a file the process line shows `file +N −M`; click it to see the diff for that change. When a change is too large, it shows **This change is too large to show inline.** and offers **View in the Changes panel**.

### Two levels of settings

Whether a project is a code project is decided at two levels, and the project setting wins:

| Level   | Where to change it                                                                     | Options                                                                              |
| ------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| Space   | **Settings → Spaces**, **Coding** group: **Work like a coder by default**              | On / off. Used when the project has no setting of its own; temp chats also follow it |
| Project | **⋯** on the project row in the sidebar → **Project settings** → **Work like a coder** | **Follow space setting** / **Code project** / **Not code**                           |

When you create a project, HeyS takes a look at the folder: if it contains project files such as `.git`, `package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml` or `Makefile`, **Code project** is preselected, and you can change it. If an existing project looks like a code project but has never been set, when you create a task under it the top edge of the input box shows **This folder looks like a code project. Work on it like a coder?** You can click **Make it a code project**, or **Don't ask again**.

Hover over the **Code** badge next to the session title to see which level the setting comes from (set on the project / following your space setting / default); click it to go to the project page.

:::note Note
A change to the project setting affects only **tasks started afterwards**. Tasks that are running, or stopped and waiting to continue, keep the setting they started with.
:::

### Project settings at a glance

**⋯ → Project settings** on the project row in the sidebar opens **Project settings, project name**, which contains:

| Setting                                             | Description                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Work like a coder**                               | See the table above                                                                                                                                                                                                                                                                                                |
| **Additional rules**                                | **Follow space setting** / **Set for this project**, see below                                                                                                                                                                                                                                                     |
| **Check commands**                                  | The commands this project uses for verification, one per line, such as `pnpm test`. Leave empty to detect them automatically from `package.json`, pytest, `go.mod`, `Cargo.toml` and `Makefile`. At most 5                                                                                                         |
| **Confirm before acting**                           | **Never** / **Before writes** / **Read only**, see [Confirmation before acting](#confirmation-before-acting)                                                                                                                                                                                                       |
| **Run new tasks in a separate worktree by default** | See [Separate worktrees](#separate-worktrees)                                                                                                                                                                                                                                                                      |
| **Files copied into worktrees**                     | See [Separate worktrees](#separate-worktrees)                                                                                                                                                                                                                                                                      |
| **Directories**                                     | A project can have several directories; the first is the main directory. You can **Add directory**, edit names and descriptions, and remove directories (this only removes them from the project; files are not deleted). The name and description of each directory are given to the agent at the start of a task |

### Additional rules

If you want the agent to keep to some fixed rules when it writes code ("run pnpm lint after editing", "write new files in TypeScript"), put them in the **When coding** set under **Settings → Spaces → Additional rules**: every task that works like a coder reads them, added after the built-in coding rules. You can write the rules directly or load .md files, which are read each time a task starts, so edits to a file apply to the next task ([Spaces, Appearance and General Settings](https://docs.heys.ai/workstation/en/spaces-appearance-and-general-settings.md)).

If a project needs different rules, choose **Set for this project** under **Additional rules** in the project settings and write text or load a .md file from the project folder (such as `docs/ai-rules.md`); this project's tasks then use these rules whether or not they are coding. Leaving both the text and the files empty means no additional rules for this project. **Follow space setting** uses the matching set from the space.

### Quick actions

On the new-task page of a code project, there are two extra quick actions above the input box. Clicking one only fills in the input box; nothing is sent automatically:

- **Write AGENTS.md**: has the agent read through the project and write a guide covering how to build, how to test, code conventions and directory structure;
- **Review changes**: reviews the current uncommitted changes, reporting only problems introduced by them, sorted by severity, with `path:line`.

If a task in the same code project is already changing files and you start another task, the top edge of the input box warns **Another task is already changing files in this project; working at the same time may overwrite each other.** It does not stop you, but the safer approach is to use a separate worktree.

## Separate worktrees \{#separate-worktrees}

A separate worktree lets a task change code in its own copy of the project (its own folder plus its own branch) without touching the project's main directory. Several sessions can change the same repository at the same time without affecting each other, then merge back or open a PR when done.

### Turning it on

1. On the new-task page of a code project, click the gear **Run settings** on the top edge of the input box.
2. Turn on **Run in a separate worktree**; if needed, choose which branch to branch off from under **Base branch** (merging and syncing also use it as the baseline).
3. Write the task goal and send it. The agent works in the newly created worktree, and the top edge of the input box shows **Worktree: branch name**.

- If the project folder is not yet a git repository, turning on a worktree first initializes it as one (with an empty initial commit). If the folder already has files, they are not committed for you; commit once yourself first.
- Dependencies such as `node_modules` are not carried over; the agent installs them as needed. Files that are not in git but are needed to run (such as `.env` or local config) can be listed under **Files copied into worktrees** in the project settings, and are copied automatically when a worktree is created (one glob pattern per line, relative to the repository root).
- To run every new task in a worktree, turn on **Run new tasks in a separate worktree by default** in the project settings; you can still turn it off before sending.
- A session that has already started in the main directory can switch over from **⋯ → Continue in a separate worktree…** on the session in the sidebar. Later tasks (including continuing an unfinished one) then run in the worktree. Uncommitted changes in the main directory are not carried into the worktree; commit them first if you need them. If a task is running, wait for it to stop before switching.

### Worktree operations

Worktree operations are in two places: the **⋯** menu of the session in the sidebar, and the worktree bar at the top of the Git panel (which shows "N commit(s) ahead of the base, N behind").

| Operation                          | Description                                                                                                                                                                                                                                                                                                                                             |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Bring in new commits from** base | Merges commits that others have newly merged into the base branch into the worktree. When already up to date, it says **The worktree already contains every commit from** …                                                                                                                                                                             |
| **Merge into** base\*\*…\*\*       | Merges the worktree branch into the base in the project's main directory. Choose **Merge (keep every commit of the worktree branch)** or **Squash into one commit**; you can write a commit message (leave empty to use the session title), and check "Commit the uncommitted changes in the worktree first" and **Delete this worktree after merging** |
| **Create PR…**                     | Pushes the branch to the remote and opens a PR against the base; just fill in the PR title. Requires the repository to have a remote configured and the GitHub CLI `gh` installed on this computer                                                                                                                                                      |
| **Delete worktree…**               | Deletes this session's worktree folder. The session is kept, and later tasks run in the project's main directory again. You can delete the branch at the same time; uncommitted changes or unmerged commits are flagged prominently, and once deleted they cannot be recovered                                                                          |

Merging back into the base has a few prerequisites: the project's main directory must be on the base branch and have no uncommitted changes, and changes in the worktree must be committed first (or check the "commit first" option). If these are not met, the dialog states the reason directly.

### Conflicts

| Situation                            | What happens                                   | You can                                                                                                                                                         |
| ------------------------------------ | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Conflict while syncing the base      | The worktree stops mid-merge                   | **Hand to the agent** (resolve them one by one in this session, commit and run the checks); **Abandon merge** (go back to before the merge); **I'll handle it** |
| Conflict while merging into the base | The main directory has been put back as it was | First sync the base in the worktree, hand the conflicts to the agent, then merge                                                                                |

### Branch status

The session row in the sidebar and the session title bar show the worktree's branch, with an icon next to it marking its status:

| Status            | Meaning                                        |
| ----------------- | ---------------------------------------------- |
| **In progress**   | Still being changed in the worktree, no PR yet |
| **PR open**       | A PR has been created                          |
| **Has conflicts** | There is an unfinished merge                   |
| **Merged**        | The branch has been merged into the base       |
| **PR closed**     | The PR was closed                              |

When you archive or delete a session that runs in a worktree, you are asked **What about the worktree?** You can delete the worktree along with it, or keep it.

## The Changes panel \{#the-changes-panel}

The Changes panel lists the files the agent has changed. It appears only in sessions of code projects; open **Changes** from the panel icons at the top right of the session.

| Area      | Contents                                                                                                                                                                                                                                                                                                                   |
| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Scope     | Switch between **This turn** / **This task** / **This chat**                                                                                                                                                                                                                                                               |
| File list | Each file with `+N −M` and its status (**Added** / **Modified** / **Deleted** / **Renamed**). Changes produced when the agent runs commands (formatting, code generation) are marked **From a command**; files that were changed again by you or another session after the agent changed them are marked **Changed again** |
| Diff      | Click a file to see its diff; **Open in editor** opens the file in HeyS                                                                                                                                                                                                                                                    |

### Undo

| Operation                       | Effect                                                           |
| ------------------------------- | ---------------------------------------------------------------- |
| **Undo changes to this file**   | Restores this one file to how it was before the agent changed it |
| **Go back to before this turn** | Restores all files changed in this turn                          |

Before undoing, HeyS lists which files will be restored and which newly created files will be deleted. Files changed again after the agent changed them are **not overwritten by default** and are listed separately; if you really want to overwrite them, check **Overwrite them anyway**. Files without a checkpoint cannot be undone and are also listed. You cannot undo while a task is running; wait for it to stop.

### Exporting a patch

**Export patch** in the panel header exports the changes in the current scope as a patch file, convenient for sending to someone or applying elsewhere.

### Reviewing these changes

**Review these changes** in the panel opens a new **read-only** session (titled "Review: original session name") in which an agent reviews these changes independently: it can read the code but cannot run tests. The review lists problems graded **Critical** / **Major** / **Suggestion**, each marked **Verified** or **Speculative**, with `file:line`.

Check the problems you want handled and click **Send back to the original session**. HeyS jumps back to the original session and fills these problems into the input box (nothing is sent automatically). After you confirm and send, the original agent checks and fixes them one by one. The review session has **Open original session** at the top.

## Verification badges and check commands \{#verification-badges-and-check-commands}

When a code task wraps up, HeyS checks against the **commands the agent actually ran and their results**: whether it ran checks again after changing the code, and whether they passed. If the checks were not run or did not pass and no reason was given, the task is sent back once, asking the agent to run them or explain why not.

Verification badges on the session title bar and in the Changes panel:

| Badge                            | Meaning                                                |
| -------------------------------- | ------------------------------------------------------ |
| **Verified**                     | Checks were run after the last change, and passed      |
| **Checks failed**                | Checks were run and did not pass                       |
| **No checks run**                | Code was changed, but no checks were run at all        |
| **Not re-checked after changes** | Checks were run, but code was changed again afterwards |
| **Check result unknown**         | Checks were run, but the result cannot be trusted      |

Hover over a badge to see how many code files were changed, which checks were run after the last change and whether each passed, and the agent's explanation.

Which commands count as "checks" is decided by **Check commands** in the project settings (see [Code projects](#code-projects)); when it is empty, common test and build commands are recognized automatically.

## The Git panel \{#the-git-panel}

When a project is a code project and its folder is a git repository, the panel icons on the right include **Git**. Above the input box, "branch name, N uncommitted changes" is also shown; click it to open the Git panel.

| Feature         | Description                                                                                                                                                                                                        |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| View            | Current branch, ahead / behind its upstream, uncommitted changes (staged / unstaged / untracked / conflicted), the diff of a single file, recent commits                                                           |
| Stage           | **Stage** or **Unstage** a single file, or **Stage all** / **Unstage all**                                                                                                                                         |
| Discard changes | Restores a file to its last committed state; for untracked files, this means deleting them. Both require confirmation and cannot be undone                                                                         |
| Commit          | Write a commit message and click **Commit** (⌘Enter / Ctrl+Enter). Click **Generate** to have the agent draft a commit message from the staged changes; it only fills in the input box and does not commit for you |
| Branches        | Switch branches; **New branch** creates a branch from the current commit and switches to it                                                                                                                        |

The Git panel **does not** push, pull, rebase or merge; do these in the terminal (for merging worktrees and opening PRs, see [Separate worktrees](#separate-worktrees)).

- If git is not installed on this computer, the panel shows **git was not found** and how to install it (macOS: `xcode-select --install`; Windows: download and install from git-scm.com). After installing, reopen the app.
- In a project with several directories, the Git panel can switch which directory it shows.
- When connected to a collaboration node or the web app, only administrators can perform Git write operations; regular accounts can only view.

## Built-in terminal and background processes \{#built-in-terminal-and-background-processes}

### Built-in terminal (local desktop only)

In sessions and on the new-task page of a code project, the panel icons at the top right include a terminal icon, where you can type commands directly.

- It starts in the project folder; the sessions of one project share one set of terminals.
- Collapsing the panel or switching sessions does not end the shell; when you come back, the earlier output is still there.
- **New terminal** opens additional terminals, switched with tabs; closing a tab ends that shell.
- The panel header has **Open in system terminal**, which opens the same folder in the system's own terminal.
- This terminal is for your own use; the agent does not use it (the agent has its own way of running commands).

Remote windows opened from the web app or CoWork have no built-in terminal. In a remote workspace ([Remote workspaces (SSH / WSL, local desktop only)](#remote-workspaces-ssh-wsl-local-desktop-only)), the terminal opens on the remote machine.

### The background processes panel

For commands that do not end by themselves, such as development servers or watch-mode builds, the agent does not sit waiting after starting them, and they are not killed when time runs out; instead they move to the background and keep running. When a session has background processes, a **Background processes** icon appears at the top right (in all projects, not only code projects).

| In the panel        | Description                                                                                                                               |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Process list        | Command, working directory, status (running / exited with exit code), run time                                                            |
| Output              | Click to see live output; when it is long, the earlier part is omitted                                                                    |
| **Open in browser** | Appears when a local address is recognized (such as `localhost:5173`), and opens it in the built-in browser                               |
| **Stop**            | On the right of every running entry                                                                                                       |
| **N finished**      | Finished processes are collected here, stating how they ended: stopped by hand / task cancelled / app quit / app restarted / ran too long |

The **Processes** section of the task details panel ([Understanding Task Execution](https://docs.heys.ai/workstation/en/understanding-task-execution.md)) also shows the foreground command currently running and the background processes.

## Confirmation before acting \{#confirmation-before-acting}

Choose under **Confirm before acting** in the project settings:

| Option              | Effect                                                                                                        |
| ------------------- | ------------------------------------------------------------------------------------------------------------- |
| **Never** (default) | The agent changes files and runs commands directly, as usual                                                  |
| **Before writes**   | Stops to ask you before writing files or running commands                                                     |
| **Read only**       | Gives the agent only reading tools: it looks but does not change anything, suitable for drafting a plan first |

With **Before writes**, when the agent wants to write a file or run a command, the task stops and a **Needs your OK** card appears in the session, showing the command to run, or the file to write with a preview of the change:

| Button                  | Effect                                                                                                       |
| ----------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Allow once**          | Allows only this one time                                                                                    |
| **Allow for this task** | Allows the same kind of operation for the rest of this task, without writing it back to the project settings |
| **Deny**                | Not executed; the agent finds another way                                                                    |

You can also skip the buttons and reply directly in the input box (for example, "don't touch the config files yet, only change the tests"). While a task is stopped here, the task list shows **Stopped to ask whether to go ahead**.

:::tip Tip
For an unfamiliar repository, you can use **Read only** first to have the agent draft a plan, then after reviewing it switch to **Never** or **Before writes** to carry it out.
:::

## Remote workspaces (SSH / WSL, local desktop only) \{#remote-workspaces-ssh-wsl-local-desktop-only}

When the project files are on a remote Linux server, or in WSL2 on this Windows computer, you can put the project on that machine: the agent reads and writes files and runs commands there, while the interface is still the HeyS on your own computer. Nothing needs to be preinstalled on the remote side; it is deployed automatically on first connection.

### The connection wizard

1. On the new-task page, click the project picker and choose **Remote connection…**.
2. **Type**: **SSH server** (the project is on a Linux x64 server) or **WSL** (the project is in a WSL2 distro on this computer; shown only on Windows). **Recent connections** below can prefill everything in one click.
3. **Settings**: for SSH, you can pick an alias from **Host from \~/.ssh/config** to prefill, or enter the host, port and username by hand. Choose **Password** or **Private key** as the authentication method (leave the private key file empty to use ssh-agent or the default keys in \~/.ssh; for an encrypted key, enter its passphrase). Check **Remember the password / passphrase in the system keychain** so you don't have to type it next time. For WSL, choose the distro; leave **Linux user** empty to use the default user.
4. **Connect**: logs and upload progress are shown live, and you can **Abort**. The first time you connect to a host, its host key fingerprint pops up; check it and click **Trust and continue**.
5. **Folder**: browse remote folders (you can create a **New folder** or **Show hidden folders**), enter a project name and click **Open this folder**. The project is created on the remote machine and you jump to its new-task page. You can also **Skip for now**.

:::warning Warning
The host key fingerprint is confirmed only on first connection. If it changes later, the connection is refused outright, with the message that the server may have been reinstalled, or someone may be impersonating it in the middle. Once you have confirmed the server really has a new key, delete that line from the record as instructed and connect again.
:::

### Working in a remote project

- Remote projects and local projects are in the same sidebar. Remote ones have a cloud icon, with the machine they are on written under the name (such as `SSH dev@10.0.0.8:22` or `WSL Ubuntu`). Whichever one you click is the machine you send tasks to and browse files on; the project picker groups projects by machine.
- The file panel, Office preview, Changes, Git and background processes all point at the remote machine; the built-in terminal opens in the remote project folder. **Running on** in the task details shows the remote connection.
- Remote sessions notify you when they finish, just like local ones.
- The model settings of your current space on this computer are carried over automatically when you connect, so nothing needs to be configured on the remote side. In organization mode, the models your organization assigns you are valid only on this computer and are not synced to the remote; the remote uses its own model settings. Model services you added yourself are synced as usual.

### Managing connections

The bottom of the sidebar lists the machines connected during this run, each with a status dot and a menu:

| Menu item                                 | Description                                                                                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Open a remote folder / new task**       | Choose another remote folder to create a project                                                                                                                                                                                                                                                                                                                                                            |
| **Sync to remote…**                       | Pushes skills, experts and connector plugins (including MCP) from this computer to that machine, installed in the remote global layer; items with the same name are overwritten (marked **on remote**). Nothing syncs automatically; push again when you need to. Extensions installed from the extension market are not in the list; to use them remotely, install them from the market on the remote side |
| **Open in the whole window**              | Switches the whole window to this machine, where you can manage the remote's spaces, environment variables, model services and other settings                                                                                                                                                                                                                                                               |
| **Disconnect**                            | The remote server keeps running and tasks in progress are not affected; its projects stay in the sidebar, grayed out                                                                                                                                                                                                                                                                                        |
| **Stop the remote server and disconnect** | Tasks running on the remote are interrupted; requires confirmation                                                                                                                                                                                                                                                                                                                                          |

After a disconnection, remote projects turn gray and the page shows **Lost the connection to the remote workspace**. Click refresh or **Reconnect**; if the password was not saved, the wizard opens for you to enter it. Connections are not restored automatically after the app restarts; click refresh when you need one.

### Requirements and limits

| Item             | Requirement                                                                                                                                                                                                                                  |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Remote system    | Linux, x86_64 architecture, glibc 2.28 or later (such as Ubuntu 20.04+, Debian 10+, CentOS 8+), with tar and gzip                                                                                                                            |
| WSL              | Only WSL2 is supported. For WSL1, run `wsl --set-version distro-name 2` in PowerShell and retry                                                                                                                                              |
| SSH              | Jump hosts (ProxyJump / ProxyCommand) are not supported; for hosts configured with one, HostName is dialed directly                                                                                                                          |
| Component bundle | The Windows installer includes the remote components, so you can connect even offline; the macOS and Kylin installers do not. The connection wizard prompts **Choose bundle…**; import the component bundle matching this computer's version |
| Network          | The remote server listens only locally on that machine and is connected to this computer through an encrypted tunnel; no ports are opened to the outside                                                                                     |

Remote projects have **no** built-in browser, Computer Use or Sprite; remote windows opened from the web app or CoWork have no entry for remote workspaces.

## FAQ \{#faq}

**The agent broke something and I want to go back to before the change.** In the Changes panel, use **Go back to before this turn**, or **Undo changes to this file** for a single file. You can also use **Rewind to here** from [Understanding Task Execution](https://docs.heys.ai/workstation/en/understanding-task-execution.md) and choose **Rewind conversation and files**.

**Merging into the base reports that the main directory is not on the base branch.** First switch the main directory back to the base branch (with the branch switcher in the Git panel, or in the terminal), then merge.

**Creating a PR reports that `gh` was not found on this computer.** Install the GitHub CLI `gh` and sign in, or push the branch yourself in the terminal and open the PR on the website.

**I can't see the terminal icon.** The terminal appears only in code projects on the local desktop; first make sure the project is set to **Code project**.

**SSH reports authentication failed.** Check the username, password or private key; an encrypted private key needs its passphrase; for servers that allow only public key login, choose **Private key**.
