On this page#
- What the integration actually does
- The wiring
- Scope
- Invariants
- Workflow
- Stop conditions
- The two things that break it
- Verifying it works
- Team considerations
- FAQ
What the integration actually does#
Cline in VS Code is an agent operating inside your editor: it can inspect repository context, propose or apply file changes, and run approved terminal commands. It does not understand your architecture automatically, preserve unstated invariants, or make an unreliable model safe. The extension is the interface; your repository instructions remain the control plane.
A large language model generates responses by modeling patterns in its available context. That distinction matters. Cline can see only the files, instructions, tool output, and conversation context made available to it—not the undocumented assumptions in a developer’s head.
| Common assumption | What actually happens | |---|---| | “It has the repository open, so it knows the system.” | It sees selected context and discovers more through tool use. | | “Agent mode means it can work independently.” | It can take multiple actions, but those actions still need constraints and review. | | “The model will follow existing patterns.” | Only if those patterns are visible, consistent, and explicitly prioritized. | | “A successful command proves the change is correct.” | It proves only that one command completed successfully. | | “The extension contains the intelligence.” | Cline orchestrates tools around the configured model provider. |
The useful mental model is: Cline proposes a sequence of repository operations under your supervision. The Cline documentation explains its interface and capabilities, but interface setup is only the first layer. For a real codebase, correctness comes from repository-scoped rules, bounded access, and executable verification.
This is also why treating Cline as a VS Code autocomplete replacement is wrong. Autocomplete optimizes the next edit. An agent may read several files, change multiple boundaries, invoke commands, and revise its plan. That larger action surface demands stronger instructions.
Photo by cottonbro studio on Pexels.
The wiring#
A reliable cline vscode setup needs four connections: the extension to a model provider, the agent to repository rules, tool access to the correct environment, and every task to deterministic verification. Configure them in that order. Starting with a broad coding prompt and fixing the damage later is not a workflow.
1. Connect the provider without putting secrets in the repository#
Install Cline from the VS Code extension interface, open its panel, select the intended provider and model, and enter credentials through the extension’s supported configuration flow. Follow the current fields described in the official Cline documentation.
Do not paste API keys into .vscode/settings.json, rule files, shell scripts, or task descriptions. A repository setting is shareable by design; a credential is not. If the provider cannot authenticate, fix that boundary before giving the agent filesystem or terminal work.
Use this repository-safe starting point:
.env
.env.*
*.pem
*.key
This is not sufficient secret management, but it blocks an obvious mistake: turning agent setup into credential distribution.
2. Put operating rules in version control#
Create a repository rule file using the rule mechanism supported by Cline. The exact supported location should follow the Cline documentation; the content should be specific to the repository, not a generic personality prompt.
Paste and adapt this:
# Repository operating rules
## Scope
- Make only changes required by the current task.
- Do not modify generated files, vendored code, or lockfiles unless required.
- Do not add dependencies without explicit approval.

*Photo by Al Nahian on [Pexels](https://www.pexels.com/photo/computer-program-on-computer-screen-7325498/).*
## Invariants
- Preserve public API behavior unless the task explicitly changes it.
- Preserve authorization and data-validation boundaries.
- Keep migrations backward-compatible with the deployed application.
## Workflow
1. Read the nearest relevant tests and implementation before editing.
2. State the intended files and verification commands.
3. Make the smallest coherent change.
4. Run targeted checks, then the repository-required checks.
5. Report changed files, commands run, and unresolved risks.

*Photo by Jakub Zerdzicki on [Pexels](https://www.pexels.com/photo/close-up-of-programmer-typing-code-on-laptop-36496927/).*
## Stop conditions
- Stop if a required secret is unavailable.
- Stop if instructions conflict.
- Stop before destructive database, deployment, or Git operations.Rules should describe observable behavior. “Write high-quality code” is useless; “do not add dependencies without explicit approval” can actually govern a decision.
If you want a maintained starting structure rather than assembling one piecemeal, the PairFoundry Agent Operating Kit is the relevant package. The broader PairFoundry packs overview shows the other available packs without forcing them into this setup.
3. Exclude context that should not be read or changed#
Use Cline’s documented ignore mechanism to exclude secrets, generated output, large artifacts, and irrelevant dependency trees. A practical starting pattern is:
.env
.env.*
node_modules/
dist/
build/
coverage/
*.log
*.pem
*.key
Do not blindly exclude directories containing architectural contracts, migrations, schemas, fixtures, or tests. Context reduction is useful only when it removes noise without hiding constraints.
The same principle appears in other coding-agent workflows. Claude Code’s official documentation is worth reading when comparing how repository instructions and tool permissions are handled, but do not assume similarly named controls are interchangeable. Cline must be configured according to Cline’s own supported mechanisms.
4. Give each task an executable contract#
Do not prompt with “fix checkout.” Provide scope, invariants, and proof:
Fix the checkout failure in the existing payment flow.
Constraints:
- Preserve the public API.
- Do not add dependencies.
- Do not change unrelated formatting.
- Keep the current authorization boundary.
Before editing:
- Identify the failure path and relevant tests.
- List the files you expect to change.
Verification:
- Run the targeted checkout tests.
- Run the repository's required typecheck and lint commands.
- Report any check you could not run and why.This converts a vague request into a reviewable operation. For more examples of repository-agent wiring, use the Wiring It In hub.
The two things that break it#
Most failed vscode cline setups reduce to one of two faults: the agent is running in the wrong execution environment, or its instructions are ambiguous and conflicting. The first produces command and path failures. The second is more dangerous because the output can look polished while violating repository invariants.
1. The terminal environment is not the developer environment#
Concrete symptoms include command not found, No such file or directory, permission denied, or a package-manager message saying the project or workspace cannot be found. Repeatedly asking Cline to retry is the wrong fix.
Check these boundaries:
- Confirm VS Code opened the repository root, not a parent folder or subdirectory.
- Confirm the terminal uses the expected shell and working directory.
- Confirm required runtimes and package managers are available in that terminal.
- Confirm dependencies were installed using the repository’s documented process.
- Run the failing command manually in the same VS Code terminal.
If the manual command fails, Cline is not the problem. Fix the environment first. The extension executes through the available tools; it does not manufacture missing binaries or permissions. The Cline documentation should remain the authority for its terminal and approval behavior.
2. The repository gives the agent competing truths#
The visible symptom is inconsistent behavior: Cline edits generated files, introduces an unapproved dependency, changes a public interface, or declares completion after running only a narrow test. There may be no runtime error at all.
Fix the instruction hierarchy:
- Keep one canonical repository rule set.
- Remove stale or duplicated agent instructions.
- Separate global preferences from repository invariants.
- Make task instructions override defaults only when the exception is explicit.
- Replace adjectives with commands and stop conditions.
- Require the agent to surface conflicts before editing.
Official documentation cannot define your internal architecture. That part belongs in the repository and must be reviewed like code. Engineers who need the fundamentals before adopting a packaged workflow can use PairFoundry’s free foundations track.
Verifying it works#
A working setup must prove context, control, execution, and correctness separately. Seeing Cline generate a plausible diff proves none of them. Verification should deliberately test whether the agent respects a boundary, uses the intended environment, runs the required checks, and reports incomplete evidence honestly.
Use a small real task with a known invariant, then require this sequence:
- Context check: Ask Cline to identify the relevant implementation, tests, and repository rules before editing.
- Plan check: Confirm its proposed files and commands match the task’s actual boundary.
- Control check: Include one prohibited action, such as adding a dependency, and verify that it stops or asks.
- Execution check: Run the targeted test through Cline, then run the same command manually in the same environment.
- Regression check: Run the repository-required broader checks.
- Diff check: Review every changed file, including configuration and lockfiles.
- Evidence check: Require exact commands run, failures encountered, and checks omitted.
Do not accept “tests pass” without the command and scope. A targeted test can pass while compilation, integration behavior, or authorization semantics fail elsewhere. The mechanism described in the large language model overview explains why fluent completion language is not evidence of repository correctness.
Team considerations#
The second developer will expose every hidden local assumption in the setup. If the workflow depends on one person’s shell profile, untracked rules, remembered approvals, or private prompt snippets, it is not team-ready. Commit the operating contract, document prerequisites, and keep credentials and personal preferences outside it.
A team handoff should include:
- The canonical location of Cline rules.
- Supported environment prerequisites, without invented version pins.
- The repository’s install, test, lint, and typecheck commands.
- Explicit protected areas and destructive-action stop conditions.
- The expected model-provider setup, with no shared secret values.
- A sample task used to verify the installation.
- A process for reviewing changes to agent rules.
Do not commit one developer’s absolute paths, shell aliases, provider credentials, or machine-specific settings. Do commit repository invariants and verification expectations.
Finally, review agent-rule changes with the same care as build configuration. A one-line instruction can broaden write scope across the repository. Cline’s official documentation defines the product controls; your team must define what those controls are allowed to do.
Related reading#
- Ralph wiggum Claude Code plugin: the wiring, and the two things that break it
- Claude Code Docker, including the failure mode nobody documents
FAQ#
What is VS Code Cline?#
VS Code Cline is an AI coding agent extension that can inspect repository context, edit files, and use approved tools such as terminal commands. It is more capable—and riskier—than autocomplete because a single task can produce a sequence of actions across multiple files.
Is VS Code Cline free?#
Cline can be installed as a VS Code extension, but model usage may involve separate provider costs or limits. Check the current terms in the official Cline documentation and the selected provider’s configuration rather than assuming extension installation includes model usage.
How to run Cline on VS Code?#
Install the extension, open the Cline panel, configure a supported model provider, add repository-scoped operating rules, exclude sensitive or generated context, and start with a small task that has explicit verification commands. Do not begin with unrestricted repository-wide work.
Is Cline in VS Code safe?#
It is safe enough only when its access matches the task and a developer reviews consequential actions. Keep secrets out of prompts and versioned settings, require approval for destructive operations, constrain repository scope, and verify the resulting diff and commands independently.
Is Cline free for VS Code?#
The extension and the model service are separate concerns. Even when the VS Code extension itself is available without a purchase, the configured model provider may charge for usage. Use the current Cline documentation as the source of truth.