1---2title: "Live mode"3sidebar_position: 34---56# Live mode78In live mode the agent works in your running 012 with you, as one more9person in the workbook: its pointer and name show in the grid, it reads10the workbook as it is on your screen, and what it changes arrives as a11suggestion you accept or reject, whole or cell by cell. Here claude12suggests March's food and power bills; the cells it would change carry13a ◇, and the context line says what it would put in the one under the14pointer, and why:1516171819It is [`012 serve`'s shared editing](../terminal/ssh.md#sharing-a-workbook)20with the agent as a participant: the session's workbook sits in a room,21every change goes through the workbook's one mutation path in the order22the room takes them, each attributed to whoever made it, so undo takes23back only your own and `012 diff` shows everyone's. The agent uses the24[MCP server's](mcp.md) tools, on this one workbook.2526Claude, attached to a household budget, points at the bills and27suggests March's figures; you review and accept them, answer its28question, and accept the line it then suggests:29303132## Starting3334Let agents in when you start, or from a session already running:3536```sh37012 --listen budget.01238```3940**File > Invite an agent** asks what the agent may change (its41[scope](#scope)), and starts listening if the session wasn't;42`--listen` lets it suggest changes to the whole workbook. **File > Stop43inviting agents** closes the socket: agents attached leave, and their44suggestions stay for you to settle.4546The agent's host runs `012 mcp --attach` as its MCP server, which joins47the session:4849```sh50claude mcp add --scope user 012-live -- 012 mcp --attach # Claude Code51012 mcp --attach # the only session listening52012 mcp --attach budget # the session with budget.012 open53```5455With no name, `--attach` joins the only session listening, or lists56them when there are several; a name picks the session by its workbook57(`budget`, `budget.012`) or its process id, and a path ending in58`.sock` names a socket. The agent's name in the grid is its host's59(`Claude Code`), as its MCP `initialize` request gives it.6061```mermaid62sequenceDiagram63 participant H as MCP host (the agent)64 participant A as 012 mcp --attach65 participant S as 012 --listen (your session)66 participant R as the room67 H->>A: initialize (its name)68 A->>S: the socket: hello, the agent's name69 S->>R: a seat for the agent70 S-->>A: welcome: the workbook, the scope71 H->>S: tools/call write_cells (through A)72 S->>R: a turn: the change made on a copy, checked against the scope73 R-->>S: a suggestion on the board, its cells marked on your screen74 S-->>H: the suggestion's number75 Note over S: you accept (Ctrl+Alt+A, Enter)76 S->>R: your turn: the cells set, one step in the agent's name77 R-->>H: the suggestions resource updated78```7980## In the grid8182The agent shows as the others in a shared workbook do, with a ◆ where83a person has their initial: on the header of the row its pointer is on,84before its name on the status line, and in **File > Who's here**, which85lists it with the word agent. Its pointer's cell is in its color, double86underlined. The agent moves it with the `focus` tool as it works, and87each change it makes or suggests puts it on the cells changed, so you88see where it's looking.8990## Suggestions9192What the agent changes waits as a suggestion unless you93[let agents edit directly](#direct-edits). A cell it would change has a94◇ in its top-left corner; with the pointer on one, the context line95says whose suggestion it is, what it would put there, what the cell96holds and the agent's message. The status line counts the suggestions97waiting.9899**Review suggestions** (Ctrl+Alt+A, or File > Review suggestions) lists100them at the right of the grid, by agent and message, each with its101cells; the grid shows the cell of the row highlighted:102103104105106| Key | On a suggestion | On one of its cells |107|---|---|---|108| Enter, A, or click ✓ | Accept all it has waiting | Accept the cell |109| R, Del, or click ✗ | Reject all it has waiting | Reject the cell |110| Shift+A, Shift+R | Accept or reject every suggestion | |111112What you accept is made as one step, in the agent's name: its cells113show as changed by it, the agent's `undo` takes it back, and your own114undo passes it by, as it passes by another person's step. A change that115does more than set cells (inserting rows, adding a sheet, a chart, a116filter) is listed with what else it does and is accepted whole, by117making it again on the workbook; a change of cells alone sets the cells118it showed you. Rejecting changes nothing. Either way the agent hears119of it: the `suggestions` resource is updated for hosts subscribed to120it, and its next write lists what became of its earlier ones.121122### Direct edits123124**File > Let agents edit directly** skips suggestions: agents' changes125are made at once, each its own step, still theirs to undo. It is off126when a session starts, holds for the session, and applies to every127agent in it.128129## Scope130131When you invite the agent you pick what it may change:132133| Scope | The agent may change |134|---|---|135| The whole workbook | Anything, as you could |136| This sheet | The shown sheet's cells, lines, charts, rules and filters; no other sheet, and not the sheet list, names or settings |137| The selection | The cells of the selected range only |138| Read only | Nothing: it reads, points and asks |139140A change outside the scope is refused before it reaches you, with the141reason, and the agent's pointer stays inside it. The scope bounds142changes, not reading: formulas in the scope read cells outside it, so143the agent reads the whole workbook. Invite it again to change the scope.144145## Notebook cells and JEV146147What reaches beyond the workbook needs your leave each time, or for the148session, as an [untrusted macro](../sheets/macros.md) does. The agent's149`run_notebook_cell` asks before your session runs the cell with nu as150you, with your files; with the whole workbook in scope only, as its151output goes to the sheets it's sent to. With direct edits on, a change152that enters [JEV formulas](../formulas/jev.md), which send cells' values153over the network with your API key, asks first; a suggestion doesn't,154as accepting it is your leave. The question takes the context line:155Enter allows once, A allows for the session, Esc denies.156157## Questions158159The agent's `ask` tool puts a question on your context line and waits160for your answer:161162163164165It takes what an MCP elicitation request takes, a message and a flat166object schema, and returns what an elicitation returns: `accept` with167the values, `decline` or `cancel`. MCP's elicitation goes from a server168to the user of its host; here you are on the server's side, so the169agent asks through a tool shaped like one. A question without a schema170is a yes or no (Enter, N, Esc); otherwise each property is asked in171turn: a boolean with Y and N, a choice (`enum`, or `oneOf` consts, up172to nine) with its number, a string, number or integer typed and173entered. Esc cancels. The question waits until you're in READY with174nothing open, and goes away if the agent stops waiting.175176## Tools177178The agent has the [MCP server's](mcp.md) tools, working on the one179workbook: `path` is left out. Writes return the suggestion's number,180or with direct edits the change as saved, and the news of earlier181suggestions. `create_workbook` isn't offered. Live mode adds:182183| Tool | Does |184|---|---|185| `focus` | Moves the agent's pointer to a cell or range, in its scope |186| `undo` | Takes back the agent's latest step that was made (accepted, or made directly); refused when someone changed the same cells since |187| `ask` | Asks you a question and waits for the answer |188| `suggestions` | The agent's suggestions and what became of each, and its scope |189| `run_notebook_cell` | Has your session run a notebook cell, once you allow it |190191The resource `o12://live/suggestions` lists the same as `suggestions`;192hosts subscribed to it are told when you settle one.193194## 012 serve195196[`012 serve`](../terminal/ssh.md) listens the same way when sharing is197on, and the agent on the server, run by the server's user, joins a file198someone has open by naming it: `012 mcp --attach budget.012`. It may199change the whole workbook, as a suggestion anyone in the room accepts200or rejects; its questions go to whoever is free first.201202## Security203204- A session listens on a Unix socket only you can reach: the socket is205 `0600`, in a folder that is `0700`, `$XDG_RUNTIME_DIR/012` or else206 `agents` in [012's config folder](../reference/config.md). Nothing207 listens on the network.208- The session asks the kernel who connected (`SO_PEERCRED` on Linux,209 `LOCAL_PEERCRED` on macOS and FreeBSD) and refuses any other user.210 `012 mcp --attach` refuses a socket or folder another user owns or211 can reach.212- On Windows the socket is in your profile's folder, whose permissions213 keep other users out; there is no kernel check of who connected.214- The agent can do what the scope and your grants allow, as you, in215 this workbook only: it opens no files, runs nothing and reaches no216 network without your leave.217- A process of yours can attach, as it could already read and write218 your files; stop inviting agents to close the socket.219220## Limits221222- A change is made on a copy of the workbook first, to show it and223 check its scope, so a suggestion costs a save and an open of the224 workbook: quick for everyday workbooks, seconds near the225 [`max-cells` budget](../contributing/limits.md#sheet-size).226- The agent's changes are made in the order the room takes them, as227 anyone's; accepting a suggestion sets the cells it showed, over what228 anyone typed in them since.229- The agent attaches to the workbook it was invited to: opening another230 file in the session stops inviting agents.