Plandex

Plandex is an open-source terminal-based AI coding agent designed to handle complex, multi-file engineering tasks in large codebases. Created by Dane Schneider and the open-source community, Plandex orchestrates multi-step development workflows by breaking down prompts into structured execution plans across multiple files. In daily use, Plandex operates through a dedicated CLI interface backed by a client-server architecture. Developers add relevant project context, directories, files, or docs into an isolated context window, submit prompts, and let Plandex propose changes in a sandboxed plan. It supports multiple LLM providers (including Anthropic Claude and OpenAI) routed via a LiteLLM proxy integration, featuring automatic fallback mechanisms and streaming error handling. What distinguishes Plandex is its explicit branching, planning, and sandboxing architecture. Unlike agents that apply edits directly to the working directory, Plandex manages isolated plans with version control primitives, allowing engineers to review unified diffs, refine iterations, recover past iterations using reflog mechanics, and apply changes only when satisfied. Plandex is open source. While a hosted Plandex Cloud offering was previously available, the agent is designed to run self-hosted with local servers and user-provided API keys.

Tags: ai agent, cli, code assistant, coding agent, developer tools, OpenSource

Visit Plandex

Key features

  • Plan sandboxing — isolates AI-generated code changes in separate plans before applying diffs to your working directory. - Multi-model routing and fallback — utilizes LiteLLM proxy integration with fallback support across Claude, OpenAI, and other LLM endpoints. - Branching and version recovery — incorporates internal version tracking and reflog utilities to recover and rollback iterations cleanly. - Multi-file context management — allows indexing and feeding entire subdirectories, files, and external documentation into the agent context. - Self-hosted client-server architecture — decouples the CLI interface from the execution and proxy engine for local or centralized self-hosting.

Use cases

Use Case: Multi-File Feature Implementations A developer needs to implement a feature touching backend routes, database models, and frontend components. Plandex gathers the relevant file contexts into a plan, writes coordinated updates across the stack, and outputs a complete multi-file diff for review before writing to disk.

Use Case: Large-Scale Refactoring and Migrations When updating deprecated API calls or migrating configurations across dozens of files, Plandex can iteratively modify target files within an isolated branch, allowing developers to inspect each step without dirtying the Git working tree.

Use Case: Safe Iterative Debugging An engineer can reproduce a bug report, let Plandex explore fixes across multiple candidate modules, and use its built-in branch and reflog mechanisms to revert unsuccessful attempts without manually managing Git stashes.

Who it is for

Plandex is suited for software engineers who want strict control and visual diff verification over multi-file AI code generation rather than immediate inline file modifications. It is ideal for developers who prefer self-hosted infrastructure and granular context management, but may be less suitable for developers looking for quick, single-line in-editor code completions.

Install guide

Installation Install the Plandex CLI using the standard installation script: bash curl -sL https://plandex.ai/install.sh | bash Alternatively, clone and build the repository from source: bash git clone https://github.com/plandex-ai/plandex.git cd plandex

First Run Set your model API keys in your environment and start a new project context: bash export OPENAI_API_KEY="your-openai-api-key" export ANTHROPIC_API_KEY="your-anthropic-api-key" # Initialize Plandex in your repository plandex new

Example Session Load relevant files into context, instruct the agent to plan an update, and review the proposed diff: bash # Add files to the active plan context plandex load app/main.go app/routes/ # Issue a prompt to plan changes plandex tell "Add structured JSON logging and healthcheck endpoint to the router" # Review the planned diff plandex diff # Apply changes to your working tree once verified plandex apply

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • Subtask — Subtask is an open-source CLI agent harness and orchestration tool developed by zippoxer in Go. It is built to coordinate…
  • pi-reflect — pi-reflect is an open-source agent harness and self-improvement extension for pi coding agents, developed by jo-inc. It inspects agent session…
  • EchoCoding — EchoCoding is an open-source agent harness and audio-augmented developer tooling layer created by launsion-boop. Designed to run alongside AI coding…
  • OSOP Agent Rules — OSOP Agent Rules is an open-source orchestration harness and rule repository developed by Archie0125 (osop.ai) designed to standardize agent behavior,…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories