---
title: Data on disk
description: What Wain keeps in ~/.wain, bots and your sign-in included, what goes when you delete a session, the environment variables you can set, and where each agent keeps its own data.
sidebar:
  order: 3
---

Wain keeps everything on your machine, in one folder: `~/.wain`. Transcripts, the session list, attachments, bots, settings, your Wain sign-in and the browser's profiles all live there. A Linux server keeps its own `~/.wain` with the sessions that run on it.

The folder is readable by your user alone, and Wain does not upload it. For what does leave the machine, such as the alerts sent to your iPhone, see [Privacy](/docs/reference/privacy).

## What's in ~/.wain

| Path | What it holds |
|---|---|
| `sessions/<session-id>.jsonl` | One file per session: the whole transcript, one event per line. The only copy Wain keeps. |
| `sessions/index.json` | The session list: each session's title, project, working directory, agent, model and flags. |
| `attachments/<session-id>/` | A copy of every image you sent in that session, so the transcript still shows it after you delete the original. Other files are not copied; the prompt names them by path. |
| `drafts.json` | Tasks you saved with `⌘S` and have not started. |
| `projects.json` | Attached projects, and which one was last selected. |
| `bots/<id>/` | One folder per bot, where its chat runs: its instructions in `AGENTS.md`, its skills under `.claude/skills`, its memories in `memory/`, the documents it writes for you in `docs/`, and a git history of every change. Deleting the bot deletes the folder. See [Bots](/docs/using-wain/bots). |
| `bots.json` | The list of bots: each one's name, face and folder. |
| `routines.json` | Every bot's [routines](/docs/using-wain/bots#routines): what each runs, when, and its last result. |
| `account.json` | Your Wain sign-in: who you are signed in as, and the credential that proves it to wainhq.com (`0600`). Signing out deletes it. See [Sign in](/docs/get-started/install#sign-in). |
| `org-link.json` | This machine's link to your org at wainhq.com, with its own credential (`0600`). See [Link to an org](/docs/cli/servers#link-to-an-org). |
| `push.json` | The iPhones that asked this server for alerts, by a sealed handle, and which kinds each turned off. |
| `settings.json` | The analytics install id, your dictation model and microphone, the Linear account name, and whether Remote access and **Share these servers** are on. |
| `credentials.json` | Your Linear API key and the tokens for servers you added by address. Readable by your user alone (`0600`). |
| `servers.json` | The remote servers in Settings → Servers, or the machines `wain machine` added on a server with no app: name, address, channel. Tokens are in `credentials.json`, not here. |
| `server-cache/` | What the app last saw of each remote server's sessions, so they stay in the sidebar while it is offline. |
| `models/` | Dictation models you downloaded in Settings → Transcription. |
| `recordings/` | Dictation audio, kept only while a transcription failed so you can retry it. Removed once the model answers, and pruned after 7 days. |
| `browser/<session-id>/` | Each session's browser profile: cookies, cache, history. |
| `browser/recordings/<session-id>/` | Videos an agent recorded of a session's browser, or filed with `wain video add`, and screenshots filed with `wain image add`. |
| `cef/<version>/` | The Chromium framework Wain's browser runs on, downloaded after the first launch. |
| `chromium/` | The headless browser `wain browser` drives where the app's own browser is not open, such as on a Linux server. |
| `pi-sessions/` | pi's own transcript of each pi session, which is how pi resumes it. |
| `opencode-rules/` | The instructions Wain gives each OpenCode session, written again each time it starts. |
| `opentunnel/`, `tunnel-url` | The identity behind your Remote access and share addresses, and the current address. Deleting `opentunnel/` gives you new addresses. |
| `serve-token` | The token other Macs use to reach this one through Remote access (`0600`). |
| `serve-port`, `serve.lock`, `wain.sock` | The running server's port, its lock, and the socket the `wain` command talks to. |
| `server.log` | The background server's log, Remote access and public links included. It starts over once it passes 10 MB. See [Troubleshooting](/docs/reference/troubleshooting#logs-and-parse-failures). |
| `parse_failures.jsonl` | Lines from an agent CLI that Wain could not read, with the raw line. Safe to delete. |

Your composer picks, theme, shortcuts, spaces list and other app preferences are not in `~/.wain`. They live in the app's own storage on this Mac.

Outside `~/.wain`, Wain also writes:

- **Worktrees**, inside the project: `<project>/.claude/worktrees/<name>`, on a branch `worktree-<name>`. See [Worktrees](/docs/using-wain/worktrees).
- **The login item** that starts the background server: `~/Library/LaunchAgents/com.wainhq.wain.server.plist`. The app writes it on every launch.
- **On Linux, where the app is:** `~/.local/share/wain/appimage` names the AppImage or binary you run, written on every launch, so the `wain` CLI knows the app is installed.
- **The `wain` CLI**: `~/.local/bin/wain`, which the app puts there on every launch, and its skill in `~/.claude/skills/wain/`, `~/.codex/skills/wain/` and `~/.agents/skills/wain/`.

## What goes when you delete a session

Deleting a session removes, from this machine:

- its transcript and its row in the session list,
- its attachments,
- its browser profile and any browser recordings,
- pi's copy of the conversation, for a pi session,
- its worktree and the worktree's branch, if it had one,
- any hidden sessions it started, except the tasks a bot's task started, which keep running and report to the nearest task or bot still open.

It does not remove the agent's own record of the conversation. Claude Code, Codex, fx, Grok Build and OpenCode keep their own transcripts in their own folders (below). A pushed branch and any pull request stay on GitHub.

**Settling** a session is not deleting it. Settle stops it and removes its browser profile, so it starts signed out of websites if you unsettle it. The transcript, attachments and worktree stay until you delete the worktree or the session. A bot's task is the exception: settling it or merging its pull request in the app deletes its worktree. See [Sessions](/docs/using-wain/sessions).

## Environment variables

You rarely need these. Set them in the environment that launches Wain or the `wain` command. The Mac app opened from the Dock or Finder does not read your shell's variables, so start it from Terminal to use one:

```bash
WAIN_HOME=~/wain-test /Applications/Wain.app/Contents/MacOS/wain
```

The app passes `WAIN_HOME` and `WAIN_NO_ANALYTICS` on to the background server it starts.

| Variable | Read by | What it does |
|---|---|---|
| `WAIN_HOME` | App, server, `wain` | Uses another folder instead of `~/.wain`, with its own sessions, settings and socket. Two Wain servers must never share one folder: each overwrites the other's session list. On a Mac, the browser profiles and Chromium stay in `~/.wain` either way. |
| `WAIN_NO_ANALYTICS` | App, server | Turns analytics off for that run, and is the only way to. Any value counts, even `0`. See [Privacy](/docs/reference/privacy). |
| `WAIN_ENDPOINT` | `wain` | Which Wain the CLI talks to: a socket path. Wain sets it for every agent it runs, so an agent's `wain` calls reach the right app. |
| `WAIN_SESSION_ID` | `wain` | The session the CLI acts for. Wain sets it for every agent it runs. |
| `WAIN_CHANNEL` | `install.sh` | `stable` (default) or `beta`. Which releases the installer picks. |
| `WAIN_VERSION` | `install.sh` | Install one exact release tag instead of the newest. |
| `WAIN_INSTALL_DIR` | `install.sh` | Where the binaries go. Default `~/.local/bin`. |

`wain update` keeps the channel of the version you have. Use `wain update --channel beta` or `--channel stable` to move. See [the wain CLI](/docs/cli).

## Where agents keep their own data

Wain runs each agent's own CLI and does not store agent logins. Each agent keeps its sign-in, settings and transcripts in its own folder:

| Agent | Folder |
|---|---|
| Claude Code | `~/.claude` (transcripts in `~/.claude/projects`) |
| Codex | `~/.codex` |
| pi | `~/.pi/agent` |
| fx | `~/.fx` |
| Grok Build | `~/.grok` |
| OpenCode | `~/.local/share/opencode`, settings in `~/.config/opencode` |
| GitHub CLI | `gh`'s own config. Wain uses it for pull requests and GitHub issues and stores no GitHub token. |

Signing in from Settings → Agents runs the agent's own login, so the credential lands in that agent's folder. Two exceptions write there on your behalf:

- **pi:** an API key you add in Settings → Agents is written to `~/.pi/agent/auth.json`, pi's own store.
- **fx:** Wain sets `session_titles` in `~/.fx/settings.json` when it creates an fx session, and `provider` when you pick one. That file is fx's global setting, so it also changes what your fx terminal uses.

See [Agents and accounts](/docs/settings/accounts).

## Limits

- Nothing cleans up `parse_failures.jsonl`; it grows until you delete it.
- A dictation model removed from Wain's list in a later version stays in `models/` with no button to delete it. Delete the file by hand.
- If removing a worktree fails while deleting its session, the folder stays behind. Remove it with `git worktree remove <path>` in the project.
- There is no export. To back up, copy `~/.wain`.
