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.
