Plandex:面向复杂任务的终端 AI 编码引擎,支持 200 万 token 上下文
核心看点
- 大上下文与项目级索引:默认模型包提供约 200 万 token 有效上下文(单文件约 10 万),借助 tree-sitter 项目地图可索引 2000 万 token 以上的目录,支持 30+ 语言。
- 累积 diff 审查沙箱:AI 生成的改动先进入独立沙箱,不直接污染项目文件,可回滚、调试后再应用,降低“改乱项目”的风险。
- 多模型混用:可组合 Anthropic、OpenAI、Google 及开源模型,并普遍启用上下文缓存以降低成本和延迟。
- 可配置自主性:从全自动(加载文件、规划、执行命令、自动调试)到逐步审查,按任务灵活切换。
- 自动调试:可自动调试构建、lint、测试、部署和脚本等终端命令;若安装 Chrome,还能调试浏览器应用。
技术与实战解读
Plandex 定位是“终端里的 AI 开发工具”,核心差异在于对大型真实项目的韧性:它按步骤只加载必要文件,而非一次性塞入全部上下文,配合 tree-sitter 快速生成项目地图并做语法校验。
工作流上,它把“计划—实现—执行—调试”串成闭环,但所有改动先落在累积 diff 沙箱中,命令执行也受控,便于回滚和排查。这对多文件、跨步骤的重构类任务尤其有价值。
上手路径清晰:30 秒安装脚本、官网文档、示例库,以及本地自托管模式(local mode quickstart),适合对数据隐私有要求的团队。社区热度(304 赞、111 条评论)说明“大任务 + 可控性”是当前 AI 编码工具的痛点。
· · · ·
<img src="/proxy/img?u=aHR0cHM6Ly9pbWcuc2hpZWxkcy5pby9kaXNjb3JkLzEyMTQ4MjU4MzE5NzM3ODU2MDAuc3ZnP3N0eWxlPWZsYXQmbG9nbz1kaXNjb3JkJmxhYmVsPURpc2NvcmQmcmVmcmVzaD0x&amp;sig=3bf89ca4afb2173aa97a" alt="Discord" loading="lazy" referrerpolicy="no-referrer"> <img src="/proxy/img?u=aHR0cHM6Ly9pbWcuc2hpZWxkcy5pby9naXRodWIvc3RhcnMvcGxhbmRleC1haS9wbGFuZGV4P3N0eWxlPXNvY2lhbA&amp;sig=2dfb069b4a541f23a873" alt="GitHub Repo stars" loading="lazy" referrerpolicy="no-referrer"> <img src="/proxy/img?u=aHR0cHM6Ly9pbWcuc2hpZWxkcy5pby90d2l0dGVyL2ZvbGxvdy9QbGFuZGV4QUk_c3R5bGU9c29jaWFs&amp;sig=fb60e2cc0b45be3c416c" alt="Twitter Follow" loading="lazy" referrerpolicy="no-referrer">
An AI coding agent designed for large tasks and real world projects.<br/><br/>
Designed for large tasks and real world projects.<br/><br/>
💻 Plandex is a terminal-based AI development tool that can plan and execute large coding tasks that span many steps and touch dozens of files. It can handle up to 2M tokens of context directly (~100k per file), and can index directories with 20M tokens or more using tree-sitter project maps.
🔬 A cumulative diff review sandbox keeps AI-generated changes separate from your project files until they are ready to go. Command execution is controlled so you can easily roll back and debug. Plandex helps you get the most out of AI without leaving behind a mess in your project.
🧠 Combine the best models from Anthropic, OpenAI, Google, and open source providers to build entire features and apps with a robust terminal-based workflow.
🚀 Plandex is capable of <strong>full autonomy</strong>—it can load relevant files, plan and implement changes, execute commands, and automatically debug—but it's also highly flexible and configurable, giving developers fine-grained control and a step-by-step review process when needed.
💪 Plandex is designed to be resilient to <strong>large projects and files</strong>. If you've found that others tools struggle once your project gets past a certain size or the changes are too complex, give Plandex a shot.
Smart context management that works in big projects
- 🐘 2M token effective context window with default model pack. Plandex loads only what's needed for each step.
- 🗄️ Reliable in large projects and files. Easily generate, review, revise, and apply changes spanning dozens of files.
- 🗺️ Fast project map generation and syntax validation with tree-sitter. Supports 30+ languages.
- 💰 Context caching is used across the board for OpenAI, Anthropic, and Google models, reducing costs and latency.
Tight control or full autonomy—it's up to you
- 🚦 Configurable autonomy: go from full auto mode to fine-grained control depending on the task.
- 🐞 Automated debugging of terminal commands (like builds, linters, tests, deployments, and scripts). If you have Chrome installed, you can also automatically debug browser applications.
Tools that help you get production-ready results
- 💬 A project-aware chat mode that helps you flesh out ideas before moving to implementation. Also great for asking questions and learning about a codebase.
- 🧠 Easily try + combine models from multiple providers. Curated model packs offer different tradeoffs of capability, cost, and speed, as well as open source and provider-specific packs.
- 🛡️ Reliable file edits that prioritize correctness. While most edits are quick and cheap, Plandex validates both syntax and logic as needed, with multiple fallback layers when there are problems.
- 🔀 Full-fledged version control for every update to the plan, including branches for exploring multiple paths or comparing different models.
- 📂 Git integration with commit message generation and optional automatic commits.
Dev-friendly, easy to install
- 🧑💻 REPL mode with fuzzy auto-complete for commands and file loading. Just run
plandexin any project to get started.
- 🛠️ CLI interface for scripting or piping data into context.
- 📦 One-line, zero dependency CLI install. Dockerized local mode for easily self-hosting the server. Cloud-hosting options for extra reliability and convenience.
Workflow 🔄
Examples 🎥
Install 📥
curl -sL https://plandex.ai/install.sh | bash
Note: Windows is supported via WSL. Plandex only works correctly on Windows in the WSL shell. It doesn't work in the Windows CMD prompt or PowerShell.
Hosting ⚖️
| Option | Description | | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Plandex Cloud | Winding down as of 10/3/2025 and no longer accepting new users. Learn more. | | Self-hosted/Local Mode | • Run Plandex locally with Docker or host on your own server.<br/>• Use your own OpenRouter.ai key (or other model provider accounts and API keys).<br/>• Follow the local-mode quickstart to get started. |
Provider keys 🔑
export OPENROUTER_API_KEY=... # if using OpenRouter.ai
Claude Pro/Max subscription 🖇️
If you have a Claude Pro or Max subscription, Plandex can use it when calling Anthropic models. You'll be asked if you want to connect a subscription the first time you run Plandex.
Get started 🚀
First, cd into a project directory where you want to get something done or chat about the project. Make a new directory first with mkdir your-project-dir if you're starting on a new project.
cd your-project-dir
For a new project, you might also want to initialize a git repo. Plandex doesn't require that your project is in a git repo, but it does integrate well with git if you use it.
git init
Now start the Plandex REPL in your project:
plandex
or for short:
pdx
<!-- ☁️ _If you're using Plandex Cloud, you'll be prompted at this point to start a trial._
Then just give the REPL help text a quick read, and you're ready go. The REPL starts in _chat mode_ by default, which is good for fleshing out ideas before moving to implementation. Once the task is clear, Plandex will prompt you to switch to _tell mode_ to make a detailed plan and start writing code. -->
Docs 🛠️
👉 Full documentation.
Discussion and discord 💬
Please feel free to give your feedback, ask questions, report a bug, or just hang out:
Follow and subscribe
- Follow @PlandexAI
- Follow @Danenania (Plandex's creator)
- Subscribe on YouTube
Contributors 👥
⭐️ Please star, fork, explore, and contribute to Plandex. There's a lot of work to do and so much that can be improved.
Here's an overview on setting up a development environment.