* docs: design spec for @ session reference + tabbed completion UI * docs: implementation plan for @ session reference + tabbed completion UI * feat(cli): add @session: mention ref parser * feat(core): add SessionReferenceService for slimmed session injection * feat(cli): inject slimmed prior-session context on @session: mention * feat(cli): surface prior sessions as @ completion suggestions * feat(cli): tabbed category layout for @ completion dropdown * feat(cli): ←/→ tab switching for @ completion categories * docs: mark @ session reference design as implemented * fix(cli): preserve assistant text on tool-call turns, keep newest turn under budget, guard stale session results * docs(core): clarify SessionReferenceService slimming rules * perf(cli): remove @ completion input latency from session listing Dispatch file/MCP suggestions immediately and append prior-session suggestions in a second render once the disk listing resolves, instead of blocking the first render on session I/O. Cache the per-cwd session listing for a short TTL so rapid keystrokes don't re-walk the chats dir. * Revert "perf(cli): remove @ completion input latency from session listing" This reverts commit 08bbbc21386ac0cd6db7a6f480f0fd59f2e6b8d4. * fix(cli): harden session ref resolution and i18n tab labels (#7302) * fix(cli): guard session ref I/O errors to never abort the turn (#7302) * fix(cli): strip session: prefix in completion filter and align tab guard (#7302) * fix(cli): address review feedback on session refs and tab tests (#7302) * fix(cli): use SESSION_MENTION_PREFIX constant in completion filter (#7302) * fix(cli): address review feedback on session refs and tab tests (#7302) * fix(cli): address review feedback on session refs and tab tests (#7302) - Constrain ctrl/command on completion tab-switch bindings so ctrl+left/right (word-jump) is not consumed for tab switching - Derive a friendly title from the first user message in SessionReferenceService.resolve() when no explicit title is given, so UUID-based refs show meaningful context headers - Fix dead conditional in plan doc code snippet * fix(cli): surface real session lookup errors and test left tab switch (#7302) * fix(cli): reset suggestion indices when active category tab disappears (#7302) * fix(cli): address review feedback on session refs docs and tests (#7302) * fix(cli): address review feedback on session refs and completion ordering (#7302) * docs(cli): clarify title matching semantics in session reference design (#7302) * test(cli): assert error card in ambiguous session title test (#7302) * fix(core,cli): address review feedback on session refs (#7302) - Replace O(N²) budget trimming with single-pass backward accumulation (maintainer-measured 6.8s → ~80ms for 8k-record sessions) - Include header/marker overhead in approxTokens - Prefer custom_title system record in deriveTitle over first user message - Move session-ref detection before MCP resource ref to prevent collision with an MCP server literally named "session" - Handle bare @session (no colon) as empty filter in completion - Clamp activeSuggestionIndex when suggestion list shrinks - Strengthen not-found test assertion to check ToolCallStatus.Error - Fix unreachable mock state in InputPrompt tab-guard test - Add tests: custom_title derivation, overhead in approxTokens, bare session filter, index clamping, activeCategory reset * fix(core,cli): address review feedback on session refs (#7302) - Fix approxTokens to exclude omission marker cost when not truncated - Clamp visibleStartIndex when suggestion list shrinks to prevent empty dropdown - Document merge order invariant for session suggestions in @ completion * fix(core,cli): address review feedback on session refs (#7302) * fix(core): address review feedback on session refs (#7302) * fix(core,cli): address review feedback on session refs (#7302) * fix(core): address review feedback on session refs (#7302) * fix(cli): address review feedback on session refs (#7302) * fix(core,cli): address review feedback on session refs (#7302) - Wrap MCP category label in t() for i18n consistency - Fix comment to match > 2 tab guard semantics - Add test for Ctrl+arrow with exactly 2 categories (guard boundary) - Fix budget loop to not reserve marker tokens when session fits --------- Co-authored-by: qwen-code-ci-bot <qwen-code-ci-bot@users.noreply.github.com> Co-authored-by: Qwen Code Bot <qwen-code-bot@users.noreply.github.com> Co-authored-by: Shaojin Wen <shaojin.wensj@alibaba-inc.com> |
||
|---|---|---|
| .github | ||
| .husky | ||
| .qwen | ||
| .vscode | ||
| docs | ||
| docs-site | ||
| eslint-rules | ||
| integration-tests | ||
| packages | ||
| patches | ||
| scripts | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierignore | ||
| .prettierrc.json | ||
| .yamllint.yml | ||
| AGENTS.md | ||
| CHANGELOG.md | ||
| CLAUDE.md | ||
| CONTRIBUTING.md | ||
| Dockerfile | ||
| esbuild.config.js | ||
| eslint.config.js | ||
| eslint.legacy-filenames.mjs | ||
| LICENSE | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| SECURITY.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
The open-source AI coding agent that lives in your terminal.
中文 | Deutsch | français | 日本語 | Русский | Português (Brasil)
Why Qwen Code?
- Agentic out of the box — Auto-Memory, Auto-Skills, SubAgents, Agent Teams, and MCP. Dynamic workflows, zero setup.
- Open-source, inside and out — The framework and the Qwen models are open-source. They evolve together. No vendor lock-in.
- Multi-protocol — Supports OpenAI, Anthropic, Gemini, and Qwen APIs. Any third-party provider or local model (Ollama / vLLM). Switch at runtime.
- Beyond the terminal — IDE plugins, Desktop app, daemon mode, SDKs, and IM bots (Telegram / DingTalk / WeChat / Feishu).
Tip
Qwen Code is actively iterating on itself — using its own agent and models to file issues, submit PRs, review code, and run tests. Powered by the community, driven by AI.
Installation
Linux / macOS:
curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash
Windows:
irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex
Restart your terminal after installation to ensure environment variables take effect.
NPM / Homebrew
NPM (requires Node.js 22+):
npm install -g @qwen-code/qwen-code@latest
Homebrew (macOS / Linux):
brew install qwen-code
Quick Start
qwen # Launch interactive terminal UI
# Inside the session:
/auth # Configure your provider and API key
See the Authentication Guide and Settings Reference for detailed setup.
How to Use Qwen Code
| Mode | Command | Use Case |
|---|---|---|
| Interactive | qwen |
Terminal UI with rich rendering, @file references, slash commands |
| Headless | qwen -p "..." |
Scripts, CI/CD, batch processing — no UI |
| IDE | — | VS Code, Zed, JetBrains |
| Desktop | — | Qwen Code Desktop — GUI for macOS, Windows, Linux |
| Daemon | qwen serve |
Shared agent session over HTTP+SSE (ACP). Multiple clients, one agent. (experimental) Docs |
| SDK | — | TypeScript, Python, Java |
| IM Bot | qwen channel |
Connect to Telegram, DingTalk, WeChat, or Feishu |
SDK example (Python)
import asyncio
from qwen_code_sdk import is_sdk_result_message, query
async def main() -> None:
result = query(
"Summarize the repository layout.",
{
"cwd": "/path/to/project",
"path_to_qwen_executable": "qwen",
},
)
async for message in result:
if is_sdk_result_message(message):
print(message["result"])
asyncio.run(main())
Capabilities
If you know Claude Code, you already know Qwen Code — and then some. We've put significant effort into bringing Qwen Code to feature parity with Claude Code, improving both breadth and reliability across the board.
| Feature | Qwen Code | Claude Code |
|---|---|---|
| SubAgents, Agent Teams, Dynamic Workflows | ✓ | ✓ |
| Auto-Memory, Auto-Skills, Hooks | ✓ | ✓ |
| Built-in Skills (/review, /batch, /loop, /bugfix…) | ✓ | ✓ |
| MCP, Plan Mode, LSP Integration | ✓ | ✓ |
| Auto Mode, Sandbox, Git Worktrees | ✓ | ✓ |
| Computer Use (desktop automation) | ✓ | ✓ |
| IDE Plugins (VS Code / JetBrains / Zed) | ✓ | ✓ |
| SDK | ✓ | ✓ |
| Headless Mode, Session Management | ✓ | ✓ |
| Open-source — model and framework | ✓ | — |
| Multi-protocol (OpenAI / Anthropic / Gemini / Qwen + any provider) | ✓ | — |
| Agent Arena (multi-model head-to-head on same task) | ✓ | — |
Daemon Mode — qwen serve (multi-client shared agent) |
✓ | — |
| IM Channels (Telegram / DingTalk / WeChat / Feishu) | ✓ | — |
Ecosystem
-
Qwen Code Desktop — Official desktop app for macOS, Windows, and Linux
-
AionUi — A modern GUI for command-line AI tools including Qwen Code
-
Gemini CLI Desktop — A cross-platform desktop/web/mobile UI for Qwen Code
-
🦞 Qwen Code Claw — Let other agents (Claude, Codex, etc.) delegate coding tasks to Qwen Code via ACP. Paste this prompt into your agent:
Use Qwen Code as a coding agent. First, fetch and read this skill reference:
https://raw.githubusercontent.com/QwenLM/qwen-code/refs/heads/main/.qwen/skills/qwen-code-claw/SKILL.md
Then follow the instructions inside to install, authenticate, and use Qwen Code via acpx for all coding tasks.
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Acknowledgments
This project was originally based on Google Gemini CLI v0.8.2. We gratefully acknowledge the Gemini CLI team's excellent work. Starting from Qwen Code v0.1, we stopped syncing with upstream and began independent development as a multi-protocol, multi-platform agent framework with deep integrations for Qwen models and beyond.
