Skip to main content
9 – 17 UHR +49 8031 3508270 LUITPOLDSTR. 9, 83022 ROSENHEIM
DE / EN
Coding agent Alibaba (Qwen team) China Terminal, IDE, desktop, chat

Qwen Code

Qwen Code is Alibaba's open-source coding agent for terminal, IDE and desktop, working with Qwen, Claude, Gemini and OpenAI-compatible models.

Licence Apache-2.0
Interfaces Terminal (CLI), Desktop app, VS Code, Zed, JetBrains, Web interface (Web Shell), Chat (Telegram, DingTalk, WeChat, Feishu)
Platforms macOS, Linux, Windows
Instruction file QWEN.md

The seven building blocks in Qwen Code

How Qwen Code implements the building blocks of an AI harness

  1. 1

    Agent loop

    As with its origin, Gemini CLI, the core loop calls the model, evaluates its tool requests and executes them; in headless mode (`qwen -p "..."`) Qwen Code can be used in scripts, CI/CD or batch jobs.

  2. 2

    Tools and execution environment

    Built-in skills such as `/review`, `/batch`, `/loop` or `/bugfix`, LSP integration, and Model Context Protocol servers (MCP) provide the tools and execution environment, complemented by computer-use features for desktop automation.

  3. 3

    Context management

    Project instructions live in a `QWEN.md` file at the repository root and can be modularised via `@path/to/file.md`; per the documentation, the file works most reliably when kept short and specific.

  4. 4

    State and memory

    Auto-Memory stores project-related information automatically; a daemon mode (`qwen serve`) connects multiple clients to the same running agent over HTTP and Server-Sent Events via the Agent Client Protocol (ACP).

  5. 5

    Permissions

    A sandbox mode isolates shell commands and file access from the host system and can be extended with additional tools via a custom Dockerfile; a plan mode separates planning from execution before changes are made.

  6. 6

    Verification and feedback

    Checkpointing creates a commit in a shadow Git repository under `~/.qwen/history/<project_hash>` before every approved file change; `/restore` reverts files and conversation history, but must be enabled via `qwen --checkpointing` or `settings.json`.

  7. 7

    Orchestration

    SubAgents delegate focused subtasks to a single model; the documented-as-experimental “Agent Team” lets several teammates collaborate on a shared task list, while the also experimental “Agent Arena” mode has up to five models compete on the same task in isolated Git worktrees before a solution is applied.

Models and model access

Which models the harness uses and how they are obtained

Models and model access
Models Qwen3-Coder and Qwen3-Max models (Qwen family)
Access routes Alibaba Cloud Bailian (Coding Plan, Token Plan), OpenAI-compatible endpoints (OpenAI, Azure, OpenRouter, ModelScope, custom providers), Anthropic Claude API, Google Gemini API / Vertex AI, Ollama / vLLM (local models)
Free choice of model Yes
Custom endpoint / LLM gateway Yes
Qwen Code reads the `OPENAI_API_KEY`, `OPENAI_BASE_URL` and `OPENAI_MODEL` environment variables for any OpenAI-compatible provider; alternatively `ANTHROPIC_BASE_URL`, `GEMINI_API_KEY` or Alibaba's own Bailian endpoints can be configured.
Features
MCP servers Sub-agents Hooks Skills Plugins / extensions Sandbox Headless / CI SDK IDE integration Checkpoints Resume sessions
Running it with herdr
Supported by herdr Yes
State detection Screen manifest
Integration Session
herdr lists Qwen Code in its 'Supported agents' table with the same integration pattern as GitHub Copilot CLI or Letta Code.
More about herdr →

Enterprise use

Data processing, controls and pricing model according to the vendor

Data processing via Alibaba Cloud endpoints

When using the Alibaba Cloud Bailian endpoints (Coding Plan, Token Plan), requests, per the documentation, run through data centres in Beijing or Singapore; anyone who needs a different processing location can instead configure an OpenAI-compatible endpoint hosted in Europe.

No vendor-side SSO documented

Authentication happens via per-provider API keys (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, `BAILIAN_CODING_PLAN_API_KEY`, among others); the documentation does not describe a central enterprise SSO integration.

Configuration hierarchy: environment variables beat settings files

Per the configuration reference, the precedence is command-line arguments over environment variables (including `.env` files) over the system-wide `settings.json` over project and user settings over system defaults. A centrally provisioned system-wide settings file (`/etc/qwen-code/settings.json`) can therefore still be overridden by a user's own environment variables or CLI flags; on its own, it is not a reliable enforcement mechanism.

Telemetry and logging depend on the model provider

Because Qwen Code talks to arbitrary model endpoints, the chosen provider (Alibaba Cloud, OpenAI, Anthropic, Google, or a self-hosted endpoint) determines the logging and retention rules; the project does not document a harness-level, cross-provider telemetry commitment.

Free Qwen OAuth access discontinued

Free Qwen OAuth access ended, per the documentation, on 15 April 2026; already cached tokens, per the documentation, continue working only briefly, and production use requires your own API keys.

Strengths
  • Fully open source (framework and the underlying Qwen models) under Apache-2.0
  • Multi-protocol support for OpenAI, Anthropic, Gemini and Qwen APIs, plus any OpenAI-compatible or local provider (Ollama, vLLM)
  • SubAgents, an experimental Agent Team and a daemon mode for multi-user, multi-client operation
  • Surfaces beyond the terminal: desktop app, IDE plugins, web UI and chat integrations
  • SDKs for TypeScript plus — marked alpha in the documentation — Python and Java for programmatic integration
  • Actively developed with documented evaluation against SWE-bench Verified across multiple versions
Limitations
  • Free Qwen OAuth access, per the documentation, has been discontinued since 15 April 2026; production use requires your own API keys with one of the supported providers
  • Agent Team and Agent Arena are marked experimental in the documentation; Agent Arena allows a maximum of five concurrent models and cannot be resumed once a session ends
  • The official Docker sandbox image is, per the documentation, deliberately kept minimal; additional runtimes such as Java are not included by default and must be added via a custom `.qwen/sandbox.Dockerfile`

Use cases

Typical tasks for this harness

Terminal-based development with a free choice of model provider
Automation via headless mode, CI/CD or batch jobs
Multi-user operation via daemon mode with IDE, TUI or web clients
Comparing several models on the same task in “Agent Arena” mode
Integration into team chat channels such as Telegram, DingTalk, WeChat or Feishu

Building on the basics of an AI Harness: Qwen Code is the open-source coding agent from Alibaba’s Qwen team for terminal, desktop, IDE and chat channels, working with Qwen, Claude, Gemini or any OpenAI-compatible models — licensed under Apache-2.0. As of 20 September 2026.

What is Qwen Code?

Qwen Code is developed by Alibaba’s Qwen team as an open-source project on GitHub (QwenLM/qwen-code) under the Apache-2.0 licence. Per the project description, “this project was originally based on Google Gemini CLI v0.8.2”, but starting from version 0.1 it has been developed independently, without further syncing with the upstream project, as a “multi-protocol, multi-platform agent framework with deep integrations for Qwen models and beyond”. Qwen Code is installed via an install script (curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash), via npm (npm install -g @qwen-code/qwen-code@latest, Node.js 22+), or via Homebrew; the interactive session starts with the qwen command in a project directory, with authentication then handled via the /auth command. Besides the terminal, there is a desktop app, IDE extensions for VS Code, Zed and JetBrains, and a browser-based web interface (“Web Shell”) via qwen serve --open.

Qwen Code as an AI harness

The agent loop’s basic structure mirrors its origin, Gemini CLI: the model requests tools, the core loop executes them and returns results. Qwen Code provides tools via built-in skills (/review, /batch, /loop, /bugfix), LSP integration, computer-use features for desktop automation, and Model Context Protocol servers. Project context comes from a QWEN.md file at the repository root, which can be modularised via @path/to/file.md. Checkpointing saves a commit in a shadow Git repository under ~/.qwen/history/<project_hash> before every approved change; /restore reverts changes. A sandbox mode isolates shell commands and file access from the host system. For split work, SubAgents handle focused single-model tasks, complemented by the experimental “Agent Team” for collaborative multi-agent workflows with a shared task list, and the also experimental “Agent Arena” mode, in which up to five models compete on the same task in isolated Git worktrees before a solution is applied. A daemon mode (qwen serve) connects multiple clients — IDE, TUI, web, or chat channels such as Telegram, DingTalk, WeChat and Feishu — to the same running agent over HTTP and Server-Sent Events.

Models and model access

Qwen Code is primarily built around Qwen models from the Qwen3-Coder and Qwen3-Max families, but is explicitly provider-agnostic through configuration: the OPENAI_API_KEY, OPENAI_BASE_URL and OPENAI_MODEL environment variables connect any OpenAI-compatible provider, including OpenAI itself, Azure, OpenRouter or ModelScope; alternatively, ANTHROPIC_BASE_URL and ANTHROPIC_MODEL configure access to the Claude API, GEMINI_API_KEY to the Gemini API, or — as a separate protocol — GOOGLE_CLOUD_PROJECT (optionally GOOGLE_CLOUD_LOCATION) via Application Default Credentials, or GOOGLE_API_KEY, configure access to Vertex AI. For Alibaba’s own models, the “Coding Plan” and “Token Plan” Bailian endpoints are additionally available, with data centres in Beijing or Singapore. This freely configurable endpoint architecture is exactly the condition under which Qwen Code can also be run through a central, OpenAI-compatible proxy such as the AI Gateway — via its base URL in place of a direct model provider.

Enterprise use: data protection and governance

Because Qwen Code talks to arbitrary model endpoints, the chosen provider determines where data is processed and retained: with Alibaba Cloud Bailian endpoints, data centres are, per the documentation, in Beijing or Singapore, while OpenAI-compatible, Anthropic or Google endpoints apply their own respective terms. The project does not document a harness-level, cross-provider telemetry or SSO solution; authentication happens per provider via individual API keys; per the configuration reference, command-line arguments take the highest priority, followed by environment variables (including .env files), and only then the various settings.json levels (system, project, user and system-defaults files). Free Qwen OAuth access ended, per the documentation, on 15 April 2026. Regardless of the endpoint chosen, source code and prompts go to the configured model provider and belong in the record of processing activities beforehand.

Orchestrating Qwen Code with herdr

The terminal multiplexer herdr lists Qwen Code in its table of supported agents with screen manifest as the state authority and session-level integration — the same pattern as GitHub Copilot CLI or Letta Code. This lets Qwen Code run alongside other coding agents inside a herdr-managed terminal session.

Where it fits: developer harness and enterprise harness

Like other coding harnesses, Qwen Code targets developers working in the terminal, in an IDE, or via daemon mode. For business users without a terminal workflow, CompanyGPT is the matching harness — with tools via MCP servers, integrations and n8n. The AI Gateway provides the shared cost and governance layer across all model access in an organisation, especially since Qwen Code itself can already be configured provider-agnostically. An overview of further harnesses is available on the AI harness overview page. We help organisations fit Qwen Code and other coding harnesses cleanly into an existing AI governance concept.

From developer harness to enterprise harness

Coding harnesses are tools for developers. Business users, cost control and governance need two more layers.

CompanyGPT – the harness for business users

CompanyGPT gives any language model tools via MCP servers, integrations and n8n, company knowledge via companyRAG, roles from Entra ID or Keycloak, and audit logs – operated in your Azure environment or sovereignly on STACKIT.

Discover CompanyGPT
AI Gateway – cost and governance for every agent

The AI Gateway bundles the model access of your tools and coding agents behind an OpenAI-compatible API: authentication via Entra ID, budgets and cost centres per team, user and agent, guardrails and complete logging.

View the AI Gateway

Frequently Asked Questions

What is Qwen Code?

Qwen Code is an open-source AI coding agent from Alibaba's Qwen team for terminal, desktop, IDE and chat channels. Besides Qwen models, it supports OpenAI, Anthropic and Gemini APIs as well as local models, and can be extended via MCP.

Is Qwen Code open source?

Yes. Qwen Code is licensed under Apache-2.0, the source code is in the `QwenLM/qwen-code` GitHub repository, and per the project description both the framework and the underlying Qwen models are open source.

Which models does Qwen Code support?

Qwen Code is built around the Qwen3-Coder and Qwen3-Max model families, but via configurable endpoints it also supports Claude, Gemini and any OpenAI-compatible models, plus local models through Ollama or vLLM.

What is the difference between Qwen Code and Gemini CLI?

Per its own project description, Qwen Code was originally based on Google Gemini CLI version 0.8.2, but since version 0.1 it has been developed independently as a standalone, multi-protocol agent framework with deep Qwen integration, and no longer tracks Gemini CLI directly.

Can Qwen Code be used in a GDPR-compliant way?

That depends on the chosen model endpoint: with Alibaba Cloud Bailian endpoints, data runs through data centres in Beijing or Singapore, while Qwen Code can also be connected to European-hosted or self-run endpoints via `OPENAI_BASE_URL`, `ANTHROPIC_BASE_URL` or `GEMINI_API_KEY`. The documentation makes no blanket GDPR statement.

Does Qwen Code work with herdr?

Yes, herdr lists Qwen Code in its table of supported agents with screen manifest as the state authority and session-level integration.

Introduce coding agents safely in your company

We support selection, model access in the EU, permission design and cost control.