pi-daemon keeps Pi agents in durable sessions that no process owns — not the terminal you started one from, not the client watching it, not even the daemon serving it. Close the laptop, restart the host or upgrade it mid-turn: each session carries on from its last commit, and any client on any machine can pick it up.
1 file
is a whole session: its chats, tasks and questions. Copy it to move it.
0
processes per session: a worker per profile runs them, and an idle session is a closed file
5
ways to attach and detach freely: Culture, pi-client, editors, applications and the browser
100 ms
the most a crash can take back; the rest resumes by itself
01Many lifetimes
One session, many lifetimes
A Pi in a terminal lives exactly as long as its process. A pi-daemon session lives in its own Pi Durable store instead, so nothing that touches it — a client, a worker, the daemon, the machine’s uptime — decides how long it lasts. Clients attach and detach; processes start, crash and restart; the session simply continues.
Fig. 1.1The red band is the session. Every other lifetime is shorter, and none of their gaps is the session’s.
Free of its clientStart a session from pi-client on your laptop, answer its question from Culture on your phone, let an application send it the next turn. Detaching never stops anything.
Free of its processNo process belongs to a session. A worker per profile runs whatever is working; an idle session costs a closed file and a catalog row.
Free of the daemon’s uptimeRestarting or upgrading the daemon is a resume: unfinished work picks up where it was committed, with no client action.
Free of the machineA session is one SQLite file. Back it up or move it to another host by copying it.
02Crash-only
What happens when you kill it
The proof is the worst case. pi-daemon keeps no journal, ticket store or replay log of its own: it hands work to Pi Durable, which commits every input, model step and tool call before anything sees it, and it records which sessions still hold unfinished work so it can pick exactly those up again.
Fig. 1.2The turn runs once. The cut costs only the shaded window; the tool that cannot safely run twice is reported to the model as interrupted instead.
Accepted means keptAn input is in the store before the client hears it was accepted. It is answered, or reported unanswered, whatever happens to the process.
Retries are freeAHP turns become Durable submissions with the request id ahp:<clientId>:<turnId>. Sending a turn again after a reconnect finds the same submission.
Tools are honestA call’s intent is committed before it runs. After a crash only a tool declared replay: "safe" runs again; any other gets an interrupted result with its output so far.
Idle stays closedAt startup only sessions marked live in the catalog are opened. Thousands of idle sessions cost nothing until someone touches one.
03What it is
One daemon, a worker per profile, a store per session
One pi-daemon runs per user per machine, as an ordinary user service with one listener, one catalog and one bearer. The server process authenticates, keeps the catalog and routes; it never runs a model call, a tool, an MCP server or an extension. Each profile gets its own supervised worker process, which holds the Durable Harnesses of that profile’s sessions. A crashed worker restarts and resumes its sessions; the others never notice.
Fig. 1.3Many clients, one listener. Agent code lives only behind the hatched worker edges.
/ahpAgent Host Protocol 0.8The primary surface. Culture on every platform, Paratenic’s upstream connector and applications in any language list, create, prompt, steer and fork sessions. State is a projection of committed Durable state.
pi-clientTUI Pi, detachedpi-daemon’s own terminal client: TUI Pi’s transcript, editor, keys and footer over /chord, with every host’s sessions in one picker and sidebar.
/acpAgent Client ProtocolFor editors such as Zed: new and loaded sessions, prompts streamed as session updates, cancel, and agent questions as permission requests.
/chordDurable’s own viewsConversation views and agent events for JavaScript clients, with ChordClient in the package, pi-client and a small /web page on top.
Every path except /healthz and /readyz needs the instance’s bearer, checked before any route runs. All three surfaces reach the same sessions, so you can start a turn from an application, watch it in Culture and answer its question from an editor.
It has no wake, tickets, schedules, nudges, deadlines or delivery receipts. Applications express those as ordinary turns, cancels and session lifecycle, and bring behaviour as a profile’s extension modules and MCP servers.
a sandbox
A worker is one trust domain and every client of an instance shares its bearer. Mutually untrusted work needs another uid, a container or a remote execution environment.
a home for TUI sessions
Pi Daemon sessions and the sessions of pi in a terminal are separate pools. Nothing is imported or exported between them.
0.3.x
1.0 is a rebuild on Durable with no compatibility: the Session API, NDJSON socket, Pi RPC host and wake tickets are gone, and old state is left untouched.
07Reading the drawings
One vocabulary on every page
Fig. 1.5Stores, tasks, submissions and commits are drawn the same way throughout.
08Start
From nothing to a session in Culture
Declare the service and a profile
services.pi-daemon = {
enable = true;
profiles.personal.cwdRoots = [ "~/src" ]; # sessions may only run here
};
Home Manager installs one per-user service, pi-daemon, and its watchdog, on systemd, launchd or Nix-on-Droid’s supervisord. It listens on 127.0.0.1:7463.
Check it and find the bearer
pi-daemon status # exits 0 once ready
ls -l ~/.local/state/pi-daemon/api-token # generated, owner-only
Point clients at the file; never paste the token into chat or a command line.
Add it to Culture
hosts:
- id: pi
label: Pi Daemon
url: ws://127.0.0.1:7463/ahp
token_file: ~/.local/state/pi-daemon/api-token
Your profile appears as an agent. Create a session under one of its cwdRoots and send a turn.
Or attach from any terminal
pi-client # every host’s sessions, in a picker
pi-client --new --name "Notes" # a new session, and attach
Quit whenever you like: the session keeps working, and you can pick it up again from anywhere.
These pages describe pi-daemon 1.3.1, of 18 October 2026: pi-client arrived in 1.3, module commands in 1.2, and tool approvals, terminals and changesets in 1.1.