# Loom: any harness picks up any session

> Loom moves agent sessions out of the apps and into the operating system. Claude Code and Claude Desktop, Codex CLI and Codex Desktop, pi, Antigravity and OpenClaw work from one ledger the OS owns.

Status: P0 ingest live · P1 presence built and tested · P2 takeover next. Part of [ALINA OS](https://alinaos.com/). Written in Rust, ledger in SQLite, declared in NixOS. Source private for now.

## Vocabulary

- **Thread**: the portable session. An append-only event ledger, the worktree it changes, and a lease that says who is driving.
- **Shuttle**: the adapter that carries a thread into or out of one harness.
- **Baton**: the compiled handoff packet: goal, plan, decisions, what was tried and failed, world state, the last turns, and a pointer to full history.

## Architecture

- Full mesh with no hub harness: five shuttles pair through one canonical schema; a pair works if both shuttles pass the same round-trip test.
- Loom never runs on a harness runtime; uninstalling one harness leaves the rest working.
- Ingest is read-only: it tails each harness's own session files and lifecycle hooks.

## What moves in a handoff

| Layer | Holds | Moves? |
|---|---|---|
| Intent | goal, plan, decisions, what failed | fully |
| World | worktree, diff, processes, tests | by construction (the OS owns it) |
| Transcript | messages, tool calls | translated; foreign tool calls become text summaries |
| Model internals | KV cache, reasoning signatures | never; the baton replaces them |

## Presence (P1)

Loom's MCP server and lifecycle hooks are merged into each harness's configuration on every rebuild. Tools: `loom_list` (with live presence), `loom_read`, `loom_search`, `loom_watch` (long-poll a thread live), `loom_post` (notes for the driver, delivered in P2). In testing, Codex followed a Claude session turn by turn.

## Safety

- Provenance on every event; untrusted text (web, tool output, relayed chat) is quoted as data, never promoted to instructions.
- OpenClaw is never a lens: its agents answer chat channels, so they never get a tool that reads every transcript. OpenClaw sessions are still ingested and linked.
- One driver, many watchers: only the lease holder writes to the worktree.
- The ledger stays local and never syncs to shared memory.

## Roadmap

- P0 Schema and timeline: live.
- P1 Presence: built and tested.
- P2 Takeover: leases, baton compiler, native egress to every harness, "continue in…" hotkey, per-turn filesystem snapshots.
- P3 Hot attach: drive the same running agent from several UIs where allowed; phone as a lens.
- P4 Autonomy: relay policies across harnesses; cross-vendor shadow reviewer.
