v1.20.64see what's new →

Sessions · index + cross-device

August 10, 2026

Agents do not share a brain. Each conversation is a transcript on disk. agents sessions builds a per-machine SQLite + FTS5 index, then answers filtered queries — locally or on other machines over SSH. Command: agents.

Visual longform: shareable HTML edition. Hands-on recipe: recall and resume.

Not shared memory

When someone asks how agents “share memory” across devices, the honest answer is: they don’t. They query. Claude, Codex, Grok, Kimi each write their own transcripts. AGI CLI is the read API over those files — search, filter, fan out, optionally export.

# Agent mid-turn recall
agents sessions --all --since 7d "secrets unlock" --flat -n 20
agents sessions a1b2c3d4 --markdown --include user,assistant --last 5

How indexing works

Each machine maintains ~/.agents/.history/sessions/sessions.db (WAL SQLite):

agents sessions --roots --json --local
sqlite3 ~/.agents/.history/sessions/sessions.db \
  "SELECT COUNT(*) FROM sessions;"

Cross-device query

No multi-master memory. Cross-device means: run the same query on the peer over SSH, merge rows tagged by machine.

ModeBehavior
--localThis machine only
--device zionExplicit peer(s) over SSH
Default listFan-out to online fleet from devices registry
import --from-hostCopy transcripts into a machine-tagged mirror
sessions syncOptional R2 CRDT — opt-in, off by default

Peers answer with AGENTS_SESSIONS_LOCAL=1 so they do not re-fan-out. Unreachable hosts are skipped (or cache-replayed for explicit device queries). Auth is SSH only.

Filters that matter

agents sessions --all --since 7d "auth middleware" --flat -n 20
agents sessions --agent claude --project agents-cli
agents sessions --active --device zion
agents sessions --include tools --agent codex --since 7d
agents sessions a1b2c3d4 --markdown --last 3 --include user,assistant

Typical local list/search is sub-second; single-device SSH is often under a second on a healthy tailnet — fast enough for mid-turn recall.

Export / import

Portable NDJSON bundles hand off transcripts without requiring R2 sync. Import lands under a mirror keyed by origin machine; local live sessions are never clobbered. Byte-exact duplicates skip.

agents sessions export --since 7d -o week.bundle
agents sessions import week.bundle --dry-run
agents sessions import --from-host zion --since 7d
agents sessions export --since 7d --stdout --encrypt \
  | agents ssh boxB 'agents sessions import - --decrypt'

Query never copies files. Import materializes them for offline search later. Neither is shared memory.

Cookbook

# What did zion do this week?
agents sessions --all --since 7d --device zion --flat -n 50

# Resume by id (local index first, then fleet)
agents resume a1b2c3d4

# Team-spawned sessions
agents sessions --teams

# Live across the fleet
agents sessions --active

Further reading