Skip to content
TTariq AlwalidiAI Developer Tools Directory
Q

Qwen Code

Active and stableRuns locally ✓No paid API

An open-source terminal coding agent that understands repositories, edits files, runs commands and tests, and supports multiple providers and local models.

$npm install -g @qwen-code/qwen-code@latest
💡

Ideal use for this tool

Best for a developer or small team that wants a repository-aware coding agent with explicit permission controls and a choice of cloud or local models. Use default approvals and sandboxing for unfamiliar projects. Do not treat it as a security reviewer or run yolo mode on a sensitive machine.

Details and illustrated features

You ask an AI assistant to fix a bug, but it cannot see the repository structure, so you spend time copying files, explaining commands, and reconciling scattered edits. Qwen Code moves that conversation into the terminal. It reads the project, builds context, proposes a plan, edits code, runs tests, and shows the result. Its practical value is not unattended control; it is one reviewable path from understanding to execution with permissions you can restrict.

🧭 What is Qwen Code and how does it work?

Qwen Code is an open-source coding agent from the Qwen team. It runs in the terminal and also offers VS Code integration, a Web Shell, and a service mode. Start it with qwen inside a project and describe a task. It sends selected context to your configured model and uses tools to read, search, edit, and run shell commands. In default approval mode, it asks before edits and commands; allow, ask, and deny rules can narrow access further.

A local CLI does not make a cloud-model session offline. The provider receives the context sent to it under that provider's policy. Qwen Code can also connect to Ollama, vLLM, or another compatible local endpoint, but quality and context capacity depend on your model and hardware.

Diagram of a request flowing through repository understanding, editing, and tests
Diagram of a request flowing through repository understanding, editing, and tests

Original explanatory diagram, not a Qwen Code screenshot.

🎯 How would you use it, and what does it add?

Start with a bounded, verifiable task: “Reject expired refresh tokens and add a test for the expired case.” Ask it to inspect the relevant files and present a short plan before editing. Approve the change step by step, then have it run the focused test and show git diff. This reduces copying between chat, editor, and terminal while keeping changes and evidence in the repository.

The added value is a single reviewable loop: request, context, plan, edit, test command, and Git diff. It does not guarantee correctness. A model can choose the wrong file or write a test that proves its implementation rather than your requirement. Review it like a human contributor.

🌟 Key features

1. Choose a provider or a local model

Qwen Code supports Qwen, OpenAI, Anthropic, and Gemini protocols, additional built-in providers, and custom endpoints. /auth can connect a Qwen subscription, QwenCloud, Alibaba ModelStudio, or another provider key. Ollama and vLLM can supply a local or internal model.

  • Use it: choose the endpoint and region explicitly, check configuration with /doctor, and switch models with /model.
  • Value: avoid binding the workflow to one model and use an internal endpoint where available.
  • Cost: Qwen Code is free and open source; subscriptions, API use, and local compute are separate.
  • Privacy: the model provider receives requests under its own policy. Disabling Qwen Code statistics does not disable provider collection.
Diagram of Qwen Code connecting to Qwen, third-party, or local model endpoints
Diagram of Qwen Code connecting to Qwen, third-party, or local model endpoints

The diagram shows documented routes; it does not imply equal performance or cost.

2. Approval modes and fine-grained permissions

Modes include plan for analysis only, default for approval before edits and shell commands, auto-edit for automatic file edits with command review, auto for classifier-based decisions, and yolo for approving everything. permissions.allow, ask, and deny rules can constrain tools, commands, and paths; precedence is deny, then ask, then allow.

Begin with /approval-mode default in a new project. Deny secret files and require confirmation for publishing or deletion. Do not assume yolo is safe because it is fast: it can execute commands, write files, and make network requests without confirmation.

Diagram comparing plan, default approval, auto-edit, and yolo modes
Diagram comparing plan, default approval, auto-edit, and yolo modes

The diagram summarizes intervention levels; your rules determine effective access.

3. Sandbox and folder trust must be enabled

Qwen Code can run tools in a sandbox using Docker or Linux policies, but sandboxing is off by default. Enable it with --sandbox or tools.sandbox. Trusted Folders is also off by default; while off, folders count as trusted and project .qwen/settings.json is loaded. Enable security.folderTrust.enabled for repositories you do not already trust.

An untrusted workspace ignores workspace settings and .env files, restricts extensions, and prompts for tools. --yolo does not turn on the sandbox; approval and isolation are separate decisions.

Diagram separating approval, sandboxing, and folder trust
Diagram separating approval, sandboxing, and folder trust

These are independent layers; none is a complete security boundary by itself.

4. Subagents with scoped tasks and tools

Define specialized Subagents in project .qwen/agents/ or user ~/.qwen/agents/ Markdown files. Each can have a focused prompt, separate context, and controlled tools. One agent might review tests while another checks documentation and returns findings to the main session. Agent Teams and workflows are part of the newer capabilities, but details are moving quickly around the Qwen Code 1.0 Preview.

Use subagents for genuinely independent work. Splitting a tiny change increases model use and permission surface without guaranteeing coherent results. Review agent definitions and allowed tools before running one from a repository or extension.

Diagram of a main agent delegating to a test reviewer and documentation researcher
Diagram of a main agent delegating to a test reviewer and documentation researcher

Illustrative delegation; it was not run on a real repository here.

5. Connect tools and services through MCP

Qwen Code loads MCP servers from mcpServers settings and supports HTTP for remote services, stdio for local processes, and legacy SSE. Add one with qwen mcp add --transport http my-server http://localhost:3000/mcp, then inspect it through /mcp.

An MCP server is not permission-free. It may read files, query a database, or call an API according to exposed tools. Use trusted servers, pin versions where possible, and give environment variables, paths, and tools the least access needed. Extensions can bundle MCP servers, skills, and commands and run with Qwen Code's permissions.

Diagram of Qwen Code connecting to local stdio and remote HTTP MCP servers
Diagram of Qwen Code connecting to local stdio and remote HTTP MCP servers

The diagram shows documented transports, not a security endorsement of any server.

6. Editor integration and native diff review

Qwen Code Companion integrates with VS Code and compatible editors. It provides workspace context, open files, cursor position, and native diff review. Install it with /ide install and enable it with /ide enable.

This helps review, but expands the context that can reach the model. The documentation says the companion shares recent files and selected text up to a limit. Disable integration when unnecessary and avoid opening secrets during a session that uses an external provider.

🪜 Practical example: fix token expiry

Illustrative; not run on a real project:

  1. Create a separate branch or worktree, then run qwen --sandbox at the repository root.
  2. Choose /approval-mode default and check /auth and /doctor.
  3. Ask: “Read only the authentication logic and tests. Explain why an expired refresh token is accepted, then propose a three-step plan without editing.”
  4. Review the files and diagnosis. Correct any product-rule assumption.
  5. Approve a failing test first, then the smallest code change.
  6. Approve the focused test command, not a broad command you do not need.
  7. Request git diff --stat, the full diff, and test output. Review before commit or push.
Workflow from reading a bug through plan, edit, test, and diff review
Workflow from reading a bug through plan, edit, test, and diff review

A conservative example; commands and files depend on your project.

⚖️ Compared with manual work

TaskManuallyWith Qwen Code
Gather contextOpen files and paste excerptsSearch and read within the project root
PlanMaintain steps separatelyKeep a file-aware plan in the session
EditMove between chat and editorPropose and apply an approved edit
VerifyRun commands and transfer outputRun a test and keep output in context
External toolsSeparate scripts and integrationsMCP and extensions, with permission review
ReviewCompare file copiesGit diff and VS Code native diff

This describes workflow organization, not measured time savings or a quality guarantee.

Comparison between scattered manual steps and one reviewable loop
Comparison between scattered manual steps and one reviewable loop

🚀 Installation and first run

The latest regular release checked is v0.27.3, published 13 November 2026. Qwen Code 1.0 Preview is also available; its release page warns that interfaces, configuration, and behavior may change. npm installation requires Node.js 22 or newer:

npm install -g @qwen-code/qwen-code@latest
qwen

Homebrew and official standalone packages for macOS, Linux, and Windows are also documented. Do not run curl | bash or irm | iex without reviewing the script and origin; use npm or a pinned release asset when your supply-chain policy needs a more auditable path. We did not install Qwen Code or execute the example during this review.

💰 Cost, privacy, and limits

The repository is licensed Apache-2.0. The software is free, but it needs a model: a Qwen subscription, paid API, another provider, or local compute. A paid API is therefore not technically required, although it may be the practical route for many users.

Anonymous usage statistics are enabled by default and can be disabled with privacy.usageStatisticsEnabled: false or QWEN_USAGE_STATISTICS_ENABLED=false. The docs say Qwen Code statistics exclude code, prompts, responses, and personal information, but are sent to an Alibaba Cloud endpoint while enabled. Advanced telemetry is separate and can send sensitive data to OTLP when includeSensitiveSpanAttributes is enabled; only use that with a trusted destination. Your model provider has a separate policy.

Important limits: Qwen Code 1.0 remains a preview, and fast-moving features can break settings or extensions. Sandbox and folder trust are off by default. Results depend on the model and context, and integrations add permissions. Passing tests do not replace logic and security review.

📚 Sources and verification date

Checked 13 November 2026. The GitHub API reported 29,762 stars and 3,391 forks, with the last push at 12 November 2026, 22:14 UTC. These changing popularity counts are not quality or security ratings. We did not install the tool or send code to any provider.