Cline in production: the autonomous code agent for VS Code I use with deliberate constraints
Why does everyone show what Cline can do and nobody talks about what it shouldn't do? We've spent months watching demos of agents that write tests, refactor entire modules, and even browse the web to pull data — all inside VS Code, all "autonomous." But the day someone lets an agent run rm -rf without reviewing the context, the conversation about productivity takes a very different tone.
I'll put my thesis before the first H2: autonomous code agents are productive if you design their limits before using them, and dangerous if you trust that they know on their own where to stop. The value of Cline isn't in how much it can do alone — it's in how much you can trust it without losing control of the system.
What Cline is and what the official docs actually say
Cline is a VS Code extension that exposes an AI agent with direct action capabilities: it can read and write files, execute commands in the integrated terminal, use the browser (via Playwright), and call MCPs (Model Context Protocol servers). It supports Claude via the Anthropic API, OpenRouter, and other configurable providers.
What the official page makes clear — and what a lot of people gloss over — is that Cline operates in different approval modes. The default mode requires user confirmation for each action. But that confirmation can be turned off. That's where the mental model problem starts.
What the documentation doesn't say is when it makes sense to hand it a complete task versus when to use it as an interactive assistant. That judgment you have to bring yourself. The tool doesn't solve it by design.
Two capabilities worth understanding before using Cline without restrictions:
- Command execution: Cline can run any command the system terminal accepts. If the workspace has broad permissions, the agent has them too.
- Browser use: Cline can open pages, click around, and extract content. Useful for scraping docs. Also potentially risky if the context isn't controlled.
Where people go wrong configuring it
The most common recipe I see floating around: install the extension, connect the Claude or OpenRouter API, open a project, and tell Cline "refactor this module." The agent starts working, asks for confirmations, you hit "approve" several times in a row without really reading — and at some point the agent executes something you didn't expect.
The hidden cost isn't technical, it's attentional. Cline asks for approvals, but if you train the reflex to approve everything quickly, the approval stops being a real control and becomes a rubber stamp. The "I'm in control" mental model breaks down exactly there.
The counterexample that worries me most: an agent with terminal access, running in a workspace that includes environment variables in non-gitignored .env files, with instructions along the lines of "clean up the temporary files in this project." The agent doesn't know what "temporary" means to you — it only has context for what it can see.
A pattern I've seen repeatedly in teams adopting code agents: the first few weeks go fine because everyone's paying attention. The following weeks, attention drops and errors show up in the least expected places — not in the generated code, but in the side effects of the commands that were executed.
Decision matrix: what I allow, what I don't, and why
Before opening Cline in any project, I run through this checklist. It's not from the official docs — it's the criteria I've built over time, and I'm offering it as a starting point for you to build your own.
✅ What I allow without hesitation
| Task | Reason |
|---|---|
| Read any file in the workspace | Read-only, reversible by default |
Create new files in src/ or components/ | Changes visible in the Git diff |
| Generate unit tests in isolated files | Easy to review, no side effects |
| Explain existing code | Zero write risk |
| Suggest refactors (without applying them alone) | Control stays in my hands |
⚠️ What I allow with explicit review
| Task | Condition |
|---|---|
| Modify existing files in critical modules | Only if the diff is readable in < 2 minutes |
| Run build or test commands | Only in environments without production access |
Install dependencies (npm install X) | I check the package before approving |
| Use the browser to pull documentation | With known URLs and clear context |
❌ What I never allow autonomously
| Action | Reason |
|---|---|
| Execute commands that touch environment variables | Risk of unintentional exposure or modification |
Delete files (any form of rm, del) | Irreversible if Git isn't up to date |
| Run database migrations | Without context of the real schema state, it can corrupt data |
Access credentials, tokens, or .env files | Hard limit, always |
| Operate in auto-approve mode in projects with infra | The agent doesn't know what's beyond the workspace |
The logic behind this matrix is simple: reversibility and visibility. If an action is easy to undo and I can see it before it's applied, I can delegate. If it's opaque or irreversible, I don't delegate — no matter how much I trust the model.
Configuration snippet: how I structure the initial context
A frequent configuration mistake is starting a session without giving the agent context about the scope of the work. Cline reads the workspace, but it doesn't know what the operational limits are unless you declare them.
This is the kind of context instruction I include in the extension's Custom Instructions (the "System Prompt" section in the settings):
# Operational constraints for this workspace
## What you can do without asking for additional permission
- Read any file in the project
- Create new files in /src, /components, /tests
- Propose changes with an explanation before applying them
## What requires explicit confirmation from me
- Modify configuration files (*.config.*, tsconfig, vite.config, etc.)
- Install or remove dependencies
- Execute any command in the terminal
## What you must never do, even if I ask you to
- Read, modify, or mention the contents of .env files
- Execute commands with rm, del, drop, truncate
- Run database migrations or seeds
- Operate in auto-approve mode without my explicit confirmationUnder 15 lines. The model processes them as part of the system context and respects them — not as an absolute guarantee, but as a strong signal of what behavior you expect. This doesn't replace reviewing each approval, but it reduces the friction of having to repeat the same constraints every single conversation.
Honest limits: what I won't claim without my own data
There are claims circulating about Cline that I have no way to validate without a controlled experiment, and I'd rather say that plainly than dress it up:
- "Cline speeds up development X times": There's no publicly reproducible metric. It depends on the type of task, the model chosen, and the quality of the context. If someone gives you a number without showing you the setup, discard it.
- "Auto-approve mode is safe if the project is well structured": There's no public evidence backing this as a general practice. It's a hypothesis each team would have to validate with their own test suite, Git hooks, and log review.
- "Claude is better than GPT-4o for Cline": Depends on the task type. For refactoring with long context, Claude has documented advantages from Anthropic — but for specific tasks, the difference can be marginal. This requires your own experiment, not third-party benchmarks.
What I can stand behind with the public documentation: Cline exposes the capabilities it describes on the Marketplace, the approval modes exist and are configurable, and using MCPs expands the agent's action surface well beyond the filesystem. Those are the facts. The rest is judgment I'm not going to pretend is more validated than it is.
My actual recommendation, stated as a practice rather than a promise: build an isolated test project — no real credentials, no infra access — and run Cline there before you trust it anywhere that matters. I can't tell you the numbers you'll get. I can tell you that skipping this step is how the .env scenario above stops being hypothetical.
FAQ
Is Cline free? The extension is free on the VS Code Marketplace. What costs money is the API of whatever model you use — whether that's Anthropic (Claude), OpenRouter, or another compatible provider. The cost depends on the model chosen and the volume of tokens the agent consumes per session.
Which model should I use with Cline? The official documentation lists Claude (Anthropic) as the reference model, but Cline is compatible with any provider that supports the API. For coding tasks with long context, Claude 3.5 Sonnet and Claude 3.7 Sonnet have a solid reputation in the community. For experimenting with controlled costs, OpenRouter lets you try multiple models without committing to a single provider.
Is it safe to let Cline execute terminal commands? Depends on which commands and with what permissions. If approval mode is active and you review each action before confirming, the risk is manageable. If you use auto-approve in a workspace with access to credentials or infra, the risk is real. Security doesn't come from the tool — it comes from the judgment you bring when you configure it.
How is Cline different from GitHub Copilot? Copilot is primarily a code completion assistant — it suggests lines or blocks as you type. Cline is an agent: it can take chained actions, execute commands, write multiple files, and operate with a degree of autonomy. They're tools with different mental models. Copilot helps you write faster; Cline tries to execute tasks. The difference matters because the level of review required is also different.
What is the Model Context Protocol (MCP) and why does it matter in Cline? MCP is an open protocol that lets agents connect to external servers to extend their capabilities — database access, APIs, external file systems, third-party tools. In Cline, MCPs expand the agent's action surface beyond the local workspace. More capabilities = more utility, but also more risk surface if you don't know what MCP servers you're connecting to.
Can I use Cline for TypeScript and Next.js projects?
Yes, and it works well for that stack. Cline understands TypeScript module context, can read tsconfig.json, navigate a Next.js App Router project structure, and generate typed code. Where you have to be careful is with Server Components vs Client Components routes — the agent can get that distinction wrong if the context isn't explicit. Always review the imports and "use client" directives before approving changes in that layer.
Where I land
I started this piece with a concrete friction: everyone shows Cline's potential, nobody talks about the limits. Here's the decision that friction pushed me toward.
Cline is not a junior you delegate to and stop watching. It's not a toy you have to use fearfully either. What I'll actually say, with the certainty the public docs support and no more: it does what the Marketplace page says it does, the approval modes are real, and MCPs genuinely widen its reach. Everything past that — speed claims, "it's safe if your project is tidy," model comparisons — is judgment I haven't verified myself, and I'm not going to hand it to you dressed as fact.
My mental model, for what it's worth: Cline is an executor, not an arbiter. It executes well what you ask it to within the context you give it. If that context includes clear restrictions, it respects them. If it doesn't, it assumes everything is fair game — because it has no way of knowing what's irreversible for you.
The time investment isn't in learning every feature of the extension. It's in writing the operational contract before the first session: what it can touch, what it can execute, what it can never do. Ten minutes of configuration prevents the kind of mistake that has no undo — and I say that as the reminder I'd give myself before opening it in a project that actually matters.
If you're already using agents in your workflow and want to think about the broader security layer, the analysis of OWASP LLM Top 10 or how Node.js handles the event loop in backend architectures gives useful context for understanding where the agent does — and doesn't — have real visibility into the system.
The uncomfortable question worth sitting with before your next session: if Cline ran the wrong command right now, could you undo it in under a minute — or are you trusting the approval prompt to catch what your own attention already stopped catching?
Original source:
- Cline — VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev
Related Articles
Server Actions Solves Your Mutation, Not Your Cache
Server Actions in Next.js 16 App Router makes mutations dead simple without writing an endpoint. But when you need client-side cache, optimistic revalidation, or reactive data shared across components, that's where Server Actions falls short — and TanStack Query steps in to solve that, not to replace it.
Aug 17 2026 · 8′ · Tutorials · TypeScript · app-router
A native discriminated union already does what Either promises
I wrote about fp-ts this week and was left with an uncomfortable doubt: did I really need all that machinery? A look at when a native discriminated union solves the same problem as Either/Option without the learning curve.
Aug 14 2026 · 7′ · Tutorials · TypeScript · arquitectura de software
tsconfig paths in Next.js 16 App Router: when they help and when they silently break the build
Path aliases look innocent until the production build fails with no clear message. I documented the 3 most common breakage cases in a monorepo with Next.js 16 App Router and strict TypeScript, and the config pattern that survived.
Aug 14 2026 · 9′ · Tutorials · TypeScript · pnpm
Comments (0)
What do you think of this?
Drop your comment in 10 seconds.
We only use your login to show your name and avatar. No spam.
No comments yet. Be the first — your take matters most when we're few.