# claude, codex, agy and agents

> Run Claude Code and Codex with every model call through Nexus Gateway: metered, checked against your policies and attributed to you. `nexus agy` runs Antigravity on your own Google AI plan. `nexus agents` shows each agent's setup on this machine.

Run Claude Code and Codex with every model call through Nexus Gateway: metered, checked against your policies and attributed to you. `nexus agy` runs Antigravity on your own Google AI plan. `nexus agents` shows each agent's setup on this machine.

## nexus claude

```sh
nexus claude [--json] [--subscription | --api | --via <route>] [--team <slug>] [--recording [<id>|latest]] [--no-skills] [--] [claude args…]
```

Claude Code on the route you chose (nexus agents): through Nexus Gateway, metered, checked against your policies and attributed to you, or on your own Claude plan.

| Option | Meaning |
| --- | --- |
| `--json` | A JSON summary on stdout when the agent exits |
| `--subscription` | Use your Claude subscription (claude auth login), not Gateway: model calls are not metered or checked (also NEXUS_CLAUDE_AUTH=subscription) |
| `--api` | Through Gateway for this run, whatever route you saved (also NEXUS_CLAUDE_AUTH=gateway) |
| `--via <route>` | The route for this run: gateway or subscription; default: your saved route (nexus agents) |
| `--team <slug>` | The team this session's spend goes to (also NEXUS_TEAM) |
| `--recording <id>` | Start on a screen recording from Nexus for Mac (⌥⇧S): its id, or latest (the default); Claude Code is told how to read it |
| `--model <auto>` | Claude Code's own flag, read by Nexus: auto runs on the model Gateway chooses |

| Exit code | Meaning |
| --- | --- |
| 0 | The agent's own exit code is passed through |

```sh
nexus claude -p "hello"
nexus claude --team web
nexus claude --subscription
nexus claude --recording latest
```

## nexus codex

```sh
nexus codex [--json] [--subscription | --api | --via <route>] [--team <slug>] [--recording [<id>|latest]] [--no-skills] [--] [codex args…]
```

Codex on the route you chose (nexus agents): through Nexus Gateway, metered, checked against your policies and attributed to you, or on your own ChatGPT plan.

| Option | Meaning |
| --- | --- |
| `--json` | A JSON summary on stdout when the agent exits |
| `--subscription` | Use your ChatGPT plan (codex login), not Gateway: model calls are not metered or checked (also NEXUS_CODEX_AUTH=subscription) |
| `--api` | Through Gateway for this run, whatever route you saved (also NEXUS_CODEX_AUTH=gateway) |
| `--via <route>` | The route for this run: gateway or subscription; default: your saved route (nexus agents) |
| `--team <slug>` | The team this session's spend goes to (also NEXUS_TEAM) |
| `--recording <id>` | Start on a screen recording from Nexus for Mac (⌥⇧S): its id, or latest (the default); Codex gets its contact sheet |
| `--model <auto>` | Codex's own flag, read by Nexus: auto runs on the model Gateway chooses |

| Exit code | Meaning |
| --- | --- |
| 0 | The agent's own exit code is passed through |

```sh
nexus codex exec "hello"
nexus codex --team web
nexus codex --subscription
nexus codex --recording latest
```

## nexus agy

```sh
nexus agy [--json] [--subscription] [--team <slug>] [--] [agy args…]
```

Antigravity on your own Google AI plan: its calls go straight to Google, and Nexus records the session.

| Option | Meaning |
| --- | --- |
| `--json` | A JSON summary on stdout when the agent exits |
| `--subscription` | Run on your Google AI plan, the default (also NEXUS_ANTIGRAVITY_AUTH=subscription) |
| `--team <slug>` | The team this session is attributed to (also NEXUS_TEAM) |
| `--model <id>` | Agy's own flag: the model it runs, by its id (auto is not available) |

| Exit code | Meaning |
| --- | --- |
| 0 | The agent's own exit code is passed through |
| 2 | --api, --via gateway, --model auto or --recording: not available, and the agent does not start |

```sh
nexus agy -p "hello"
nexus agy --team web
nexus agy -- --conversation <id>
```

## nexus agents list

```sh
nexus agents list
```

Each local launcher (also plain nexus agents): install, sign-in, route, payer, and setup steps.

## nexus agents use

```sh
nexus agents use <claude|codex|agy|cursor-agent> <gateway|subscription|default>
```

The route an agent takes when you name none, in every Nexus app you sign in to.

```sh
nexus agents use claude subscription
nexus agents use codex default
```

## nexus agents setup

```sh
nexus agents setup <claude|codex>
```

How to run an agent through Gateway, from its recipe: the limits first, then each step. Writes nothing.

```sh
nexus agents setup claude
```

## nexus agents share

```sh
nexus agents share <session|latest> [--org | --team T | --people a@x,b@y] [--include-thinking]
nexus agents share <session|latest> --to a@x,b@y | --public [--expires 30d]
nexus agents share <session|latest> --private
```

Share a Claude Code session (nexus claude) as an artifact, from its transcript on this machine: latest is this folder's newest. Again: a new version, and the earlier ones revoked.

- `nexus agents share <session|latest> --to a@x,b@y | --public [--expires 30d]`: Share it outside your organization, as its settings allow.
- `nexus agents share <session|latest> --private`: Stop sharing a session: revoke every version, so only you can read it.

| Option | Meaning |
| --- | --- |
| `--org` | Share with everyone in your organization |
| `--team <T>` | Share with these teams (slugs, comma-separated) and the teams under them |
| `--people <a@x,b@y>` | Share with these people in your organization (emails, comma-separated) |
| `--include-thinking` | Keep the agent's thinking in the shared session (left out by default) |
| `--to <a@x,b@y>` | Share outside your organization with these people (emails, comma-separated); they sign in with that email to open it |
| `--public` | Share with anyone who has the link (unguessable, not indexed by search engines) |
| `--expires <30d>` | When a public link stops working: 30d, 12h or a number of days |
| `--private` | Stop sharing: revoke every version, so only you can read it |

```sh
nexus agents share latest --org
```
