# sessions

> Code sessions in Nexus for desktop, on this computer: list, read, start, name, message and stop them from a script or another agent. Turn on Outside access in the app first; each client asks you once.

Code sessions in Nexus for desktop, on this computer: list, read, start, name, message and stop them from a script or another agent. Turn on Outside access in the app first; each client asks you once.

## nexus sessions list

```sh
nexus sessions list [--project P] [--archived] [--limit N] [--json]
```

Code sessions in Nexus for desktop, newest first: id, status, name, title and project.

| Option | Meaning |
| --- | --- |
| `--project <P>` | The project: its folder (. is the current one), its id, or GitHub owner/repo |
| `--archived` | Archived sessions too |
| `--limit <N>` | At most this many sessions (1 to 200, default 50) |
| `--json` | Print only JSON on stdout |

```sh
nexus sessions list
```

## nexus sessions show

```sh
nexus sessions show <id|name|title> [--turns N] [--json]
```

A session's status and its latest turns: each prompt, the agent's last answer and how the turn ended. Name a session by its id (a word starting with t_), or by its name or exact title among the newest 200; a name past those goes to the app's own lookup.

| Option | Meaning |
| --- | --- |
| `--turns <N>` | How many of the latest turns (1 to 20, default 3) |
| `--json` | Print only JSON on stdout |

```sh
nexus sessions show <id>
```

## nexus sessions start

```sh
nexus sessions start "<prompt>" [--project P] [--agent A] [--model M] [--mode M] [--worktree] [--folder] [--name N] [--json]
```

Start a session with its project's defaults (the current folder's project when --project is left out; - reads the prompt from stdin).

| Option | Meaning |
| --- | --- |
| `--project <P>` | The project: its folder (. is the current one), its id, or GitHub owner/repo |
| `--agent <A>` | Claude or codex or nexus or antigravity or cursor; default: the project's |
| `--model <M>` | The model; default: the project's |
| `--mode <M>` | The permission mode: plan, default, acceptEdits, auto or bypassPermissions; never above the project's default |
| `--worktree` | Work in a new worktree; default: the project's choice |
| `--folder` | Work in the project's folder; default: the project's choice |
| `--name <N>` | The session's unique name, which Claude Code's ListAgents and SendMessage reach it by |
| `--json` | Print only JSON on stdout |

```sh
nexus sessions start --project . "Find why the tests are slow"
```

## nexus sessions send

```sh
nexus sessions send <id|name|title> "<message>"
```

Message a session; a busy one gets it after its current turn (- reads stdin). Name a session by its id (a word starting with t_), or by its name or exact title among the newest 200; a name past those goes to the app's own lookup.

```sh
nexus sessions send <id> "Now fix it"
```

## nexus sessions stop

```sh
nexus sessions stop <id|name|title>
```

Stop a session's current turn. Name a session by its id (a word starting with t_), or by its name or exact title among the newest 200; a name past those goes to the app's own lookup.

## nexus sessions name

```sh
nexus sessions name <id|name|title> [<new-name>] [--clear] [--json]
```

Give a session a unique name, which Claude Code's ListAgents and SendMessage reach it by; --clear removes it. A name is 1 to 40 letters, digits, dots, dashes or underscores, and never starts with t_.

| Option | Meaning |
| --- | --- |
| `--clear` | Remove the session's name |
| `--json` | Print only JSON on stdout |

## nexus sessions connect

```sh
nexus sessions connect [--read-only]
```

Ask Nexus for desktop for access now (the other commands ask by themselves); you approve it in the app.

| Option | Meaning |
| --- | --- |
| `--read-only` | Ask only to read sessions |

## nexus sessions disconnect

```sh
nexus sessions disconnect
```

Forget this CLI's access on this computer (revoke it in the app: Settings, MCP servers, Outside access).

## nexus sessions mcp

```sh
nexus sessions mcp [--name N]
```

The same tools as an MCP server on stdin and stdout, for another agent: claude mcp add nexus-sessions -- nexus sessions mcp.

| Option | Meaning |
| --- | --- |
| `--name <N>` | The name the app shows for this client (default: nexus CLI) |

```sh
nexus sessions mcp --name "Claude Code"
```
