Shows the sessions of Qwen Code, the program qwen, in the notch, and lets you answer its permission requests from Blossom: working, done when a turn ends or Qwen Code says it waits for your input, failed when a turn ends on an error, needing you while it asks a question or presents a plan, 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.
Qwen Code reports through hooks: each hook posts its event with curl to a Unix socket in your own folder, ~/Library/Application Support/Blossom/qwen/socket, where this adapter listens. Blossom launches the adapter.
Qwen Code 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 Qwen Code, such as run_shell_command and write_file.
The hooks are an entry hooks of your settings of Qwen Code, ~/.qwen/settings.json, added after yours. The settings of a project, .qwen/settings.json, are never touched.
This adapter was written from the documentation and the source of Qwen Code and was never run against a real one. What they say and what is only supposed is in ../../documentation/roadmap/qwen.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.
Qwen Code, qwen, signed in. The hooks follow the page Hooks and the source of QwenLM/qwen-code, Apache-2.0, at commit 8bdcf17876997d0c55a42d23ff50c7f1e534faae of 2 December 2026, version 0.29.2: docs/users/features/hooks.md, which that page is built from, and the code that runs the hooks, packages/core/src/hooks.
curl and ps, which every hook runs by their full paths under /usr/bin and /bin. Qwen Code runs a hook with bash -c; the hooks were tested with sh, bash and zsh.
The quickest way. Blossom finds qwen on your Mac, in your PATH or the usual folders, where npm, Homebrew and its install script put it, and connecting it is one click: "Continue" on the second step of the introduction, with Qwen Code checked, or its switch in Settings > Agents. Blossom then adds this adapter to its configuration, starts it, and puts the hooks of adapters/qwen/settings.json in ~/.qwen/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/qwen/, named after the moment in UTC, and puts the new content in place in one rename. A file that is not plain JSON, such as one with comments, is left alone and the row says why. A file that sets "disableAllHooks": true is left alone too: you turned the hooks of Qwen Code off, and the row says so; Blossom does not turn them on. "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 QWEN_HOME. What Blossom writes and why is in the decision.
Hooks of your own settings run in every folder: the approval Qwen Code asks for, kept in ~/.qwen/hookApprovals.json, is for the hooks of a project only. Qwen Code reads its hooks when it starts, so a session open while you connect reports from its next start.
bun install && bun run bootstrap && bun run buildBLOSSOM_CONFIGURATION=adapters/qwen/configuration.json apps/macos/build/Build/Products/Debug/Blossom.app/Contents/MacOS/Blossom
The notch shows nothing until a session of Qwen Code 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 qwen code and exits.
An app opened from Finder reads ~/Library/Application Support/Blossom/configuration.json; name the adapter there by its package, { "adapters": [{ "package": "qwen" }] }.
Nothing when the session opens. The tile appears next to the notch with the first prompt, with the mark of Qwen, 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 Qwen Code would show its confirmation: what it wants to run, with Allow and Reject. For run_shell_command it also carries the command, for edit the old and the new text, and for write_file 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 Qwen Code asks you a question with ask_user_question or presents a plan with exit_plan_mode: answer in the terminal.
The green badge when a turn ends; the red one when it ends on an error.
For a clone without the app. The hooks of adapters/qwen/settings.json go into your ~/.qwen/settings.json, next to the hooks you have; the merge of the Claude Code adapter does it, with ~/.qwen/settings.json and adapters/qwen/settings.json in place of the files of Claude Code.
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. The jq command of the Claude Code adapter does it, with ~/.qwen/settings.json and Blossom/qwen/socket. Then check that nothing is left; this prints 0:
Permissions are answered in Blossom, or in the terminal, within fifty seconds. Qwen Code runs PermissionRequest only when it would show its confirmation, so not in YOLO mode, not for a call a rule or the mode allows, and not in qwen -p, where it denies the call before any hook. It 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, Qwen Code shows its confirmation as before. Qwen Code stops waiting for the answer of a PermissionRequest after sixty seconds, whatever the timeout of the hook, so the hook waits fifty seconds at most and names a timeout of 55; Qwen Code reads a timeout below 1000 as seconds. A request not answered in time leaves the panel and the terminal decides. A request you answer in the terminal leaves the panel when the call runs or its batch ends. Qwen Code sends no suggested rule, so Always is not offered.
What a request would do. The command of run_shell_command, the old_string and new_string of edit and the content of write_file, all with file_path, are read from the parameters of those tools in the source. The other fields of a command, such as is_background, come before it in its title, so nothing it carries is hidden.
Questions and plans are answered in Qwen Code.ask_user_question and exit_plan_mode make the session need you from their PreToolUse until the next event of the session; their PermissionRequest gets no answer. A Notification of permission_prompt makes the session need you too, and one of idle_prompt ends the turn.
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, such as Edit main.rs or the description of a command, and never what it holds; SubagentStart and SubagentStop count subagents, and the calls of a subagent, which carry its agent_id, are not steps. See ../../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 Qwen Code 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, 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 Qwen Code works as before.
A session whose qwen was killed leaves within seconds. Every command names the parent of its shell, the process of Qwen Code, in the header Blossom-Process, and every five seconds the adapter asks whether it still exists. The hook of StopFailure names none: Qwen Code runs it under a process of its own that outlives it.
The hooks name $HOME and nothing else without a default. Qwen Code puts the value of every variable a hook names as $NAME or ${NAME} into the command when it loads it; ${NAME-} is left for the shell, and $HOME is the same either way. They ignore your curl configuration with -q.
Qwen Code does not run the hooks of Claude Code. It reads ~/.claude/settings.json only for MCP servers, so the hooks Blossom puts there for Claude Code do not post the events of Qwen Code.
Read in the documentation and the source, never seen in a run:
That the parent of bash, which Qwen Code starts for a hook, is the process of Qwen Code, the same on every event of a session.
That the tool_input of PostToolUse matches that of PermissionRequest, so a request answered in the terminal leaves the panel when its call runs. The source gives PreToolUse a copy of the input with its paths unescaped and PermissionRequest the input as the model wrote it.
That the background_tasks of Stop say when a subagent still runs; when they do not, the turn of a session with a subagent in the background shows done.
That a session in auto-edit mode, which the source writes with a hyphen in some events, changes nothing for the adapter, which does not read the mode.
The adapter was tested with its hook commands run by sh, bash and zsh against the socket, with payloads written from the documentation and the source, never captured from a run. Each check needs qwen signed in and Blossom running with the adapter, with Qwen Code connected. Write down what the line in italics asks.
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?
A permission. In the default mode, ask run the shell command touch probe.txt. Does the request panel open with the command, while the terminal shows its confirmation? Answer Allow. Does probe.txt exist, and did the confirmation close? Ask again with rejected.txt and answer Reject: is there no file, and does Qwen Code say it was rejected in Blossom?
An edit. Ask change the word hello to world in a.txt in a folder whose a.txt says hello. Does the panel show the change?
Answering nowhere. Ask run the shell command touch late.txt and wait a minute. Does the request leave the panel after about fifty seconds, and does the terminal still take an answer?
A question. Ask ask me which database to use with ask_user_question. Does the tile turn amber with no panel?
A subagent. Ask for a task handed to a subagent. Does peek show one running subagent while it works, and none once it ends?
The end. Quit qwen. Does the tile leave at once? Start it again, ask hi, and kill -9 its process. Does the tile leave within about five seconds?
Hooks turned off. Add "disableAllHooks": true to ~/.qwen/settings.json. Does the row of Qwen Code in Settings > Agents say that its configuration turns its hooks off? Take the line out again.