# Qoder CLI adapter

Shows the sessions of Qoder CLI, the program `qoder`, in the notch, and lets you answer its permission requests from Blossom: working, done when a turn ends or Qoder CLI says it is idle, failed when a turn ends on an error, needing you while it waits for a question, a plan or an elicitation, what the tool in use does, its first prompt, its repository and its branch as its name, its tool calls as steps and how many subagents it runs.
Qoder CLI reports through hooks: each hook posts its event with `curl` to a Unix socket in your own folder, `~/Library/Application Support/Blossom/qoder/socket`, where this adapter listens. Blossom launches the adapter.
Qoder CLI copied the format of the hooks of Claude Code, so this adapter reads them with the same code of the SDK as the Claude Code adapter, with the names of the tools of Qoder CLI.
The hooks are an entry `hooks` of your settings of Qoder CLI, `~/.qoder/settings.json`, added after yours. The settings of a project, `.qoder/settings.json` and `.qoder/settings.local.json`, are never touched.

**This adapter was written from the documentation of Qoder CLI and was never run against a real one.** Qoder CLI is not open source. What the documentation says and what is only supposed is in [../../documentation/roadmap/qoder.md](../../documentation/roadmap/qoder.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.
- Qoder CLI, `qoder`, signed in. The hooks follow the pages [Hooks](https://docs.qoder.com/cli/hooks), [Hooks reference](https://docs.qoder.com/cli/hooks-reference), [Settings](https://docs.qoder.com/cli/settings) and [Permissions](https://docs.qoder.com/cli/permissions), read on 2 December 2026.
- `curl` and `ps`, which every hook runs by their full paths under `/usr/bin` and `/bin`. Qoder CLI runs a hook with `bash -c`; the hooks were tested with `sh`, `bash` and `zsh`.

## Connect from Blossom

The quickest way. Blossom finds `qoder` 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 Qoder CLI checked, or its switch in Settings > Agents. Blossom then adds this adapter to its configuration, starts it, and puts the hooks of `adapters/qoder/settings.json` in `~/.qoder/settings.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.

Before it writes over the file, Blossom keeps a copy of it in `~/Library/Application Support/Blossom/backups/qoder/`, named after the moment in UTC, and puts the new content in place in one rename. Qoder CLI accepts comments in its settings; Blossom does not keep them, so a file with a comment is left alone and the row says why. "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. Blossom does not follow `QODER_CONFIG_DIR`: a Qoder CLI that uses another folder does not read the file. What Blossom writes and why is in [the decision](../../documentation/decisions/connecting.md).

The documentation says a change of the settings takes effect at once, so a session that is open when you connect should report from its next event.

## Run Blossom with the adapter

From the root of the clone:

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

The notch shows nothing until a session of Qoder CLI 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 qoder cli` and exits.

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

## Try it in one session

Nothing is installed. With Blossom running, start Qoder CLI with the hooks of the adapter, as the settings of highest precedence:

```sh
qoder --settings "<absolute path of the clone>/adapters/qoder/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.
- A permission request in the request panel when Qoder CLI asks before using a tool: what it wants to run, with Allow and Reject. For `Bash` it also carries the command, and for `Write` the content of the file, which the panel shows unless "Show what a request would do" is off.
- The amber badge, and no panel, while Qoder CLI asks you a question with `AskUserQuestion`, presents a plan with `ExitPlanMode`, or an MCP server asks for input: answer in the terminal.
- The green badge when a turn ends; the red one when it ends on an error.
- The tile gone when the session ends.

## Install by hand

For a clone without the app. The `hooks` of `adapters/qoder/settings.json` go into your `~/.qoder/settings.json`, next to the hooks you have; the merge of [the Claude Code adapter](../claude/README.md#install-by-hand) does it, with `~/.qoder/settings.json` and `adapters/qoder/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 `~/.qoder/settings.json` and `Blossom/qoder/socket`. Then check that nothing is left; this prints `0`:

```sh
grep -c 'Blossom/qoder/socket' ~/.qoder/settings.json
```

## What to know

- **Permissions are answered in Blossom, or in the terminal.** Qoder CLI runs `PermissionRequest` when its permission pipeline would ask you, and reads `hookSpecificOutput.decision.behavior`, `allow` or `deny`, as the answer. Allow answers `allow`; Reject answers `deny` with the message "Rejected in Blossom.". When the hook prints nothing, Qoder CLI asks in its terminal as before. The rules are those of the Claude Code adapter: a request not answered within sixty seconds leaves the panel and the terminal decides; a request you answer in the terminal leaves the panel when the call runs, when the turn ends or after sixty seconds at the latest. Always is offered only when Qoder CLI suggests a rule in the shape of Claude Code, which its documentation does not show.
- **What a request would do.** The command of `Bash` and the path and content of `Write` are documented, so they travel with the request. The fields of `Edit` are not, so an edit carries its title alone.
- **Questions, plans and elicitations are answered in Qoder CLI.** `AskUserQuestion` and `ExitPlanMode` make the session need you from their `PreToolUse` until the next event of the session; their `PermissionRequest` gets no answer, so Qoder CLI asks in its terminal. A `Notification` of `permission_prompt` or `elicitation_dialog` makes the session need you too. How a hook could answer them is not documented.
- **A session shows up with its first prompt**, or with a permission request. `SessionStart` is not installed.
- **The name, the steps and the subagents** 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 `tool_use_id`, saying what it does and never what it holds; `SubagentStart` and `SubagentStop` with an `agent_type` count subagents, and the calls of a subagent are not steps. See [../../documentation/decisions/names.md](../../documentation/decisions/names.md).
- **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. Blossom uses it to bring that terminal forward. No other hook looks for it.
- **The hooks send the whole payload, and the adapter keeps a few fields.** Each hook posts the payload as Qoder CLI gives it on standard input, your prompt and the input of tools included. The adapter keeps the identifier of the session, of the call and of a subagent, the title taken from the first line of the prompt, the name of the tool and the words of its step, the folder, and for a permission request what it would do while it waits. Nothing else is kept, logged or sent to Blossom.
- **The hooks print nothing but the answer to a permission.** Every hook but that of `PermissionRequest` sends what `curl` receives to `/dev/null`, and every command ends with `|| /usr/bin/true`, so a hook never fails and never blocks. With Blossom closed, each hook gives up at once and Qoder CLI works as before.
- **The hooks of the IDE and the plugin of Qoder skip.** The IDE and the JetBrains plugin of Qoder read the same `~/.qoder/settings.json`, and answer a permission with another shape. Their documentation lists `QODER_CWD` among the variables of their hooks and the documentation of the CLI does not, so every command tests it first, `/bin/test -n "${QODER_CWD-}" ||`, and ends there. The desktop app of Qoder says it runs the hooks of the CLI: its sessions would show as sessions of Qoder CLI, with no terminal.
- **A session whose `qoder` was killed leaves within seconds.** Every command names the parent of its shell, which is supposed to be Qoder CLI, 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`.
- **Qoder CLI does not run the hooks of Claude Code.** Its documentation names no reading of `~/.claude/settings.json`, so the hooks Blossom puts there for Claude Code do not post the events of Qoder CLI.
- **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 the parent of the shell of a hook is the process of Qoder CLI, the same on every event of a session.
2. That `transcript_path` is in every payload; the adapter drops a payload without it.
3. That the events of a subagent carry its `agent_id`.
4. That `Edit` takes `file_path`, `old_string` and `new_string`, as in Claude Code.
5. That `permission_suggestions` and `updatedPermissions` take the shape of Claude Code.
6. That the IDE and the plugin of Qoder set `QODER_CWD` and the CLI never does.
7. That a hook of `PermissionRequest` may hold sixty seconds, below the timeout of 65 seconds it names, without Qoder CLI giving up first.

## 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 `qoder` 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, ask `hi`. *Does the tile appear with the prompt, with no badge, and turn green when the answer ends?*
2. **A permission.** Ask `run the bash command touch probe.txt`. *Does the request panel open with the command, while the terminal shows its own prompt?* Answer Allow. *Does `probe.txt` exist, and did the prompt of the terminal close?* Ask again with `rejected.txt` and answer Reject: *is there no file, and does Qoder CLI say it was rejected in Blossom?*
3. **Answering nowhere.** Ask `run the bash command touch late.txt` and wait more than a minute. *Does the request leave the panel, and does the terminal still take an answer?*
4. **A question.** Ask `use AskUserQuestion to ask me which database to use`. *Does the tile turn amber with no panel?*
5. **A subagent.** Ask for a task handed to a subagent. *Does peek show one running subagent while it works, and none once it ends?*
6. **The end.** Quit `qoder`. *Does the tile leave at once?* Start it again, ask `hi`, and `kill -9` its process. *Does the tile leave within about five seconds?*
7. **The IDE.** With the hooks connected, open a project in the Qoder IDE and ask `hi` there. *Does no tile show in the notch?*
