A session is a coding agent’s work in one folder of one VM: its id, its agent, its VM, its folder, and the state it last reported. Start it from Companion or the CLI, then return to it from a terminal or from the API.
Start an agent with a task
Section titled “Start an agent with a task”si agent run starts the agent with your text as its first prompt and streams the answer. Companion starts the same agent in a terminal tab, so the session stays in Agents after you leave the terminal.
The samples use a VM named agent-box and the folder /home/user/app. VMs shows how to create the VM.
The CLI has no flag for a permission mode: the agent runs with full access, edits files and runs commands without asking. To make the agent ask before it acts, start it in Companion and choose Ask in the Mode menu.
- Open Companion.
- Select the plus in Agents.
- Enter
Run the tests and fix the failing one.in Task. - Choose Claude in the Agent menu.
- Choose
agent-boxin the SVM menu. - Choose Other folder in the Folder menu.
- Enter
~/app. - Choose Ask in the Mode menu.
- Select Start agent. Companion opens the session’s terminal tab.
On a phone, the same flow opens in the Companion layout. Answer from your phone covers the phone and its notifications.
The agent must be signed in inside the VM, and the folder must exist. The sign-in section links each agent’s guide. A VM without a sign-in answers:
si agent run agent-box --agent claude --cwd /home/user/app -- 'Run the tests and fix the failing one.'Not logged in · Please run /loginA signed-in run streams the answer and ends with the agent’s exit code. The session stays in si agent sessions after the command ends.
Sign in an agent
Section titled “Sign in an agent”Each agent keeps its own login inside the VM. Sign in once in a terminal in the VM; the login stays on the VM’s disk and survives a sleep. SlashInfra’s sign-in does not sign an agent in.
- Claude Code: sign in, clone a repository and ask for a fix.
- Codex: sign in with a device code and ask for a fix.
- opencode: connect a model provider and ask for a fix.
Run the start command again after the sign-in, or start the agent in Companion.
What a session is
Section titled “What a session is”A session has an ags_ id and a session name. The id is the one the API uses and stays with the row until you delete it. The session name is the agent’s own, such as a Claude Code UUID or term-1234/build.
agent names the coding agent, such as claude, codex or opencode. svm and svm_name name the VM, svm_state is its runtime state, cwd is its folder, and project is the VM’s project. state is what the agent last reported, and changed_ms is when the state, kind or message last changed.
Companion runs an agent in a terminal tab of its VM, and terminal is that tab’s id. A session started by si agent run has terminal: null, because it runs as a background job rather than a terminal tab. si agent attach opens a terminal for either kind.
What survives a sleep
Section titled “What survives a sleep”A sleeping VM keeps its sessions. A working or blocked session of a VM that is not running reads paused, because the agent cannot make progress.
A sleep in memory keeps the agent process, so it resumes where it stopped. A sleep on disk keeps the files but not the process. The agent’s transcript stays on the VM’s disk, and si agent attach starts the agent again from the session. GET /agent-sessions does not wake the VM; si agent sessions, si agent send and si agent attach reach it, so they wake it.
The terminal tab also lives in the VM: a sleep in memory keeps it, and a sleep on disk ends it. A deleted VM takes its sessions with it.
List sessions
Section titled “List sessions”GET /agent-sessions returns at most 200 sessions, newest change first, and covers every project the key reads unless project names one. si agent sessions reads the agent’s own session files in the VM, so it can show a session that the API has not reported.
- Open Companion. The Agents list groups sessions as Needs you, Working, Finished and Paused.
si agent sessions agent-boxagent id cwd title updatedclaude 0a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5d /home/user/app Run the tests and fix the failing one. 2026-11-29 13:38:41Zcurl -sS "https://api.slashinfra.com/agent-sessions" \ -H "Authorization: Bearer $SI_API_KEY"API reference: Control API operation
{"sessions":[{"id":"ags_0123456789ab","svm":"6f1c0f0e8a","svm_name":"agent-box","svm_state":"running","project":"proj_6f1c0f0e8a","agent":"claude","session":"0a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5d","state":"error","kind":null,"message":"Not logged in · Please run /login","cwd":"/home/user/app","terminal":null,"at_ms":1795959531910,"changed_ms":1795959531951}]}import os, requests
res = requests.get( "https://api.slashinfra.com/agent-sessions", headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},)res.raise_for_status()for session in res.json()["sessions"]: print(session["id"], session["agent"], session["state"])ags_0123456789ab claude errorconst res = await fetch('https://api.slashinfra.com/agent-sessions', { headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },})if (!res.ok) throw new Error(await res.text())const { sessions } = (await res.json()) as { sessions: { id: string; agent: string; state: string }[]}for (const session of sessions) console.log(session.id, session.agent, session.state)ags_0123456789ab claude errorSend a follow-up message
Section titled “Send a follow-up message”si agent send starts the same session again with your text as the next prompt. The agent keeps its folder and its transcript. The VM must still have the session’s files; si agent sessions shows the id to pass.
si agent send agent-box 0a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5d -- 'Add a test for the fix.'The answer streams to your terminal, as a run does, and the command ends with the agent’s exit code. --agent names the agent when the list no longer has the session.
Attach to the terminal
Section titled “Attach to the terminal”si agent attach resumes the session in a terminal, with its history. Use it to answer a prompt or to type your next line.
- Open Companion.
- Select a session that Companion started in Agents. Companion opens its terminal tab.
si agent attach agent-box 0a1b2c3d-4e5f-4a6b-8c9d-0e1f2a3b4c5dThe terminal takes over until you quit the agent. Unlike a run, it stays open after the agent finishes a turn. --agent names the agent when the list no longer has the session.
Delete a session
Section titled “Delete a session”Delete removes the row from the list. It does not stop the agent or delete the agent’s transcript in the VM. A working session that reports again returns with a new id. Companion’s Dismiss is for a finished session; the API accepts a session in any state.
- Open Companion.
- Find the session under Finished, or an
errorsession under Needs you. - Open its menu: right-click the row, or press and hold it on a phone.
- Select Dismiss. Dismiss appears only for a session in
doneorerror.
curl -sS -i -X DELETE "https://api.slashinfra.com/agent-sessions/ags_0123456789ab" \ -H "Authorization: Bearer $SI_API_KEY"API reference: Control API operation
HTTP/2 204...import os, requests
res = requests.delete( "https://api.slashinfra.com/agent-sessions/ags_0123456789ab", headers={"Authorization": f"Bearer {os.environ['SI_API_KEY']}"},)res.raise_for_status()print(res.status_code)204const res = await fetch('https://api.slashinfra.com/agent-sessions/ags_0123456789ab', { method: 'DELETE', headers: { Authorization: `Bearer ${process.env.SI_API_KEY!}` },})if (!res.ok) throw new Error(await res.text())console.log(res.status)204Options
Section titled “Options”| Field | Type | Default | Allowed values | What it changes |
|---|---|---|---|---|
svm (positional) |
string | The VM set with si use, or the only VM in the project |
A VM name or id in the project | The VM that runs or reports the agent. |
prompt (after --) |
string | Required on run |
Text, or - to read standard input |
The task the agent starts with. |
session (positional) |
string | Required on send and attach |
A session id from si agent sessions |
The session to resume. |
agent (--agent) |
string | Required on run; the session’s agent on send and attach; every agent on sessions |
claude, codex or opencode |
The coding agent. On sessions, it filters the list. |
cwd (--cwd) |
string | The home directory, /home/user |
An absolute path that exists in the VM | The folder the agent works in. |
project (--project, or project query) |
string | CLI: SI_PROJECT, else default; API: every project the key reads |
A project name, or its proj_ id |
The project of the CLI command, or the one project of the API list. |
json (--json) |
boolean | false |
--json |
Print the result as JSON. si agent sessions --json prints the rows as a JSON array; run, send and attach ignore it. |
seen (query) |
string | None | 1 to 2048 characters | Mark one browser push subscription as seen; Companion sends it, and without it nothing is marked. |
Scroll horizontally to see all columns.
States
Section titled “States”| State | What it means for you | What you can do |
|---|---|---|
working |
The agent runs a turn. | Wait, or open the terminal to watch. |
blocked |
The agent waits for a permission, a question or a sign-in. | Answer in Companion, or attach to the terminal. For auth, sign in again. |
done |
The agent finished its turn. | Send a follow-up, attach, or delete the session. |
error |
The agent stopped with an error; message may hold its one line. |
Read message, then send a follow-up or attach. |
paused |
A working or blocked session of a VM that is not running. |
Wake the VM, then attach or send a message. |
Scroll horizontally to see all columns.
kind is set only on blocked, and is permission, question or auth. message is one line of what the session waits for.
The API reports paused for a working or blocked session of a VM that is not running. When the VM runs again, the list reports the session’s own state.
Errors
Section titled “Errors”| Code | When | Fix |
|---|---|---|
not_found |
Delete names an id that no session of your organization has, or one outside the key’s scope. | Check the id, and the key’s project scope. |
project_not_found |
The project query names no project of the organization, or one outside the key’s scope. |
Check the name or id, and the key’s project scope. |
Scroll horizontally to see all columns.
Errors that any request can return are in the error catalog.
Permissions
Section titled “Permissions”| Operation | Who can | Key action |
|---|---|---|
| Start an agent | Any member | svm:read |
| List sessions | Any member | svm:read |
| Send a message | Any member | svm:read |
| Attach to a session | Any member | svm:read |
| Delete a session | Any member | svm:write |
Scroll horizontally to see all columns.
The CLI resolves the VM through the control API, so every CLI command needs svm:read, and its key must reach the VM’s project. The API list also needs svm:read.
Limits
Section titled “Limits”- The API list returns at most 200 sessions, newest change first. There is no cursor; list again to read newer changes.
- The API keeps at most 64 session rows for a VM. A new session beyond 64 replaces the oldest
doneorerrorrow; with none, the report is dropped. - A row is removed 14 days after its last state, kind or message change.
- An
ags_id isags_and 12 lowercase hex characters. The agent’ssessionname is at most 128 characters. - A session message is one line of at most 512 code points, and
cwdis at most 512 bytes. seenis 1 to 2048 characters.- A VM serves 8 terminals at once; a 9th terminal answers 429.
The full list is in Limits.
- Fix a failing test with Claude Code: sign in and start a first session on a repository.
- Answer from your phone: answer a blocked session from a notification.
- Sleep and wake: what the VM keeps while a session waits.