v1.20.64see what's new →

How-to

Search every agent transcript from one place

The debugging trail, the abandoned attempt, the one command that worked last week — every run writes a transcript to a local store, indexed by content and project. agents sessions searches it across Claude, Codex, Gemini, and OpenCode.

Pass a query to search this project by topic, file path, or command; pass a session id to open one.

agents sessions "stripe webhook signature"       # search this project
agents sessions "deploy script" --all            # search every directory
agents sessions a7f3e2c1 --markdown              # replay as markdown
agents sessions a7f3e2c1 --include user          # just the user turns

--markdown renders user, assistant, thinking, and tool calls with secrets redacted by default. Narrow the replay with --include/--exclude <roles> or --first/--last <n> turns. The search reaches across every agent — one query, every CLI's history.

Live sessions

--active shows what is running right now across terminals, teams, cloud, and headless runs, grouped by directory. Each row carries a live state:

agents sessions --active           # everything running now, by directory
agents sessions --active --waiting # only sessions blocked on your input

Focus a live session

sessions focus jumps you into a running session — it attaches the terminal the session lives in, or opens a new tab and resumes it. Omit the id for an interactive picker.

agents sessions focus 80289224      # attach or resume a running session
agents sessions focus --attach-only # attach only, never open a new tab

Query another machine

--host <name> runs the query on a remote machine's own index over SSH — no sync needed, SSH access is the only auth. Repeat it to fan the same query across several machines.

agents sessions "auth bug" --host yosemite-s1              # one remote index
agents sessions "deploy script" --host box-a --host box-b   # fan out
agents sessions --active --local                            # this machine only

History also syncs across the fleet via CRDT merge, so a session started on one machine is readable everywhere.

Try it

curl -fsSL agi-cli.sh/install.sh | sh