On Windows, Paneflow runs as three processes under your account and talks to them
over named pipes. It needs Windows 10 October 2018 or later and an x64 PC; Windows
on ARM64 is coming soon. This page describes Paneflow 0.20.0.

## Processes

| Process | Program | Runs | Stops |
| --- | --- | --- | --- |
| Window | `paneflow.exe` | The app, and every `paneflow` command. | When you close it. |
| Host | `paneflow-host.exe` | Every terminal session, through ConPTY. | When you quit with no live session, choose **Stop everything**, or run `paneflow host stop`. |
| Worker | A copy of `paneflow.exe` | Layouts, the event log, `init.lua` and actions. | When you run `paneflow serve stop`, or a new version replaces it. |

The window starts the host and the worker when it opens, and a `paneflow` command
starts them when it needs them. The worker runs from a copy of `paneflow.exe` in
`%USERPROFILE%\.paneflow\serve\runtime\`. Both run detached from the window and
never stop when idle, so terminals can keep running after the window closes.

Paneflow doesn't start with Windows. It installs no service, no sign-in entry and
no scheduled task; the next window or `paneflow` command starts what's missing.

## Quitting and stopping

When you quit with live sessions, the `on_quit` setting decides what happens:

| `on_quit` | On quit |
| --- | --- |
| `"ask"` | Asks, with **Keep sessions running** and **Stop everything and quit**. The default. |
| `"keep"` | Closes the window and leaves the host and its sessions running. |
| `"stop"` | Stops every session, then the host. |

From a terminal:

```sh
paneflow host stop
paneflow host stop --force
paneflow serve stop
```

`paneflow host stop` refuses while sessions are live and lists them. `--force`
ends them all first. `paneflow serve stop` gives the worker up to 5 s to finish
and leaves terminals untouched.

Stopping a session on Windows terminates every process in it at once, children
first. Programs get no signal to clean up, as they would on Linux or macOS.

## Named pipes

| Pipe | Served by |
| --- | --- |
| `\\.\pipe\paneflow` | The window |
| `\\.\pipe\paneflow-host-<hash>` | The host |
| `\\.\pipe\paneflow-serve-<hash>` | The worker |

`<hash>` is 16 hex digits computed from the path of your Paneflow home,
`%USERPROFILE%\.paneflow` or an absolute `PANEFLOW_HOME`. With another home, the
window's pipe becomes `\\.\pipe\paneflow-ipc-<hash>`, so two homes never collide.

Only your account can open the host and worker pipes. The window's pipe also
admits SYSTEM and administrators. Paneflow also checks that a process connecting
to it runs as your user.

## Administrator rights

Paneflow neither asks for administrator rights nor drops them. Terminals run with
the rights of the process that started the host:

- Open Paneflow with **Run as administrator** while no host is running, and its
  terminals run as administrator too.
- A window that finds a host already running uses that host, with its rights.

To switch, quit with **Stop everything** or run `paneflow host stop`, then open
Paneflow the way you want. Installing the MSI and installing an update ask for
administrator approval, because Paneflow is installed for every user of the PC.

## Logs

| Process | Log |
| --- | --- |
| Host | `%USERPROFILE%\.paneflow\host\host.log`, at the `info` level |
| Worker | `%USERPROFILE%\.paneflow\serve\serve.log`, at the `warn` level |
| Window | None. It writes to the console it was started from. |
| Updates | `%TEMP%\paneflow-msi-<pid>.log` and `%TEMP%\paneflow-msi-relay-<pid>.log` |

The host and worker logs are never rotated or trimmed. Delete them when they grow
too large. Set `RUST_LOG` before starting Paneflow to change the level. Paneflow
writes nothing to the Windows Event Log.

## Terminals and shells

Each terminal runs the first shell found in this order:

1. `pwsh.exe`, looked up in `Program Files\PowerShell`, the Microsoft Store,
   Scoop, then `PATH`.
2. `powershell.exe` on `PATH`, then Windows PowerShell in `System32`.
3. `%ComSpec%`, then `cmd.exe`.

To change it, set `default_shell` in `paneflow.json`, or pick **PowerShell**,
**Windows PowerShell**, **Command Prompt** or **Git Bash** in Settings:

```json
{ "default_shell": "cmd.exe" }
```

`default_shell` is a program name or path, without arguments. A bare `bash`
resolves to Git Bash before anything on `PATH`. When the program can't be found,
Paneflow starts the fallback above and says so.

PowerShell gets a small startup script from Paneflow that reports the current
directory and marks each prompt. `cmd.exe` gets none.

### Environment

Terminals inherit the environment Paneflow started with. Paneflow sets these on
top:

| Variable | Value |
| --- | --- |
| `TERM` | `xterm-256color` |
| `COLORTERM` | `truecolor` |
| `TERM_PROGRAM`, `TERM_PROGRAM_VERSION` | `ghostty` and its version |
| `LANG` | `en_US.UTF-8`, when Paneflow itself has no `LANG` |
| `PANEFLOW_*` | The ids Paneflow's CLI and agents use |

A variable you add in Windows Settings reaches new terminals without a restart.
`PATH` is the exception: Paneflow builds it from its own `PATH` when it starts, so
quit and open Paneflow again after you change it.

### WSL

Set `default_shell` to `wsl.exe` to open WSL in every new terminal. It opens your
default distribution; there's no setting to pick another.

## Agents on Windows

The MSI installs launch shims in `%ProgramFiles%\PaneFlow\bin` for `claude`,
`codex`, `opencode`, `pi`, `hermes`, `grok`, `amp`, `gemini`, `copilot`, `droid`,
`openclaw` and `muse`. Paneflow puts that folder first on each terminal's `PATH`,
so starting an agent goes through its shim and Paneflow can follow it. A shim finds
the real agent as `<name>.exe` or `<name>.cmd`.

Hook integrations, which report an agent's state in detail, exist on Windows for
Claude Code, Codex, Amp, Gemini and GitHub Copilot.

## Installed files

The MSI installs Paneflow for every user, in `%ProgramFiles%\PaneFlow`:

- `paneflow.exe` and `paneflow-host.exe`, with the helpers in `bin\`.
- The install folder added to the system `PATH`, so `paneflow` works in any
  terminal.
- A **PaneFlow** entry in the Start menu. No file associations.

Paneflow keeps its own state in `%USERPROFILE%\.paneflow`: `paneflow.json`,
sessions, logs, the worker's copy and a cached copy of ConPTY. Uninstalling leaves
that folder in place. An upgrade stops the host first; see
[Upgrading](/docs/upgrading).

## Not available on Windows

| Feature | On Windows |
| --- | --- |
| Sandboxed agent profiles (`"sandbox": "paneflow"`) | Linux only. The profile doesn't start, and Paneflow says why. |
| Stopping terminal programs gracefully | Every process is terminated at once. |
| Loading the environment of a login shell | Terminals keep the environment Paneflow started with. |
| tmux compatibility for Claude Code agent teams | Not installed. |
| Program resume tokens | Not given to Windows terminals. |
| Hook integrations for other agents | Only the five listed in [Agents on Windows](#agents-on-windows). |
| Windows on ARM64 | Coming soon. |