How to Use Cline in VS Code
Table of contents
Cline is a VS Code extension that turns your editor into an autonomous coding agent: it reads your project, plans changes in Plan mode and carries them out in Act mode, showing every edit as a diff you approve. It is open source and works with your own API key or with local models.
Cline is an open-source VS Code extension that turns the editor into a coding agent: it reads your project, proposes a plan, edits several files and runs commands for you, always showing each change as a diff you approve before it is applied. Unlike a plain autocomplete, Cline reasons about the whole task and chains the actions needed to solve it. In this guide you will see what Cline is, how to install it and choose a model, how Plan mode and Act mode work, how it approves each action and how it differs from Cursor and GitHub Copilot. The same explanation is available in Spanish.
Key takeaways
- Cline is an autonomous coding agent that lives in the VS Code sidebar, is open source (Apache 2.0 licence) and has more than 5 million installs and over 64,000 stars on GitHub.
- It works with your own API key or with local models: it supports more than 30 providers, including Anthropic, OpenAI, Google Gemini, OpenRouter and models you run locally with Ollama or LM Studio.
- Plan mode reasons and lays out the strategy without touching anything; Act mode carries out the changes, and every file edit and terminal command is shown as a diff you approve.
- It is compatible with the Model Context Protocol (MCP), so you can extend its tools by connecting external servers.
- You pay only for model usage: with a frontier model it reaches 88.6% on SWE-bench Verified, the same figure as paid tools like Cursor ($20/mo) or GitHub Copilot ($10/mo).
What is Cline?
Cline is an open-source coding agent that integrates into VS Code as just another extension. It was born in 2024 under the name Claude Dev (which is why the extension identifier is still saoudrizwan.claude-dev) and is today one of the most-used coding agents: it has more than 5 million installs and over 64,000 stars on its GitHub repository[1]. It ships under the Apache 2.0 licence, so you can read, audit and modify all of its code.
The difference from a classic assistant is autonomy. An autocomplete suggests the next line; Cline receives a task in natural language ("add pagination to the product list"), examines the project structure, understands how the files relate and makes coordinated changes across several of them, also running any terminal commands needed. It is, in essence, an AI agent specialised in writing and editing code inside your editor.
Beyond the VS Code extension, the project is also offered as a JetBrains plugin, a command-line tool and an SDK to embed it in your own workflows. This guide focuses on the most common use: the extension inside VS Code.
Installation and choosing a model
Installing Cline takes less than a minute. Open VS Code, go to the extensions view (Ctrl+Shift+X), search for "Cline" and click Install. If you prefer the command line, you can install it directly with the code binary:
code --install-extension saoudrizwan.claude-dev
After installing, a Cline icon appears in the activity bar. When you open it for the first time it will ask you to configure a model provider, because Cline includes none: you decide which brain to give it. It supports more than 30 providers, from commercial ones (Anthropic, OpenAI, Google Gemini, AWS Bedrock, OpenRouter) to models you run on your own machine with Ollama or LM Studio, plus Cline’s own paid gateway if you would rather not manage keys.
To start with an API key, pick the provider, paste the key and choose the model. To work locally, choose Ollama as the provider and give it the server URL (http://localhost:11434 by default) and the downloaded model. The rule is the same as with any agent: the better the model reasons, the less Cline derails on long tasks, so for serious work a frontier model is best, keeping local models for bounded tasks or for privacy.
Plan mode and Act mode
The feature that defines Cline is the split between thinking and acting. At the bottom of the chat there is a switch with two modes, and knowing when to use each is the key to getting the most out of it.
Plan mode is, in the words of Cline’s documentation, "a non-destructive reasoning phase": Cline reads your project, asks you questions and proposes an approach, but does not write a single line or run any command. It is the moment to refine the approach, ask for a different architecture or narrow the scope before it touches anything. Act mode is the execution phase: Cline applies the agreed plan by editing files and running commands, one at a time.
In practice, the recommended flow is to start in Plan mode for any non-trivial task. Describe the goal, let Cline explore the code and propose the steps, correct whatever does not fit and, once the plan convinces you, switch to Act mode to have it carried out. This split avoids the most feared failure of coding agents: rewriting half the project in the wrong direction because it misread the request.
Approving actions and editing files
Although Act mode executes, it does not do so blindly. Every sensitive action goes through your approval. When Cline is about to modify a file, it shows the change as a diff inside the editor: you see exactly which lines it removes and which it adds, and you decide whether to accept, reject or edit it before applying. When it wants to run a terminal command, it shows it and waits for your confirmation before launching it.
You: Add email validation to the signup form and a test.
Cline: [Plan] I will edit src/forms/signup.ts and create tests/signup.test.ts.
Cline: [Act] Proposes diff of src/forms/signup.ts -> [Accept] [Reject]
Cline: [Act] Run: npm test -> [Run] [Cancel]
This human checkpoint is the agent’s main safety defence, which is why it pays to review each diff calmly rather than accepting everything in a chain. For repetitive, low-risk tasks, Cline offers a configurable auto-approval: you can let it read files or run certain commands without asking, carefully bounding what you grant. On top of that, being compatible with the Model Context Protocol, you can give it new tools by connecting MCP servers; if you want to build your own, we cover it in building your own MCP server.
Cline versus Cursor and Copilot
All three tools write code with AI, but they start from different philosophies. Cursor is a full editor (a VS Code fork) with a $20/mo subscription that includes a usage pool; its experience is very polished, but it is proprietary and ties you to its editor. GitHub Copilot started as autocomplete and today includes an agent mode inside VS Code, with a $10/mo Pro plan; it is convenient and deeply integrated, but also closed. You can compare Cursor in detail in our guide to the Cursor editor and GitHub’s approach in Copilot Workspace.
Cline plays a different card: it is open source and charges nothing for the tool, you only pay for what you consume from the model (the BYOK model, "bring your own key"). That makes it transparent and potentially cheaper if you choose the model well, in exchange for managing the keys yourself. With a frontier model, an open-source agent like Cline reaches the same 88.6% on SWE-bench Verified as the paid tools, because quality comes mainly from the model, not the wrapper. If this open philosophy appeals to you, its fork Roo Code takes the approach even further with custom modes.
Frequently asked questions
Is Cline free?
The extension is free and open source (Apache 2.0 licence): you do not pay for the tool. What does cost money is the language-model usage, because Cline works with your own API key and each task consumes tokens. With a cheap model or with models you run on your own machine via Ollama, the spend can stay below a few euros a month; with a frontier model for intensive work, it rises with usage.
Can I use Cline offline with a local model?
Yes. Cline supports Ollama and LM Studio as providers, so you can connect an open model running on your own machine and work without sending your code to an external service. The trade-off is that local models tend to reason worse on long tasks than frontier models, so they are better for bounded changes or when privacy is the priority.
How do Cline and Roo Code differ?
Roo Code is a fork of Cline, meaning it starts from the same code and shares the Plan and Act modes idea. Roo Code adds custom modes (such as Architect, Code or Debug) and more configuration options, while Cline leans toward a more direct experience. Both are open source and work with your own key, so the choice comes down to how much customisation you want.
Conclusion
Cline turns VS Code into a coding agent with no strings attached: it is open source, works with the model you choose (in the cloud or on your own machine) and keeps control in your hands through the diff you approve at each step. The winning flow is simple: plan in Plan mode, review the approach and let Act mode carry it out while you validate each change. The natural next step is to try it on a real task and compare it with its fork Roo Code or with the Cursor editor to decide which fits your way of working best.
Sources: [1] Cline documentation, installation[2], [2] Cline on GitHub[1], [3] Cline on the VS Code Marketplace[3], [4] Cline project website[4], [5] Comparison of Cursor alternatives, morphllm[5].
Sources
Source code
Access all the source code for this post on GitHub.
View on GitHub