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

> ## Agent Instructions
> Reticle is a verification layer for AI coding agents. Its SDK runs in development builds, and in staging or production only through the signed activate loader (see /production-mode). It reads program truth (network, state, console, routing, animations, framework state) from inside a running web app and returns a deterministic verdict with evidence. It is not a screenshot tool and not a browser automation library. For a desktop application, the computer realm (`@reticlehq/computer`) reads the app through the accessibility tree of the operating system on macOS, Windows and Linux (X11), with no SDK; an agent can use it for a check or for any other task in the app.
> Verdicts come from `reticle_act_and_wait`, `reticle_assert`, `reticle_act { steps }` when a step declares `expect`, and `reticle_verify` (`change`/`flows`). Everything else moves or reads the app and proves nothing. Only `verified: "yes"` is a pass: `unknown` means Reticle could not tell, and `no-fault` means nothing was declared to prove. A drive that ends without a verdict has no result, however many tools it used. Never weaken a check to make it pass.
> Package names are scoped `@reticlehq/*`. Run every CLI command as `npx @reticlehq/server <command>`, for example `npx @reticlehq/server init`. `reticle` is a bin name that `@reticlehq/server` installs once it is on your PATH, NOT a package on npm: `npx reticle` fetches an unrelated package published by somebody else, so never run that. The complete tool surface is on the `/usage` page; `/agent-cheatsheet` is the one-screen version.

# The computer realm

> Join any desktop application on macOS, Windows or Linux (X11) as a Reticle session, with no SDK in it. Read it through the accessibility tree, act on it, and get back what each action changed.

`@reticlehq/computer` joins a desktop application to the Reticle daemon. The application needs no SDK and no change. The realm reads it through the accessibility tree of the operating system, and the tools that an agent has for a page then work on it.

Use it to prove a change in a desktop application, and also for any other task in one: fill a form in a native app, export a file, read a value from one app and type it into another.

| System | How it reads | Notes |
| - | - | - |
| macOS | Accessibility (AX) | The most complete. The HUD, `--open` and `--doctor` work only here. |
| Windows | UI Automation, through a PowerShell script | No install. `--list` and joining an open application. |
| Linux | AT-SPI | X11 for the real pointer and real keys. See [Limits](#limits). |

## Install and run

The package holds the command `reticle-computer`. Run it with `npx`:

```bash theme={"dark"}
npx -p @reticlehq/computer reticle-computer --list
npx -p @reticlehq/computer reticle-computer --app "TextEdit"
```

The npm package holds the macOS helpers already built. Only a source checkout of the repository compiles them with `swiftc`, from the Xcode command-line tools. In 3.11.1 and earlier, an installed package can also try to compile them; see [Troubleshooting](https://docs.reticle.sh/troubleshooting.md#the-computer-realm).

`--app` waits up to 30 seconds for the daemon when it is not there yet. When the application joins, the command prints one line of JSON and stays open until you stop it:

```json theme={"dark"}
{ "joined": true, "sessionId": "cu-TextEdit-4242", "needsSessionId": true, "next": ["..."] }
```

Give that `sessionId` on each tool call. A desktop application is in no project unless you give `--project`.

An agent can also open the realm itself, with `reticle_open_realm`. See [Open and close a realm](https://docs.reticle.sh/tools/realms.md).

## Flags

| Flag | What it does |
| - | - |
| `--app <name>` | The application to join. Give the name in the Dock or the name of the process: `"Visual Studio Code"` and `Code` are the same application. |
| `--list` | Print the open applications as JSON, `{"apps":[{"name","process"}]}`, and stop. |
| `--doctor` | Check the permission, the helper, the application and its windows, and the daemon. Each check that fails says what to do. macOS only. |
| `--open` | Start the application when it is not open. It starts behind the application in front. macOS only. |
| `--watch <folder>` | Watch a folder. A file that an action writes becomes a `file.written` signal. Give it more than once for more folders. |
| `--project <folder>` | Put the session in the project of that folder, the one with `.reticle.json`. Its runs and flows then go to that project. |
| `--background-only` | Never use the real pointer or real keys, whatever a caller asks. |
| `--no-hud` | Do not show the HUD and the realm's pointer. Use it on a machine with nobody at it. |
| `--no-electron-switch` | Do not set the accessibility switch of an Electron app or a Chromium browser. A press then does nothing in it, and the command says so. |
| `--port <port>`, `--host <host>` | The daemon to join. Defaults: `RETICLE_PORT` or `4400`, and `RETICLE_HOST` or this machine. For another machine, give the pairing token in `RETICLE_TOKEN`. |
| `--sandbox linux` | With `--app <name> --open "<command>"`: start a container with an X screen in memory, start the application there, and join the daemon of this machine. Needs Docker. |
| `--sandbox stop` | Stop that container. |

## Permissions

* **macOS:** System Settings, Privacy & Security, Accessibility. Switch on the terminal that runs the command, then start the terminal again. `reticle_screenshot` also needs Screen Recording.
* **Windows:** nothing to give and nothing to install.
* **Linux:** install `python3-gi gir1.2-atspi-2.0 gir1.2-gtk-3.0 xdotool` (Debian and Ubuntu). Install `xprintidle` to make the realm wait while the person types.

## What the person sees (macOS)

* **The realm's own pointer.** It goes to the element that the realm acts on. A click goes through it.
* **The HUD.** A circle at the bottom right. Press it to see the action that runs, the last actions and what each one did. **Pause** stops the realm until you press it again, and the agent is told why. **Stop** ends the realm and leaves the application.
* After **Stop**, the command writes `~/.reticle/computer.stopped`. No application is joined until you remove that file.

The realm does not read its own window and does not act on it, so an agent cannot press your buttons.

## The person's limits

An agent starts the command, so an agent picks its flags. Your limits are in `~/.reticle/computer.json`, and no flag lifts them:

```json theme={"dark"}
{ "backgroundOnly": true, "hud": true }
```

* `backgroundOnly` forbids the real pointer and real keys.
* `hud` keeps the HUD and the pointer on the screen, also with `--no-hud`.

The applications that an agent may open with `reticle_open_realm` are in a different file, `~/.reticle/computer-open.json`:

```json theme={"dark"}
{ "open": ["TextEdit", "Mail"] }
```

An agent adds an application to that list only when you say yes. An agent never changes `computer.json`. A program with a shell can change a file, so these files say what you want. They are not a wall.

## Actions and the foreground

The realm acts in the background. A press is an accessibility action, and text goes to the application, not to the screen. Your pointer does not move.

Some actions need the real pointer or the application in front: `dblclick`, `hover`, `drag`, `focus`, the menu bar of an application that is not in front, and a control that takes only a real click. Give `args: { foreground: true }` on that one action. The realm brings the application to the front, does the gesture, and puts the pointer and the front application back. It waits until the person has not typed or moved the pointer for a moment. A refusal says when an action needs the foreground.

| Argument | Meaning |
| - | - |
| `point: { x, y }` | A point of the last `reticle_screenshot`, in the pixels of the picture. For an application that gives no elements. |
| `at: { x, y }` | A point in the element's box, as fractions from 0 to 1. Not pixels. |
| `toRef`, `toPoint`, `to` | The end of a `drag`: another element, a point of the picture, or a fraction of the element's box. |
| `path: [{ x, y }, ...]` | A `drag` through each point of the picture, as a brush or a lasso does. |
| `foreground: true` | Use the real pointer or real keys for this action. |

See [Actions](https://docs.reticle.sh/actions.md) for the full list.

## Evidence

Each action reports what it changed on the screen. An action that changed nothing is a result of its own. These signals prove more than the screen does:

| Signal | What it says |
| - | - |
| `file.written` | A file in a folder given with `--watch` was written. |
| `disk.wrote` | The application's processes wrote bytes to disk. The operating system keeps the count. |
| `settings.changed` | A setting of the application changed, with its key and values. |
| `clipboard.changed` | The clipboard changed. The realm never reads what is on it. |

```json theme={"dark"}
{ "until": { "kind": "signal", "name": "file.written", "dataMatches": { "file": "note.txt" } } }
```

## The browser and the computer together

`reticle_attach_tab` joins a tab of your own Chromium browser as a session, next to a desktop session. Start the browser with `--remote-debugging-port` (default `http://127.0.0.1:9222`, or `RETICLE_CDP_URL`). `reticle_session { action: "board", carry }` moves a value from an element of one session into another and says whether it arrived. See [Open and close a realm](https://docs.reticle.sh/tools/realms.md).

## Limits

* **The screen must not be locked.** A locked macOS screen gives no window of any application. The realm says that the screen is locked.
* **Only the Space in front.** An application on another Space reads as an application with no window. Bring it to the front.
* **The menu bar needs the application in front.** Use `focus` first.
* **Linux on Wayland.** A Wayland session takes no input from a program. The realm still reads and acts through the accessibility interface (press, fill), and refuses a step that needs the real pointer, with the reason.
* **An application with no elements** (a canvas, a game) is read as a picture. On macOS the picture comes with the words in it and their boxes, read on the machine.
* **The tree is the application's own word.** Watch a folder and name the file when the action writes one.

The [README of the package](https://github.com/reticlehq/reticle/blob/main/adapters/realm/computer/README.md) has every limit, and [Troubleshooting](https://docs.reticle.sh/troubleshooting.md#the-computer-realm) has the fixes.


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