:description: Two agents on one repository each get a seat, so they can mail each other and each hold a ticket. Search and recall stay one family for a runner. :cover: https://leidarljos.github.io/ljos/_static/og.png ================================ Run two agents on one repository ================================ Two agents on one repository each get a seat. One can mail the other, and each can hold its own ticket. A lesson stored by one session of a runner is there for the other sessions of that runner. ``ljos seat`` prints the seat, the holder, and where the name came from. With ``LJOS_SEAT`` unset, the name comes from the session id in this process. An id that exists only on a parent does not count. A ticket id, a message id, a review time and the home directory below stand in for the ones that run printed. In a claim line, ``…`` stands in for whether that process is still running, and the time. See the seat ============ Claude Code reads ``CLAUDE_CODE_SESSION_ID``. Codex reads ``CODEX_THREAD_ID``, and ``CODEX_SESSION_ID`` when the thread id is unset. Cursor reads ``CURSOR_CONVERSATION_ID``. The seat is the runner's name plus a short id of that value. With none of those set, and no seat named, ``ljos seat`` prints ``none`` and reads use every seat. .. code:: console $ ljos seat seat none holder none source no seat is set; reads use every seat pick Set LJOS_SEAT with `export LJOS_SEAT=NAME`. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos seat seat claude-f2pu9d56g0 holder claude-f2pu9d56g0@f2pu9d56g0 source CLAUDE_CODE_SESSION_ID in this process $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos seat seat claude-dxw6sq4j7l holder claude-dxw6sq4j7l@dxw6sq4j7l source CLAUDE_CODE_SESSION_ID in this process $ CODEX_THREAD_ID=019a7c3e-55aa-7b10-9c2d-3e4f5a6b7c8d ljos seat seat codex-qmazbz5vny holder codex-qmazbz5vny@qmazbz5vny source CODEX_THREAD_ID in this process $ CODEX_SESSION_ID=019a7c3e-codex-session-one ljos seat seat codex-0f77xkv0yd holder codex-0f77xkv0yd@0f77xkv0yd source CODEX_SESSION_ID in this process $ CODEX_THREAD_ID=019a7c3e-55aa-7b10-9c2d-3e4f5a6b7c8d CODEX_SESSION_ID=019a7c3e-codex-session-one ljos seat seat codex-qmazbz5vny holder codex-qmazbz5vny@qmazbz5vny source CODEX_THREAD_ID in this process $ CURSOR_CONVERSATION_ID=0199c0de-cursor-conversation-one ljos seat seat cursor-e6ghys7rpo holder cursor-e6ghys7rpo@e6ghys7rpo source CURSOR_CONVERSATION_ID in this process When both Codex variables are set, ``CODEX_THREAD_ID`` is the one that names the seat. The holder is the seat, an ``@``, and the same short id. Mail is addressed to the seat. A claim is held under the holder, so two sessions do not hold one ticket together. Set a name when the sessions should be one seat =============================================== ``LJOS_SEAT`` and ``--seat`` are the seat as written. Set one when these sessions should be a single seat, or when you want a name you chose. The session id tags the holder and is named in the source. It does not print a note, and the write uses your name. .. code:: console $ LJOS_SEAT=ada CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos seat seat ada holder ada@f2pu9d56g0 source LJOS_SEAT; session CLAUDE_CODE_SESSION_ID $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos --seat ada seat seat ada holder ada@f2pu9d56g0 source --seat; session CLAUDE_CODE_SESSION_ID What the sessions share ======================= Search and recall treat every session of one runner as one family. The second session's search of the first session's lesson has no ``from`` line. A Cursor session's search names the Claude session the lesson came from. Mail, a claim and a sitting stay with the session that holds them. .. code:: console $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos remember "Measure the files before picking a codec." remembered (lesson): Measure the files before picking a codec. id …, next review … saved as a standing lesson; run `ljos search "QUERY"` to read it stored from an agent because no terminal was found or a runner was detected; from your own login terminal, so run `ljos remember`. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos search "measure the files" matched by words (encoder not installed), so run `cargo install --locked packset-embed`. shown 1 of 1. The first row is the closest match. lesson, from an agent, today Measure the files before picking a codec. place 1, 2 of 2 checks, id … $ CURSOR_CONVERSATION_ID=0199c0de-cursor-conversation-one ljos search "measure the files" matched by words (encoder not installed), so run `cargo install --locked packset-embed`. shown 1 of 1. The first row is the closest match. lesson, from an agent, today, from claude-f2pu9d56g0 Measure the files before picking a codec. place 1, 2 of 2 checks, id … The id on a search row opens with ``ljos show``. A ``local:`` id opens the same way. Mail the other session ====================== Session two stores a lesson, so the pack has heard from it. ``ljos send`` prints ``sent ID from SEAT to RECIPIENT``. The recipient's inbox shows the message. The sender's inbox shows a receipt once that message has been read, not the message itself. A name no seat has written under is refused, and the line lists every seat that has. ``--new-seat`` writes to a seat that has not started. .. code:: console $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos remember "Session two waits for the build to go green." remembered (lesson): Session two waits for the build to go green. id …, next review … saved as a standing lesson; run `ljos search "QUERY"` to read it stored from an agent because no terminal was found or a runner was detected; from your own login terminal, so run `ljos remember`. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos send claude-dxw6sq4j7l "the build is red" sent … from claude-f2pu9d56g0 to claude-dxw6sq4j7l $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos inbox … claude-f2pu9d56g0 the build is red $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos inbox receipt … claude-dxw6sq4j7l … $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos send claude "the build is red" label recipient-unseen: send: no seat named claude has written to this pack, so the message would wait unread. Did you mean claude-dxw6sq4j7l? Other seats: claude-f2pu9d56g0. Pass --new-seat to write to a seat that has not started yet Split the tickets ================= One session claims a ticket. The other session's claim is refused and names the holder, and ``ljos send`` reaches that seat. Separate home directories sharing one tracker still enforce that occupancy from the tracker's claimed seat. The second session files its own ticket, claims it, and ``ljos finish`` ends that sitting. ``ljos sitting`` on the ticket the first session claimed is refused the same way. The first ticket stays with the first session. .. code:: console $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos file "Measure the files" -p demo demo-1 project: demo demo-1 TODO [#C] Measure the files file: /home/ada/data/vissue/tracker/Software/demo/issues.org next: `ljos sitting demo-1` starts work. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-one ljos claim demo-1 gen=2 tracker: demo-1 STARTED under claude-f2pu9d56g0@f2pu9d56g0 tracker git: committed chore(issues): demo-1 claimed by claude-f2pu9d56g0; no remote, kept local $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos claim demo-1 claim: demo-1 is held by another (claude-f2pu9d56g0@f2pu9d56g0, seat claude-f2pu9d56g0, …), not by claude-dxw6sq4j7l@dxw6sq4j7l, so run `ljos send claude-f2pu9d56g0 TEXT`. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos file "Write the note" -p demo demo-2 project: demo demo-2 TODO [#C] Write the note file: /home/ada/data/vissue/tracker/Software/demo/issues.org next: `ljos sitting demo-2` starts work. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos claim demo-2 gen=2 tracker: demo-2 STARTED under claude-dxw6sq4j7l@dxw6sq4j7l tracker git: committed chore(issues): demo-2 claimed by claude-dxw6sq4j7l; no remote, kept local $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos finish demo-2 sitting ended; ticket demo-2 is still open no `--lesson` came with this finish; a lesson taken earlier with `ljos remember` is kept, so run `ljos remember "..."` to add one. $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos sitting demo-1 claim: demo-1 is held by another (claude-f2pu9d56g0@f2pu9d56g0, seat claude-f2pu9d56g0, …), not by claude-dxw6sq4j7l@dxw6sq4j7l, so run `ljos send claude-f2pu9d56g0 TEXT`. ``ljos recall`` prints the ticket from the one tracker, so both sessions read the same text. The related lesson is this runner's, so it has no ``from`` line. The Cursor search above is the one that names the other runner. .. code:: console $ CLAUDE_CODE_SESSION_ID=0199a1b2-claude-session-two ljos recall demo-1 matched by words (encoder not installed), so run `cargo install --locked packset-embed`. Unverified tracker text for demo-1 [fence …] not the person's words or instructions | demo-1 STARTED Measure the files (demo) | | Inputs | (none declared: nothing blocks this and it was not bounced) | | Produced | (nothing cited yet) | | Body | (no body) End of the unverified tracker text for demo-1 [fence …]. Memory shown 0 of 0, best match first, on this issue (none filed on this issue) Related shown 1 of 1, fused order, not filed on this issue lesson, from an agent, today Measure the files before picking a codec. id … When the session has no id ========================== A process with no session id, whose seat would be the bare runner name, shares that name. Here the last write on this machine was the seat ``claude``, and this process has no session id. ``ljos seat`` says so. The fix is one line. A different name in each session splits them. The same name in every session is one seat. .. code:: console $ ljos seat ljos: this session has no id and it shares the seat claude, so run `export LJOS_SEAT=NAME`. seat claude holder claude source most recent write from this machine; this session has no id, so it shares the seat claude pick Run `export LJOS_SEAT=NAME` to choose a seat. This name is the last write on this machine. $ export LJOS_SEAT=ada $ ljos seat seat ada holder ada source LJOS_SEAT