> ## Documentation Index
> Fetch the complete documentation index at: https://docs.contextdrop.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Reference

> Every command, flag, and environment variable.

## Sessions

context-drop indexes live Claude Code, Codex, Pi, and OpenCode sessions, plus Claude Code subagents. A session is live while the agent process that owns it runs. Each session gets a deterministic ID: a two-letter agent prefix (`cc`, `cx`, `pi`, `oc`) and the first eight hex digits of `sha256("<agent>:<native id>")`. Claude Code subagents use `<parent native id>/<subagent id>` as their native ID.

A `TARGET` is an ID, a native session ID, a unique prefix of either, or a session name. Ambiguous targets are rejected with the candidates listed.

## Orgs

An org is a pool of agents across many machines. Each machine joins once; from then on `list`, `read`, and `send` work across the whole org, and agents have org IDs like `avyay-mbp/cc-49901f7f` (`<machine>/<session>`).

### `context-drop setup`

`setup [--join | --invite INVITE | --new-org ORG] [--server URL] [--name NAME] [--share DIR... | --share-all | --share-none] [--accept org|mine|none] [--agents LIST] [--no-mcp] [--no-reply] [--no-briefing] [--no-daemon] [--no-agents] [--yes] [--json]`

Set this machine up, or change how it is set up. It does three things:

1. **Puts the machine in an org**, one of three ways:

   * `--join`: a person approves it in their browser. Setup shows a link and a code like `ABCD-EFGH`, and opens the link: sign in, check the code matches, pick the org (or name a new one), and approve. Setup waits up to 10 minutes for that, then carries on. The page shows the address the request came from, the machine's OS and context-drop version, and how long ago it asked, and warns when the request came from another network than the browser's: approve only a machine you just set up yourself. On a machine with no browser, open the link on any other device. This needs a server where people sign in, as on contextdrop.dev.
   * `--invite INVITE`: with an invite from `context-drop invite`, and no browser. It is the only way to join on a server that has no sign-in.
   * `--new-org ORG`: start an org with this machine as its first member. A server without open sign-up needs its `--admin-token` (default `$CONTEXT_DROP_ADMIN_TOKEN`).

   Each saves the machine's credential with mode 0600 in `~/.context-drop/org.json`. The machine's name defaults to its hostname (`Avyays-MBP.local` becomes `avyays-mbp`) and must be unique in the org. The server defaults to `https://contextdrop.dev`.

   **On a tailnet.** A server running inside your Tailscale network knows which person and device each request comes from, so joining it needs no invite and no browser: setup asks the server who you are and joins the org the tailnet lets this device into. With several, the terminal asks which, and `--org ORG` names it without one; with none, `context-drop init ORG` starts one, with no admin token. Without `--server`, setup looks for a server named `context-drop` among the machine's tailnet peers (`tailscale status`, for at most 1.5 seconds) and uses it, saying `Found Context Drop on your tailnet: URL, signed in as LOGIN`; it finds nothing, silently, where Tailscale is missing or not running. An invite always goes to contextdrop.dev or the server it names. Such a server makes no invites: `context-drop invite` there prints the command a new machine runs instead.
2. **Runs the daemon** as a background service (see [`daemon install`](#context-drop-daemon-install---share-dir----share-all---accept-orgminenone-daemon-uninstall-daemon-status)). A connected machine shares no agents: the org reaches only the ones you add with [`context-drop share`](#context-drop-share-target---json). `--share DIR` (repeatable) shares every agent working in DIR or below it as well, `--share-all` shares every agent on the machine, and `--share-none` goes back to only the added ones. `--accept` says who may message shared agents (see [`daemon`](#context-drop-daemon---share-dir----share-all---accept-orgminenone)).
3. **Sets up every agent harness installed here**, which [`setup agents`](#context-drop-setup-agents---agents-list---no-mcp---no-reply---no-briefing---yes---json) does by itself.

**At a terminal** (standard input and standard error are both one), setup is a page for each of these, in the terminal's alternate screen. On a machine in no org its welcome page lists what agents can do once they are in one; then come how to join, the machine's name, the code to approve, which agents the org can reach (only the ones you add, every agent, or the ones in folders you check, offered from where agents run now), who may message them, and the harnesses, with every file it would change listed under them. `↑↓` move, `tab` checks or unchecks, `enter` confirms or submits the page, `esc` goes back a page, and `ctrl+c` leaves. Joining the org happens on its page, which says so; nothing else on the machine changes until you confirm on the last page, so leaving before it leaves the machine as it was. After that it offers to add the agents running now to the org, and to connect Slack, invite a teammate's machine, or open the console. It leaves a checklist of what it did on the terminal, with commands to try. A flag answers its page, which is then not shown.

**On a machine that is set up**, `setup` opens every page on what is chosen now, and changes only what you change. Without a terminal, a flag changes that one thing and the rest stays: `context-drop setup --accept mine --yes` keeps what the machine shares.

**With no terminal, or with `--yes`**, setup never asks, so an agent or a script can run it:

```sh theme={null}
context-drop setup --join --yes
```

* It prints `To approve this machine, open URL and check that the page shows the code ABCD-EFGH.` An agent gives its person that link and code, and keeps the command running. On a tailnet there is no link, code, or wait, and `--json` has no `approval` event.
* Each line after that starts with `✓` for a change it made or `✗` for one that failed, in plain text, and it exits non-zero when any failed.
* When it is not told something it needs, it changes nothing, exits non-zero, and prints the command to run instead. It needs a way into an org (`--join`, `--invite`, or `--new-org`) on a machine that is in none, unless the server is on its tailnet, and it needs `--yes` or `--agents` before it changes a harness's config.
* `--agents claude,codex` limits the harnesses changed (`all` is the default; `none` is `--no-agents`), `--no-mcp`, `--no-reply`, and `--no-briefing` leave a part out, and `--no-daemon` skips the daemon.
* `--json` prints one JSON object a line on standard output, and what people read on standard error: `{"event":"approval","url":…,"code":…,"expires_in_seconds":600}` as soon as there is a link, then

  ```json theme={null}
  {"event":"done","org":"acme","machine":"laptop","server":"https://contextdrop.dev","joined":true,
   "daemon":{"installed":true,"sharing":"added","accept":"org","logs":"tail -f ~/.context-drop/daemon.log"},
   "agents":[{"harness":"claude","change":"MCP server (user scope, in ~/.claude.json)","status":"added"}]}
  ```

  `sharing` is `added`, `folders` (with `folders`), or `all`. An agent change's `status` is `added`, `already`, or `failed` (with `error`), and `failed` lists what did not get set up.

Bare `context-drop` runs setup at a terminal on a machine nobody has set up; leaving it shows the help.

### `context-drop join [INVITE]` and `context-drop init ORG [--admin-token T]`

`join` is `setup --join`, `join INVITE` is `setup --invite INVITE`, and `init ORG` is `setup --new-org ORG` (`init` is not listed in `--help`). They take setup's other flags, refuse a machine that is already in an org, and are what `context-drop invite` prints for the next machine. With no terminal and no `--yes` they leave the agent harnesses alone and say how to set them up.

### `context-drop share [TARGET...] [--json]`

Put agents on this machine on the org's network. The org can then list and read them, and message them if this machine accepts messages; everything else on the machine stays invisible to the org.

* `TARGET` is an ID, a unique prefix, or a session name, as [`list --local`](#context-drop-list---json---agent-kind---top-level---in-mux---session-s---window-w---pane-p) shows them, or `self`: the agent running the command. `context-drop share self` is how an agent adds itself, and it does that only when its person asks.
* With no `TARGET` at a terminal, it opens a picker of this machine's agents (harness, ID, name, folder, status), with the ones on the network checked: check and uncheck, and `enter` saves. Anywhere else it prints the agents on the network now.
* A subagent follows the session it runs in.
* `context-drop start AGENT --share` starts an agent already shared.

The added agents are kept in `~/.context-drop/shared.json` on this machine and enforced by its daemon, which reads the file every time it is asked, so sharing takes effect within a couple of seconds and survives restarts and updates. The server never hears of an agent that is not shared, and a read, message, or question for one gets the same `not found` as for an agent that does not exist. Nobody else in the org can add an agent, the console included. An added session that has ended is forgotten a month later.

`--json` prints `{"org":…,"machine":…,"agents":[{"id":"laptop/cc-…","session":"cc-…","agent":"claude","cwd":…,"name":…,"by":"added"}]}`: every live agent of this machine that is on the network after the change, and why (`added`, `folder`, or `all`).

### `context-drop unshare (TARGET... | --all) [--json]`

Take agents off the org's network; `--all` takes off every added one. An agent in a folder the machine shares, or on a machine that shares every agent, stays shared, and `unshare` says so: `context-drop setup` changes that.

### `context-drop invite [--json]`

Print the command another machine runs to join this machine's org: `context-drop join cdi_…` (with `--server` when it isn't contextdrop.dev). It adds one machine, within 24 hours; run `invite` again for the next. An invite already used, revoked, or expired says so. Anyone who has it can join, so send it privately. An owner sees the invites nobody has used in the console (Machines), and can revoke them.

### `context-drop web [--print]`

Open the org's dashboard: machines, agents and their latest messages, what agents said to each other (see [the Messages page](https://docs.contextdrop.dev/server.md#the-messages-page)), the people in the org, and Slack and Linear. `--print` prints the link instead of opening it.

Where people sign in, the link asks you to sign in and, if you are not in the org yet, to join it; it works once, within 10 minutes. The first time someone opens an org they joined or started in the last week, the console shows what its agents can do, with what to do first: add a machine and invite people for whoever started it, or add their machine for whoever joined. **What Agents Can Do** in the sidebar shows it again. The first person to join an org that was started from a machine becomes its owner, and from then on [some changes need an owner's approval](#changes-an-owner-approves). On a server with no sign-in, the link opens the dashboard as this machine for 12 hours, and works once, within 2 minutes. On a server in your tailnet, the link is the console's own address: the tailnet says who opens it.

### `context-drop daemon [--share DIR... | --share-all] [--accept org|mine|none]`

`daemon` and its subcommands are not listed in `--help`: the service that `setup` installs runs the daemon, `leave` removes it, and `update` restarts it. You run it yourself only where there is no launchd or systemd.

Keep this machine connected to its org: report its shared agents every 2 seconds (whenever the list changes, and at least every 30 seconds) and answer `read` and `send` for them. It holds one outbound WebSocket, so the machine needs no open port, and reconnects with backoff when the connection drops. While it is not running, the machine's agents show as `offline` to the rest of the org. It runs in the foreground; `daemon install` runs it in the background instead.

A shared agent can be read by anyone in the org, so the daemon shares only what you say. With no flag, that is the agents added with [`context-drop share`](#context-drop-share-target---json). `--share DIR` (repeatable; `~` is expanded) also shares every agent working in that directory or below it, and `--share-all` shares every agent on the machine. To the org, an agent that is not shared looks like one that does not exist. A machine set up before agents were added one at a time keeps sharing what its service was installed with.

A message becomes the agent's next prompt, which it may act on with its own permissions, so `--accept` chooses who may send one:

| `--accept` | Takes messages from |
| - | - |
| `org` (default) | Anyone in the org: every machine, mods, and people replying on Slack or Linear |
| `mine` | This machine, and the machines added by the person who added it (approved it in the browser, or made the invite it joined with). A machine nobody added (one started with `init` before anyone opened its console, or joined with the org's join token) takes only its own. Slack, Linear, and mods are refused. |
| `none` | Nobody; the org can still list and read its shared agents. `--read-only` is the older name for it. |

The daemon decides, on this machine, from the sending machine the server takes from its credential, so nobody else in the org can change the choice, and a refused sender gets an error such as `devbox only accepts messages from its owner's machines`. The same choice governs `ask`, since its answerer runs on this machine and can read files there; `read` and `list` stay open to the whole org. The console shows each machine's choice.

When the machine is removed from the org (in the console, or by `machines rm` on another machine), leaves, or its org is deleted, the daemon says so once in its log, with who removed it, and stays idle instead of reconnecting, so the service manager does not restart it in a loop; run `context-drop leave --force`, then `setup`, to add the machine again.

### `context-drop daemon install [--share DIR... | --share-all] [--accept org|mine|none]`, `daemon uninstall`, `daemon status`

`context-drop setup` installs the service for you; these are the pieces. `install` runs the daemon with those flags as a launchd agent on macOS (`~/Library/LaunchAgents/dev.contextdrop.daemon.plist`, logging to `~/.context-drop/daemon.log`) or a systemd user service on Linux (`~/.config/systemd/user/context-drop.service`; logs with `journalctl --user -u context-drop`). It starts at login and restarts when it exits. The service runs this binary with the current shell's `PATH`, so it finds tmux, codex, and the rest. Installing again replaces it, `update` restarts it onto the new binary, and `leave` removes it. On a Linux server you don't stay logged in to, run `loginctl enable-linger` so it keeps running. `uninstall` stops and removes it; `status` says whether it is running.

Once joined, `upload` defaults to the org's server when no endpoint is configured.

### `context-drop machines [--json]`

List the org's machines: whether each is online, how many agents it shares, whose messages it accepts (its daemon's `--accept`; `-` when it has not said), who added it (the person it belongs to, or else the machine whose invite it joined with), when it joined, and when it last reported. This machine is marked. `--json` prints `name`, `online`, `agents`, `accept`, `added_by`, `added_by_id`, `added_by_machine`, `joined_at`, `last_seen` (Unix milliseconds), and `removable` (whether this machine may remove it without asking anyone).

```
MACHINE                          STATUS   AGENTS  ACCEPTS  ADDED BY  JOINED  LAST SEEN
avyays-mac-mini (this machine)   online   3       org      Avyay     Nov 12  now
mac                              offline  0       mine     Avyay     Nov 20  3d
```

### `context-drop machines rm NAME... [--yes]`

Take other machines out of the org, from any machine in it. It asks first (`Remove mac from dari? Its daemon disconnects and it has to join again. [y/N]`); `--yes` skips the question, and is needed where there is no terminal. A removed machine's credential stops working and its daemon disconnects, told which machine removed it; the org's Activity records the removal, the machine that asked, and the person who added that machine. To add the machine back, run `leave --force` and then `setup` on it. To remove this machine, run `leave` on it.

Who may:

| The machine to remove | Who removes it |
| - | - |
| accepts the whole org's messages (`--accept org`, or a daemon that has not said) | Any machine in the org: it could already prompt that machine's agents. |
| `--accept mine` or `none` | A machine added by the same person. From any other machine, [an owner approves it](#changes-an-owner-approves). An org with no owner refuses, and says what does remove it: `leave` on that machine, or, where people sign in, opening the console with `web`, which makes the first person in the org's owner. |

In the console, an owner removes any machine and a member the ones they added.

### Changes an owner approves

An org started with `init` has no people in it, and its machines change it freely. Once the org has an owner (the first person to open its console with `context-drop web`, or whoever created it there), these changes from a machine need an owner's approval:

* connecting or disconnecting Slack or Linear (`slack setup`, `slack install`, `slack uninstall`, `linear install`, `linear uninstall`);
* deploying a mod (`deploy`);
* removing a machine that chose whose messages it takes (`machines rm` of an `--accept mine` or `none` machine that is not its owner's).
* deleting the org (`delete-org`).

The command prints what it is waiting for and a link, as `join` does, and opens the link:

```
Deploying the mod standup needs approval from an owner of dari.
Approve on the console: https://console.contextdrop.dev/approve?code=ABCD-EFGH (code ABCD-EFGH)
```

The page shows the machine that asks, what it asks to do, the address it asked from, and the code to check against the terminal. Only an owner can approve or turn it down; a member sees who the owners are. The command goes ahead as soon as an owner approves, and fails if they turn it down or ten minutes pass. One approval covers that one change, by that machine: a deploy is approved by its source, so different code under the same name asks again, and `linear install` by its key. It stands only while whoever gave it is still an owner. Activity records who asked and who answered.

Owners make these changes without asking anyone: in the console they disconnect Slack or Linear (Connections), remove machines (Machines), make someone an owner or a member, and delete the org (People). A server with no sign-in has no owners, so nothing there waits for approval.

### Mods

An org adds its own commands as mods: one TypeScript file each, run on the org's server. The [mods guide](https://docs.contextdrop.dev/mods.md) covers writing one; these commands manage and call them.

#### `context-drop deploy FILE`

Upload a mod and make it live for the whole org at once. Deploying a file whose mod has the same name replaces it; its key-value data is kept. In an org with an owner, [an owner approves each deploy](#changes-an-owner-approves).

#### `context-drop mods [--json]`

List the org's mods with their capabilities and author.

#### `context-drop call NAME [--FIELD VALUE]... [--json INPUT] [--print-json]`

What `context-drop NAME` runs, and not listed in `--help`.

Run a mod. Flags fill its input and are converted to the input's types (a repeated flag fills a list); a single positional argument fills the mod's only required field. `--json` passes the whole input as JSON. Text output prints as is, a list of objects as a table, and anything else as JSON; `--print-json` always prints JSON. `context-drop NAME ...` is the same as `context-drop call NAME ...` when `NAME` is not a built-in command, and `context-drop NAME --help` shows the mod's input.

#### Tools for agents

With context-drop's tools, which `setup` and `setup agents` add, agents get `list`, `read`, `send`, `ask`, `slack_read`, `linear_read`, and every mod as tools (`read` returns the text `context-drop read` prints, then its cursor). Like the commands, `list` includes this machine's sessions the org cannot reach, and `read`, `send`, and `ask` reach a session on this machine directly, by either ID. They are told when the list changes, so a newly deployed mod reaches running agents without a restart. `send` also takes `#channel`, `@person`, or `slack:CHANNEL/TS` to message people on the org's Slack, and `linear:ENG-123` to comment on a Linear issue.

The tools come from `context-drop mcp`, an MCP server on standard input and output that harnesses run. It is not listed in `--help`; to wire a harness by hand, give it that command.

### Linear

`context-drop linear install | status | read ISSUE | uninstall`. See the [Linear guide](https://docs.contextdrop.dev/linear.md).

### Slack

`context-drop slack setup | install | connect | status | allow @PERSON... | disallow @PERSON... | restrict | unrestrict | read TARGET | uninstall | manifest` connects the org to a Slack workspace and manages who may answer agents. `setup` makes the org its own Slack app (`--name` sets its name) from an app configuration token and installs it, once per org; `install` installs it again; `connect` links your own Slack account by signing in with Slack. `send '#channel' MESSAGE`, `send @person MESSAGE`, and `send slack:CHANNEL/TS MESSAGE` post to people; `--wait` prints their first replies. See the [Slack guide](https://docs.contextdrop.dev/slack.md).

### `context-drop leave [--force]`

Remove this machine from the org and revoke its credential. `--force` forgets the org locally even when the server cannot be reached.

### `context-drop delete-org ORG [--yes]`

Delete this machine's org for everyone in it, naming it to confirm. It asks first (`Delete acme for everyone in it? … [y/N]`); `--yes` skips the question, and is needed where there is no terminal. Every machine's credential stops working and its daemon disconnects, told which machine deleted the org; Slack and Linear are disconnected; and the org's people, invites, mods and their data, and activity are deleted, so the name is free again. This machine then forgets the org and removes its daemon's service, as `leave` does. It can't be undone.

In an org with an owner, [an owner approves it](#changes-an-owner-approves); owners can also delete it in the console (People → Delete Org). In an org with no owner, a machine deletes it only when it could [remove every other machine](#context-drop-machines-rm-name---yes) itself, so a machine set to `--accept mine` or `none` that it could not remove keeps the org until that machine `leave`s (or, where people sign in, someone opens the console with `web`, becomes its owner, and deletes it there).

### Across the org

* `list` shows every agent in the org, most recently active first, each main agent followed by its subagents, then every session on this machine that the org cannot reach (the machine does not share it, or its daemon is not connected). Those say `here only` in a `NETWORK` column (`"here_only": true` in `--json`): `read`, `send`, and `send --ask` reach them from this machine, by `MACHINE/SESSION` or the bare session ID, and `share` puts them on the network. `--machine M` and `--cwd PATH` (that directory or below) narrow it, as does `--agent KIND`; `--local` shows only this machine's sessions with local IDs, as before joining, and in its `NETWORK` column why each is on the network: `added` for the ones put on the org's network with `share`, `folder` or `all` where the machine shares them anyway, and `-` for the rest (`network` in `--json`, empty for the rest). `--in`, `--session`, `--window`, and `--pane` need `--local` for now. `--json` prints `Agent` objects: `id`, `machine`, `kind`, `role` (`main`, `subagent`), `parent`, `root`, `agent_type`, `status` (including `offline`), `cwd`, `name`, `location`, `location_label`, `started_at`, `last_active`.
* `read MACHINE/SESSION` reads that agent wherever it runs. It shows the current context run, from the last compaction on; `--all` shows every run, `-n` the last N messages with the tool calls among them, and `--after CURSOR` only entries newer than the `cursor` a previous `read --json` returned. `--json` prints `{agent, run, runs, entries, cursor}`; a tool call is an entry `{type: "tool", name, input, result, failed}`. A tool call carries the time it was made, so a result that arrives after a read is not in later `--after` reads past that call. `--screen` works for this machine's agents only.
* `send MACHINE/SESSION MESSAGE` delivers through the owning machine's daemon; the server sets the sender to this machine's name, so no machine can speak as another; `--from NAME` only adds a label in front (`NAME@machine`). When an agent sends, the recipient is told its org ID (`laptop/cc-1a2b3c4d`) to reply to. `--wait` works for one agent on another machine: it reads that agent until it has answered and settled. `send --all` goes to every connected main agent in the org, narrowed by `--machine`, `--cwd`, and `--agent`; `--local` keeps it to this machine. `--file` works only for this machine's agents; use `upload` for a link. An org ID for one of this machine's own agents is delivered locally, without the server.

### `context-drop list [--json] [--agent KIND] [--top-level] [--in MUX] [--session S] [--window W] [--pane P]`

List live sessions with ID, agent, status (`idle`, `working`, `blocked`, `unknown`), last activity, working directory, name, and where it runs. Subagents are listed under their parent. `--json` includes the native ID, parent, PID, TTY, transcript path, the delivery channel `send` will use, `location`, and `app` for a session an app runs in place of a terminal: `claude-desktop` or `codex-desktop` for the agent's own desktop app, or the app that hosts it (`conductor`, `t3-code`, an editor such as `zed`). Such a session shows the app under `WHERE` (`claude desktop`, `t3 code`), and `--in desktop` keeps only those.

A host app is named from the session's process: Conductor and T3 Code wherever they are among its ancestors, and any other installed macOS app when no process between it and the agent has a terminal, so an agent you start in a terminal tab is never taken for one its terminal app runs.

Sessions are found from each agent's own state and processes, so an agent is listed wherever it runs, including panes context-drop did not start. `WHERE` (`location` in JSON) is the tmux, herdr, or Rex pane its process runs in, found from the pane's terminal (tmux) or process tree (herdr, Rex), across every Rex session. It is `-` for a plain terminal tab. `location` has `mux`, `session`, `window`, `pane`, and `label`:

| | `session` | `window` | `pane` | `label` |
| - | - | - | - | - |
| tmux | session name | window index | pane ID (`%3`) | |
| herdr | workspace ID | tab ID | pane ID (`w1:p2`) | |
| Rex | session label | window ID | block ID | block label |

`--in`, `--session`, `--window`, and `--pane` keep only the sessions in that place. Each takes an ID or a label at that level (herdr workspace and tab labels, tmux window names for `--window`, Rex block labels for `--pane`). Rex IDs also match without their `block:`/`window:`/`session:` prefix, or by the short form Rex prints (at least six characters).

Finding Rex blocks runs `rex` with `--autostart=false`, so `list` never starts a Rex server.

### `context-drop read TARGET [-n N] [--json] [--screen]`

Print the agent's status and directory, then its last `N` messages (default 20, `0` for all): prompts and replies in full, and between them the tool calls it made, one line each with the command, path, or query and the start of the output (`✗` marks a failure). A run of tool calls shows its last four and counts the rest, and the calls after the agent's last reply (what it is doing now) are always shown, so `read TARGET -n 3` on a busy agent shows its last prompt, its current work, and its latest words. A compaction shows as a marker and is not counted; its summary is in `--json` and goes to `send --ask`. Tool output is cut to a line or two; a file tool's output is shown only when it fails, and output that looks like an environment dump or a key is dropped.

`--json` prints the messages; a tool call is `{"role": "tool", "tool": {"name", "input", "result", "failed"}}`.

`--screen` prints the last `N` lines (default 40) of the tmux, herdr, or Rex pane the session runs in instead. Use it to see prompts and dialogs that never reach the transcript.

### `context-drop reply TARGET MESSAGE... [--wait] [--timeout D]`

`send` for people only: TARGET is `#channel`, `@person`, `slack:CHANNEL/TS`, or `linear:ENG-123`, and any agent target is refused. Because it can only reach people, harnesses can let agents run it without asking (`setup agents`), and the messages people send agents name it as the way to answer. `--wait` prints the first replies on Slack.

### `context-drop send --ask TARGET QUESTION...`

Answer QUESTION for the agent without interrupting it: the agent never sees the question, and nothing is saved. The agent's own program answers, on the machine that runs it, so no other one has to be installed there. Use it for what the agent knows or has done; anything it must agree to or act on is a message.

Where it can, the agent answers as a copy of its session, which knows everything the session does. The copy is told who asked, to change nothing, and to say so when it cannot tell:

| Agent | The copy |
| - | - |
| Claude Code | `claude -p --resume ID --fork-session --no-session-persistence --tools Read,Grep,Glob --strict-mcp-config`, with hooks off |
| Codex | `codex exec fork ID --ephemeral`, sandboxed read-only, with its MCP servers and apps off |
| Pi | `pi -p --fork SESSION --no-mcp --tools read,grep,find,ls`, its session kept in a directory that is deleted |
| OpenCode | the service's `generate` call, which answers from the session's context with no tools |

A session that cannot be copied has the end of its transcript read instead: a Claude Code subagent, a Muse Code or Antigravity session, and any session whose copy fails. The reader gets the transcript as text (its user's prompts, its replies, and its tool calls summarized as `read` shows them, each with its time, up to about 100k tokens), with the current time, the agent's status, and its directory and git branch, and may read files in the agent's directory but not change them. The agent's own program reads it if that is Claude Code (`claude -p --model haiku`), Codex (`codex exec`), or Pi (`pi -p`), each with the same limits as its copy; otherwise whichever of those is installed does. Muse Code and Antigravity never answer, even for their own sessions: neither can copy a session or run without the MCP servers it is set up with, and one of those could message the agent. A Codex whose MCP servers cannot be listed, so cannot be turned off, is not run either. If nothing answers, the error says what each run said.

While it runs, a copy or a reader is not listed as an agent. Across an org, the owning machine's daemon answers, if it accepts messages from the asker (`--accept`): a machine that accepts none answers no questions either. `CONTEXT_DROP_<KIND>_BIN` (`CLAUDE`, `CODEX`, `PI`, `OPENCODE`, `MUSE`, `AGY`) names a program that is not on the daemon's `PATH`.

### `context-drop send TARGET MESSAGE... [--file PATH]... [--wait] [--timeout D] [--from NAME]`

### `context-drop send --all [--agent KIND] [--in MUX] [--session S] [--window W] [--pane P] MESSAGE...`

Deliver a message into a live session as its next prompt; a busy agent receives it as a queued follow-up. When the sender is an agent (the session running `send`, found from its process ancestry), the message opens with `[context-drop] Agent <id>, not your user. Reply: context-drop send <id> "..."`, for every kind of agent; `--from NAME` names a sender that is not an agent (`[context-drop] From NAME.`). A message a person sends from a plain terminal arrives as is. Use `-` as the message to read it from stdin. `--file PATH` (repeatable) hands the recipient a file or directory on this machine: its absolute path and size are listed under the message for the agent to read in place, and nothing is uploaded; a missing path is an error. `--wait` waits until the agent has replied and settled, then prints the new messages (default timeout 30 minutes).

`--all` sends the message to every live top-level session that matches the filters (the same filters as `list`), except the session running the command. When the command runs under a process that serves several sessions (a Codex app-server, or OpenCode), all of those sessions are skipped, since it cannot tell which one is the sender. Each delivery is reported on stderr; a failed one does not stop the others, and `send` exits non-zero if any failed. With `--wait` it waits for all the replies at once and prints each under `== ID`. The filters are refused without `--all`, so a forgotten `--all` never turns a target into part of the message.

Delivery per agent:

* **Claude Code**: the session's peer-messaging socket, authenticated with the token Claude Code publishes in `~/.claude/sessions`. The agent sees the message as coming from another session, named by the sending agent's ID or `--from`. Subagents are reached through their parent, which is asked to forward the message with `SendMessage`; finished subagents stay addressable because `SendMessage` resumes them.
* **Codex**: `codex queue --thread ID`. Threads served by a private `codex app-server --listen ws://…` (for example a wrapper-launched Codex) are queued against that server using its token file. For a thread in the Codex desktop app, `send` then opens `codex://threads/wake/ID` in the background so the app picks the message up. On a machine with no `codex` on `PATH`, the message is queued with the program that runs the thread, which is how a thread in an app that brings its own Codex (Conductor) is reached.
* **Pi**: the socket opened by the context-drop Pi extension (`context-drop setup pi`). Without the extension, the text is typed into the tmux, herdr, or Rex pane the Pi process runs in. A Pi session without the extension is identified by its process until it writes a session file, then by that file, so its ID changes after its first message; `send --wait` and `start --wait` follow it.
* **OpenCode**: `opencode api POST /api/session/ID/prompt` on the background service. Child sessions (subagents) accept messages directly.

### `context-drop stop [TARGET...] [--all [filters]] [--force] [--timeout D]`

Stop the named sessions, or with `--all` every live top-level session matching the filters (never the session running the command). `stop` waits up to `--timeout` (default 10s) for each to leave `list`.

* A session in a pane that `context-drop start` opened for it has that pane closed (`tmux kill-pane`, `herdr pane close`, `rex block close`). `start` records these panes in `~/.context-drop/launched.json`, keyed by the session and its process, so a record never applies to a later run of the session or to a reused pane ID. This also stops OpenCode sessions and Codex threads served by a shared app-server, as long as `start` opened them.
* Any other session gets SIGTERM, so a pane or terminal you opened yourself keeps its shell.
* A process that serves several sessions, a Codex `app-server` or `opencode serve`, is never signalled; close that session's terminal instead.
* Sessions that are `working` or `blocked`, and your own session, are refused unless `--force`. Subagents cannot be stopped on their own.

### `context-drop start AGENT [--cwd DIR] [--in tmux|herdr|rex|desktop] [--session S] [--window W] [--pane P] [--name NAME] [--command CMD] [--prompt TEXT] [--wait] [--trust] [--share] [-- AGENT_ARGS...]`

Start `claude`, `codex`, `pi`, `opencode`, `muse` (Muse Code), or `agy` (Antigravity CLI) in a new terminal and print its ID once it appears in `context-drop list`.

* `--in`: `tmux` opens a window in a tmux session named `context-drop` (created if needed), `herdr` opens a tab in the current workspace and runs the agent in its shell, and `rex` runs the agent in a new block. The default is `launch_in` from the config, then the multiplexer you are running inside (`$TMUX`, `HERDR_ENV`, `REX_BLOCK`), then whichever of tmux, herdr, or rex is installed.
* `--session`, `--window`, and `--pane` name where to open the agent, in the multiplexer's own terms. Each takes an ID or a label, and the place must already exist:

  | | `--session` | `--window` | `--pane` |
  | - | - | - | - |
  | tmux | session | window (index, `@ID`, or name) | pane (`%ID` or `SESSION:WINDOW.PANE`) |
  | herdr | workspace | tab | pane |
  | Rex | session | window | block |

  `--session` alone opens a new window there (a tab in herdr). `--window` or `--pane` opens a new pane split to the right of that window's focused pane, or of that pane. `start` never types into an existing pane. For example, `context-drop start claude --in rex --session calm-prairie` runs `rex run -s calm-prairie …`, and adding `--pane reviewer` splits beside the block labelled `reviewer`. Herdr commands reach the herdr session you are in (or `HERDR_SESSION`).
* `--cwd` defaults to the current directory, and `--name` labels the window, tab, or block (default `AGENT-DIRNAME`). A tmux split has no label.
* `--command` (or `launch_command`) is the command line that starts the agent. `{agent}` becomes the agent name, so `dari {agent}` runs `dari claude`, `dari codex`, and so on. Without it, the agent's executable runs directly. Arguments after `--` are appended.
* `--prompt` sends a first message once the agent is up, and `--wait` prints the reply. OpenCode gets the prompt on its command line, because it only creates a session when it receives one.
* `--share` adds the agent to the org's network once it is up, as [`context-drop share`](#context-drop-share-target---json) does.
* `--timeout` (default 60s) bounds the wait for the agent to appear. If it does not appear in time, `start` prints the pane and exits. If a prompt was given, it fails because the prompt was not sent.
* While it waits, `start` reads the new pane. If the agent stops at a folder-trust prompt (Claude Code, Codex) or a first-run screen such as a login, `start` says so on stderr at once and keeps waiting, so you can answer it in the pane. If it is still there at the timeout, `start` reports it instead of timing out silently, and with `--prompt` it fails without typing the prompt into the dialog.
* `--trust` answers a folder-trust prompt by choosing the option that trusts the folder (it presses Down until that option is selected, then Enter). It never answers login screens, and it never picks an option that also waives approvals.

`--in desktop` opens a new session in the agent's desktop app instead of a terminal: `claude://code/new` for Claude Code, `codex://threads/new` for Codex, in `--cwd`, with `--prompt` filled into the composer. The apps fill the prompt in but never send it, and they create the session only when its first message is sent, so press Enter in the app. `start` waits for a new desktop session in that directory (`--timeout`, 5 minutes by default here) and prints its ID. `--wait` is refused, since the prompt may be edited before it is sent; follow the session with `read`. A Codex desktop thread runs in the app's shared server, so `stop` cannot end it. `--session`, `--window`, `--pane`, `--command`, and agent arguments do not apply. Other agents have no desktop app.

`--json` prints the launch result: `mux`, `pane`, `location`, `command`, `registered`, `session`, and `status`, one of `registered`, `waiting_for_trust`, `waiting_for_setup`, `not_registered`, or `started` (with `--timeout 0`).

### `context-drop setup agents [--agents LIST] [--no-mcp] [--no-reply] [--no-briefing] [--yes] [--json]`

The harness step of [`setup`](#context-drop-setup) by itself. For the agent harnesses installed here it can make three changes, and makes only the ones that are missing:

| Harness | context-drop's tools | Replies without asking | Briefing at session start |
| - | - | - | - |
| Claude Code | `claude mcp add --scope user context-drop -- context-drop mcp` | `Bash(context-drop reply:*)` in `permissions.allow` of `~/.claude/settings.json` (or `$CLAUDE_CONFIG_DIR`). The rest of the file is left as it was. | A `SessionStart` hook in the same `settings.json` that runs `context-drop briefing --hook`. |
| Codex | `codex mcp add context-drop -- context-drop mcp` | `~/.codex/rules/context-drop.rules` allowing `context-drop reply`. | The same hook in `~/.codex/hooks.json` (or `$CODEX_HOME`). Codex skips a hook until you trust it: run `/hooks` in Codex once. If `config.toml` declares hooks inline, setup leaves both files alone and prints the command to add there. |
| OpenCode | The MCP server in `~/.config/opencode/opencode.json`. | Nothing: OpenCode runs commands without asking unless you set `permission.bash`; if you have, allow `context-drop reply *` there. | OpenCode has no session-start hook, so: a note in `~/.config/opencode/AGENTS.md`, between two marker lines, that says what context-drop is for. It has no list of sessions. |
| Pi | The context-drop extension (as `setup pi`), which is how Pi gets context-drop. | Nothing: Pi does not ask before running commands. | A second extension, `context-drop-briefing.ts`, beside the first. It runs `context-drop briefing` before a new session's first turn, so `context-drop` has to be on Pi's `PATH`. |
| Muse Code | `muse mcp add context-drop -- context-drop mcp`, which writes `~/.config/muse/settings.json`. | Nothing yet: allow `context-drop reply` in Muse Code yourself. | A plugin, `context-drop`, with the same hook, installed with `muse plugins install` from `~/.context-drop/plugins/muse/context-drop`. Muse Code runs a plugin's hook only after you approve it: `muse plugins approve context-drop`. |
| Antigravity | `agy mcp add context-drop context-drop mcp`, which writes `~/.gemini/config/mcp_config.json`. | Nothing yet: allow `context-drop reply` in Antigravity yourself. | A plugin, `context-drop`, installed with `agy plugin install` into `~/.gemini/config/plugins/context-drop`. Its hook runs `context-drop briefing --as antigravity --hook`, which prints the lines as the JSON Antigravity's hooks hand a session. |

The permission covers `reply` only, which posts to people on Slack and Linear and never reaches an agent, so agents answer people without stopping to ask; everything else still asks as before.

The briefing is why nobody has to tell an agent that context-drop exists. A session that is never told other sessions are running starts a subagent instead, so as each session starts it is given a few lines: when context-drop is the tool to use (your user mentions another agent or session, or asks to coordinate with, hand off to, or check on one), and the agent sessions running on this machine at that moment, those in the session's directory first, up to eight. It reads only this machine, so it adds a fraction of a second and works without an org. The hook runs however a session starts (new, resumed, cleared, or compacted). `context-drop briefing` prints the same lines; like `mcp`, it is not listed in `--help`.

At a terminal it is one page: check the harnesses and the three parts, and it lists each file it would change before you confirm. With no terminal it needs `--yes`. `--agents claude,codex` limits the harnesses, `--no-mcp` leaves the tools out (Pi's extension included), `--no-reply` leaves the permission out, and `--no-briefing` the briefing. Restart running agents to pick the changes up.

[`context-drop uninstall --agents-only`](#context-drop-uninstall---agents-only---yes) takes all three back out.

### `context-drop setup launcher`

Pages for how `start` opens agents (the multiplexer and the launch command) and where uploads go (the main server or one you run). It writes `~/.context-drop/config.toml` at the end; cancelling saves nothing. It needs a terminal.

### `context-drop setup pi [--print]`

Not listed in `--help`: `setup agents` installs the extension with everything else.

Install the Pi extension at `~/.pi/agent/extensions/context-drop.ts` (or under `PI_CODING_AGENT_DIR`). Pi sessions started afterwards publish `~/.context-drop/pi/<pid>.json` and listen on `~/.context-drop/pi/<pid>.sock` (mode 0600). `--print` writes the extension to stdout instead.

### Environment

* `CONTEXT_DROP_HOME` relocates `~/.context-drop`.
* `CONTEXT_DROP_<AGENT>_BIN` overrides an executable, e.g. `CONTEXT_DROP_CODEX_BIN`, `CONTEXT_DROP_OPENCODE_BIN`, `CONTEXT_DROP_TMUX_BIN`, `CONTEXT_DROP_HERDR_BIN`, `CONTEXT_DROP_REX_BIN`. Rex is otherwise found through `REX_BIN_DIR`, `PATH`, or the Rex app bundle.
* `CONTEXT_DROP_LAUNCH_IN` and `CONTEXT_DROP_LAUNCH_COMMAND` set the `start` defaults.
* `CODEX_HOME` and `PI_CODING_AGENT_DIR` are honoured.

Discovery uses `ps` and `lsof`.

## `context-drop upload [path]`

Upload one file to the configured TTL store. With no path, `--clipboard` uploads the current clipboard image.

Flags: `--endpoint`, `--ttl`, `--filename`, `--content-type`, `--clipboard`, `--no-clipboard`, and `--json`.

Public servers need no upload token. Private servers can require `CONTEXT_DROP_UPLOAD_TOKEN` or `upload_token` in `~/.context-drop/config.toml`.

## `context-drop uninstall [--agents-only] [--yes]`

Undo everything [`setup`](#context-drop-setup) did, and remove Context Drop from this machine. It lists what it found and asks once (`Remove all of it? [y/N]`); `--yes` skips the question, and is needed where there is no terminal. Without either it prints the list and removes nothing.

First the agent harnesses. It looks at each harness's config, whether or not the harness is still installed, and takes out only what setup put there:

| Harness | What it removes |
| - | - |
| Claude Code | The MCP server (`claude mcp remove --scope user context-drop`), `Bash(context-drop reply:*)` from `permissions.allow`, and the `SessionStart` hook that runs `context-drop briefing --hook`. |
| Codex | The MCP server (`codex mcp remove context-drop`), `~/.codex/rules/context-drop.rules`, and the hook in `~/.codex/hooks.json`. A hook you added to `config.toml` by hand is yours to delete: it says so on a `!` line and leaves the file alone. |
| OpenCode | `mcp.context-drop` in `~/.config/opencode/opencode.json`, and the note between its two marker lines in `~/.config/opencode/AGENTS.md`. |
| Pi | Both extensions, `context-drop.ts` and `context-drop-briefing.ts`. |
| Muse Code | The MCP server (`muse mcp remove context-drop`) and the plugin (`muse plugins remove context-drop`). |
| Antigravity | The MCP server (`agy mcp remove context-drop`) and the plugin (`agy plugin uninstall context-drop`). |

Everything else in those files stays as you had it: your own permissions, your own hooks (also one that shares a group with the briefing), your own rules around the note. A file that setup started and that is left with nothing in it is deleted; one with anything left in it, even only a `$schema` line, stays. Where a harness's CLI is gone, the MCP server is taken out of the file that CLI wrote.

Then the machine: it leaves the org as [`leave`](#context-drop-leave---force) does, stops and removes the daemon's service, and deletes `~/.context-drop` (the config, this machine's credential, and logs) and the `context-drop` binary. `--agents-only` skips this part, so your agents go back to how they were and the CLI, the org, and the daemon stay; `context-drop setup agents` puts the harness changes back.

It keeps going past anything it cannot remove, marks it `✗` with what to do, and exits non-zero. If the server cannot be reached, or this machine's membership cannot be read, the machine is still cleaned up, and the org lists it until someone removes it in the console or with [`machines rm`](#context-drop-machines-rm-name---yes). A binary you cannot delete (one in a root-owned directory) is named with the `sudo rm` that does.

Agent sessions that are already running keep what they loaded until they restart.

## `context-drop version`, `context-drop --version`

Print the binary version, source commit, and build date.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.