# Engine: Qwen Code

Alibaba's coding agent, **beta**. Harness runs Qwen Code as it is; what differs from Claude Code is listed in the
box **What changes with Qwen Code** (Settings -> Engine -> Qwen Code). See [Engines](engines.md) for what is common to
every engine.

## Sign-in and providers

A key: **OpenRouter**'s, or **Alibaba Cloud Model Studio**'s own (models named `alibaba/<model>`, at its own prices). Put it in
Settings -> Keys, then choose it in Settings -> Providers. The Alibaba key is an
international one (Singapore region). With **Alibaba's Coding Plan**, paste the plan's key and choose it for **Alibaba
Coding Plan** (models named `alibaba-coding-plan/<model>`). Qwen Code no longer has a sign-in by account. **Install** in its panel downloads the version
Harness was tested with (about 300 MB; it needs Node.js 22 or newer on the server); its data stays in Harness's own
folder.

## Models

`provider/model`: Qwen's models of the provider's catalogue are listed (`openrouter/qwen/qwen3-coder-next` by
default), and any other model of the provider can be picked as a favourite. No effort levels.

## What works

Conversation, tools, files and the Changes view, memory, skills, MCP servers, steer, agents, the Sandbox mode of a
topic, sandboxed agents, the small calls, thinking with the models that think.

## How Harness adapts it

- **Memory**: the folder's CLAUDE.md, its imports and the levels above are given as its instructions. Qwen Code would
  also read a folder's CLAUDE.md by itself: it is told not to, so nothing is read twice. Each session has its own Qwen
  folder, so two sessions never share instructions.
- **Rules**: Qwen Code runs without asking (its mode "yolo"), and its rules are not ones Harness relies on, so rules hold
  **inside the Sandbox only** (see [Engines](engines.md)): there, Harness's sandbox goes around the whole of it.
  Outside it, a session runs with full access and a note says so once per session.
- **MCP servers**: those of Settings -> MCP and Harness's own are given to it at the start of each message.
- **Off**: its own scheduled tasks and the memory it writes by itself after each turn (a run lasts one message, and
  that memory costs model calls of its own). Use Harness's scheduled jobs and the folder's memory.

## Limits

- **Estimated cost**: Qwen Code says the tokens of a turn, not dollars. Harness prices them at the list prices of
  the provider's catalogue; a model without a list price shows no cost, and a budget is then refused.
- Each message carries about 20,000 tokens of Qwen Code's own instructions.
- Refused with the reason, never run on another engine: plan mode, the Ask me mode and an agent's approvals, Add to
  task, side questions, an agent's own rules. Pictures attached to a message are given as file paths. It cannot ask
  you questions in the middle of a turn.

## From a terminal

```
maxxing engines install qwen
maxxing engines provider openrouter OPENROUTER_API_KEY
maxxing engines use qwen
maxxing engines model qwen openrouter/qwen/qwen3-coder-next
```
