# Droid adapter

Shows the sessions of Droid, the agent of Factory and its program `droid`, in the notch: working, done when a turn ends or you stop it, needing you while it asks for a permission or for input in an elicitation dialog, what the tool in use does, its first prompt, its repository and its branch as its name, and its tool calls as steps.
Droid reports through hooks: each hook posts its event with `curl` to a Unix socket in your own folder, `~/Library/Application Support/Blossom/droid/socket`, where this adapter listens. Blossom launches the adapter.
The hooks of Droid take the format of those of Claude Code, with the names of its own tools in `tool_name`, such as `Execute` and `Create`, so this adapter reads them with the same code of the SDK as the Claude Code adapter.
The hooks are an entry `hooks` of your local settings of Droid, `~/.factory/settings.local.json`, added after yours. `~/.factory/hooks.json`, `~/.factory/settings.json` and every file of a project are never touched.

**Permissions are answered in Droid, not in Blossom.** Droid has no `PermissionRequest` event: its documentation says it ignores that key and reports it. The hook that can allow a call, `PreToolUse`, runs on every call, also on those Droid would not ask about, and its `allow` runs a call without the permission prompt, so holding it would allow what Droid was going to ask and what it was not. Blossom shows that the session needs you, from the notification of a permission prompt, and you answer in the terminal.

**This adapter was written from the documentation of Droid and was never run against a real one.** What the documentation says and what is only supposed is in [../../documentation/roadmap/droid.md](../../documentation/roadmap/droid.md); the checks at the end say what to look at.

You need:

- Blossom. It includes this adapter and the Bun that runs it; from a clone, `bun run build` makes one.
- Droid, `droid`, signed in. The hooks follow the page [Hooks](https://docs.factory.com/harness/hooks), read on 2 December 2026.
- `curl` and `ps`, which every hook runs by their full paths under `/usr/bin` and `/bin`. The page says Droid runs a hook with `/bin/sh -c` on macOS; the hooks were tested with `sh`, `bash` and `zsh`.

## Connect from Blossom

The quickest way. Blossom finds `droid` on your Mac, in your `PATH` or the usual folders, and connecting it is one click: "Continue" on the second step of the introduction, with Droid checked, or its switch in Settings > Agents. Blossom then adds this adapter to its configuration, starts it, and puts the hooks of `adapters/droid/settings.json` in `~/.factory/settings.local.json`, after the hooks you already have, as it does for Claude Code. Nothing of yours changes, and a file that does not exist is created with the hooks alone.

**Why `settings.local.json`.** Droid reads the hooks of `~/.factory` from three files. An event in `hooks.json` replaces the same event of `settings.json` in that folder, so hooks Blossom put in `settings.json` would stop running as soon as you had that event in `hooks.json`, and hooks Blossom put in `hooks.json` would silence yours in `settings.json`. The page replaces nothing of `settings.local.json`: its groups are added to those of the other files, and config sync never publishes it. It is also the file `/hooks` never writes, so its hooks show there read-only, with the name of the file.

Before it writes over the file, Blossom keeps a copy of it in `~/Library/Application Support/Blossom/backups/droid/`, named after the moment in UTC, and puts the new content in place in one rename. Droid accepts comments in its settings; Blossom does not keep them, so a file with a comment is left alone and the row says why. **A file whose `hooks` sets `"hooksDisabled": true` is left alone too**, and the row says that its configuration turns its hooks off. "Repair" puts the hooks back when they are missing or not the ones this Blossom installs. "Disconnect", shown while the agent is off, takes the adapter out of Blossom and its hooks out of the file, which then holds what it held before. What Blossom writes and why is in [the decision](../../documentation/decisions/connecting.md).

The page says Droid reloads hooks when a settings file changes, so a session open while you connect reports from its next event. It runs no hooks in a folder you have not trusted in its interface.

## Run Blossom with the adapter

From the root of the clone:

```sh
bun install && bun run bootstrap && bun run build
BLOSSOM_CONFIGURATION=adapters/droid/configuration.json apps/macos/build/Build/Products/Debug/Blossom.app/Contents/MacOS/Blossom
```

The notch shows nothing until a session of Droid reports. Run one Blossom at a time: the adapter holds the socket, and the adapter of a second Blossom logs `cannot listen for the hooks of droid` and exits.

An app opened from Finder reads `~/Library/Application Support/Blossom/configuration.json`; name the adapter there by its package, `{ "adapters": [{ "package": "droid" }] }`.

## Try it in one session

Nothing is installed. With Blossom running, start Droid with the hooks of the adapter, as the settings of highest precedence after those of an organization:

```sh
droid --settings "<absolute path of the clone>/adapters/droid/settings.json"
```

## What you should see

- Nothing when the session opens. The tile appears next to the notch with the first prompt, in initials, named after the first line of that prompt and the repository, with its branch beside it.
- No badge while it works, and the tool in use in live.
- The amber badge, and no panel, while Droid asks you for a permission or for input in an elicitation dialog: answer in the terminal.
- The green badge when a turn ends, or when you stop it.
- The tile gone when the session ends.

## Install by hand

For a clone without the app. The `hooks` of `adapters/droid/settings.json` go into your `~/.factory/settings.local.json`, next to the hooks you have; the merge of [the Claude Code adapter](../claude/README.md#install-by-hand) does it, with `~/.factory/settings.local.json` and `adapters/droid/settings.json` in place of the files of Claude Code.

## Remove by hand

After an install by hand; after connecting from Blossom, Disconnect does it, and removing Blossom takes out the hooks of every tool, see [Removing it](../../documentation/privacy.md#removing-it). The `jq` command of [the Claude Code adapter](../claude/README.md#remove-by-hand) does it, with `~/.factory/settings.local.json` and `Blossom/droid/socket`. Then check that nothing is left; this prints `0`:

```sh
grep -c 'Blossom/droid/socket' ~/.factory/settings.local.json
```

## What to know

- **Needing you comes from a notification.** A `Notification` of `permission_prompt` or `elicitation_dialog` makes the session need you until its next event. One of `idle_prompt`, which the page says Droid sends when you stop a turn, in place of `Stop`, makes it done.
- **A session shows up with its first prompt.** `SessionStart` is not installed.
- **The name and the steps** follow the Claude Code adapter: the first line of the first prompt, the repository and the branch; one step per tool call of the session, paired by the name of the tool, since the payload carries no identifier of the call, saying what it does and never what it holds: the name of the file of `Create` and `Edit`, whose `file_path` the page shows, and a label for the rest, such as `Running a command` for `Execute`. The page says a call that ends in an error sends no `PostToolUse`, so its step fails when the turn ends. Subagents are not counted: `SubagentStop` carries no `agent_type` and Droid has no `SubagentStart`.
- **The terminal of a session.** The hook of `UserPromptSubmit` also finds the terminal the session runs in, with the shell of the SDK, and sends it in headers.
- **The hooks send the whole payload, and the adapter keeps a few fields.** Each hook posts the payload as Droid gives it on standard input, your prompt and the input and output of tools included. The adapter keeps the identifier of the session, the title taken from the first line of the prompt, the name of the tool and the words of its step, the folder and the type of a notification. Nothing else is kept, logged or sent to Blossom.
- **The hooks print nothing and decide nothing.** Every hook sends what `curl` receives to `/dev/null`, and every command ends with `|| /usr/bin/true`, so a hook never fails, never exits 2, which blocks a call, and prints no JSON, which Droid would read as a decision. With Blossom closed, each hook gives up at once and Droid works as before.
- **A session whose `droid` was killed leaves within seconds.** Every command names the parent of its shell, which the page makes the process of Droid since it runs the hook with `/bin/sh -c`, in the header `Blossom-Process`, and every five seconds the adapter asks whether it still exists.
- **The hooks name `$HOME` and nothing else without a default**, and ignore your curl configuration with `-q`.
- **Droid does not run the hooks of Claude Code.** Its page names only the files of `.factory`, a `--settings` file, plugins and the settings of an organization; it accepts the names of the tools of Claude Code in a matcher, not its settings.
- **The socket is yours alone.** See [../../documentation/decisions/socket.md](../../documentation/decisions/socket.md).

### Not confirmed

Read in the documentation, never seen in a run:

1. That a Task subagent, which the page says has a session of its own, sends `PreToolUse` with the identifier of that session: it would then show as a session of its own while it works.
2. That a `hooksDisabled` set in `~/.factory/hooks.json` or `~/.factory/settings.json` turns these hooks off too; Blossom reads only `settings.local.json`.
3. That `Edit` carries `file_path`, which the page says only by saying `ApplyPatch` has none.
4. That `droid` is the name of the program on the `PATH`.

## Checks by hand

The adapter was tested with its hook commands run by `sh`, `bash` and `zsh` against the socket, with payloads written from the documentation, never captured from a run. Each check needs `droid` signed in and Blossom running with the adapter, started with `--settings` as above. Write down what the line in italics asks.

1. **A turn.** In a new folder, trust it and ask `hi`. *Does the tile appear with the prompt, with no badge, and turn green when the answer ends?*
2. **A permission.** At a low autonomy level, ask `run the command touch probe.txt`. *Does the tile turn amber, with no panel, while the terminal asks, and does the badge leave once you answer there?*
3. **Stopping.** Ask `run the command sleep 60` and stop the turn. *Does the tile turn green, with the step failed?*
4. **A subagent.** Ask for a task handed to a subagent. *Does a second tile show while it works?*
5. **The end.** Quit `droid`. *Does the tile leave at once?* Start it again, ask `hi`, and `kill -9` its process. *Does the tile leave within about five seconds?*
