# Table of Contents
- [What is Cline? | Cline](#what-is-cline-cline)
- [Cline Documentation | Cline](#cline-documentation-cline)
- [Installing Cline | Cline](#installing-cline-cline)
- [For New Coders | Cline](#for-new-coders-cline)
- [Installing Dev Essentials | Cline](#installing-dev-essentials-cline)
- [Our Favorite Tech Stack | Cline](#our-favorite-tech-stack-cline)
- [Context Management | Cline](#context-management-cline)
- [Cline Tools Guide | Cline](#cline-tools-guide-cline)
- [Model Selection Guide | Cline](#model-selection-guide-cline)
- [Cloud Provider Integration | Cline](#cloud-provider-integration-cline)
- [Cline Memory Bank | Cline](#cline-memory-bank-cline)
- [MCP Servers | Cline](#mcp-servers-cline)
- [Checkpoints and Messages | Cline](#checkpoints-and-messages-cline)
- [Custom Instructions | Cline](#custom-instructions-cline)
- [Security Concerns | Cline](#security-concerns-cline)
- [Remote Browser Support | Cline](#remote-browser-support-cline)
- [New Task Tool | Cline](#new-task-tool-cline)
---
# What is Cline? | Cline
Cline is an AI development assistant which integrates with Microsoft Visual Studio Code. It provides an interface between your IDE and LLMs facilitating code development, increasing productivity and lowering the barrier to entry for new coders. Depending on permissions, Cline can read/write files, execute commands, use your web browser, and expand its capabilities with Model Context Protocol servers.
What makes Cline distinctive is its thoughtful approach to code generation and its extensive integration capabilities. Rather than simply generating code snippets, Cline collaborates with developers by planning solutions step-by-step, maintaining awareness of the entire development environment, and requiring explicit approval for all changes. It can understand large codebases, accelerate onboarding for new engineers, and connect with hundreds of tools through its Model Context Protocol Marketplace, enabling everything from streamlined project deployments to automated incident responseβall through natural language commands.
[PreviousCline Documentation](/)
[NextFor New Coders](/getting-started/for-new-coders)
Last updated 20 days ago
---
# Cline Documentation | Cline
Welcome to the Cline documentation - your comprehensive guide to using and extending Cline's capabilities. Here you'll find resources to help you get started, improve your skills, and contribute to the project.
[](#getting-started)
Getting Started
-----------------------------------------
* [What is Cline?](/getting-started/what-is-cline)
* **New to coding?** We've prepared a gentle introduction:
* [Getting Started for New Coders](/getting-started/for-new-coders)
* [Installing Cline](/getting-started/installing-cline)
[](#improving-your-prompting-skills)
Improving Your Prompting Skills
-------------------------------------------------------------------------
* **Want to communicate more effectively with Cline?** Explore:
* [Prompt Engineering Guide](/improving-your-prompting-skills/prompting)
* [Cline Memory Bank](/improving-your-prompting-skills/cline-memory-bank)
[](#exploring-clines-tools)
Exploring Cline's Tools
--------------------------------------------------------
* **Understand Cline's capabilities:**
* [Cline Tools Guide](/exploring-clines-tools/cline-tools-guide)
* [Checkpoints and Editing Messages](/exploring-clines-tools/checkpoints)
* [Plan and Act Modes](/exploring-clines-tools/plan-and-act-modes-a-guide-to-effective-ai-development)
* **Extend Cline with MCP Servers:**
* [MCP Overview](/mcp-servers/mcp)
* [Building MCP Servers from GitHub](/mcp-servers/mcp-server-from-github)
* [Building Custom MCP Servers](/mcp-servers/mcp-server-from-scratch)
[](#enterprise-solutions)
Enterprise Solutions
---------------------------------------------------
* **Using Cline at the corporate level**
* [Security Concerns](/enterprise-solutions/security-concerns)
* [Cloud Provider Integration](/enterprise-solutions/cloud-provider-integration)
* [MCP Servers](/enterprise-solutions/mcp-servers)
* [Custom instructions](/enterprise-solutions/custom-instructions)
[](#contributing-to-cline)
Contributing to Cline
-----------------------------------------------------
* **Interested in contributing?** We welcome your input:
* Feel free to submit a pull request
* [Contribution Guidelines](https://github.com/cline/cline/blob/main/CONTRIBUTING.md)
* Join our [Discord Community](https://discord.gg/cline)
[](#additional-resources)
Additional Resources
---------------------------------------------------
* **Cline GitHub Repository:** [https://github.com/cline/cline](https://github.com/cline/cline)
* **MCP Documentation:** [https://modelcontextprotocol.org/docs](https://modelcontextprotocol.org/docs)
We're always looking to improve this documentation. If you have suggestions or find areas that could be enhanced, please let us know. Your feedback helps make Cline better for everyone!
[NextWhat is Cline?](/getting-started/what-is-cline)
Last updated 11 days ago
---
# Installing Cline | Cline
[PreviousFor New Coders](/getting-started/for-new-coders)
[NextInstalling Dev Essentials](/getting-started/installing-dev-essentials)
Last updated 23 days ago
###
[](#installation-options)
Installation Options
* **VS Code Marketplace (Recommended):** Fastest method for standard VS Code and Cursor users.
* **Open VSX Registry:** For VS Code-compatible editors like VSCodium.
###
[](#vs-code-marketplace-step-by-step-setup)
π οΈ VS Code Marketplace: Step-by-Step Setup
Follow these steps to get Cline up and running:
1. **Open VS Code:** Launch the VS Code application.
> β οΈ **Note:** If VS Code shows "Running extensions might...", click "Allow".
2. **Open Your Cline Folder:** In VS Code, open the Cline folder you created in Documents.
3. **Navigate to Extensions:** Click on the Extensions icon in the Activity Bar on the side of VS Code (`Ctrl + Shift + X` or `Cmd + Shift + X`).
4. **Search for 'Cline':** In the Extensions search bar, type `Cline`.
1. **Install the Extension:** Click the "Install" button next to the Cline extension.
2. **Open Cline:**
* Click the Cline icon in the Activity Bar.
* Or, use the command palette (`Ctrl/Cmd + Shift + P`) and type "Cline: Open In New Tab" for a better view.
3. **Troubleshooting:** If you don't see the Cline icon, try restarting VS Code.
> β
**Pro Tip:** You should see the Cline chat window appear in your VS Code editor!
###
[](#open-vsx-registry)
π Open VSX Registry
For VS Code-compatible editors without Marketplace access (like VSCodium and Windsurf):
1. Open your editor.
2. Access the Extensions view.
3. Search for "Cline".
4. Select "Cline" by saoudrizwan and click **Install**.
5. Reload if prompted.
###
[](#creating-your-cline-account)
π€ Creating Your Cline Account
Now that you have Cline installed, let's get you set up with your account:
1. **Sign In to Cline:**
* Click the **Sign In** button in the Cline extension.
2. **Start with Free Credits:**
* No credit card needed!
3. **Available AI Models:**
* Anthropic Claude 3.5-Sonnet (recommended for coding)
* DeepSeek Chat (cost-effective alternative)
* Google Gemini 2.0 Flash
* And more β all through your Cline account.
###
[](#your-first-interaction-with-cline)
π» Your First Interaction with Cline
You're ready to start building! Copy and paste this prompt into the Cline chat window:
Copy
Hey Cline! Could you help me create a new project folder called "hello-world" in my Cline directory and make a simple webpage that says "Hello World" in big blue text?
> β
**Pro Tip:** Cline will help you create the project folder and set up your first webpage!
###
[](#tips-for-working-with-cline)
π§© Tips for Working with Cline
* **Ask Questions:** If you're unsure about something, ask Cline!
* **Use Screenshots:** Cline can understand images β show him what you're working on.
* **Copy and Paste Errors:** Share error messages in the chat for solutions.
* **Speak Plainly:** Use your own words β Cline will translate them into code.
###
[](#still-struggling)
π« Still Struggling?
Join our Discord community and engage with our team and other Cline users directly.
You'll be taken to to create your account.
[app.cline.bot](https://app.cline.bot)
_VS Code marketplace with Cline extension ready to install_

---
# For New Coders | Cline
[PreviousWhat is Cline?](/getting-started/what-is-cline)
[NextInstalling Cline](/getting-started/installing-cline)
Last updated 23 days ago
> π‘ **Tip:** If you're completely new to coding, take your time with each step. There's no rush β Cline is here to guide you!
###
[](#getting-started)
π Getting Started
Before you jump into coding, make sure you have these essentials ready:
####
[](#id-1.-vs-code)
1\. **VS Code**
A popular, free, and powerful code editor.
πΊ **Recommended YouTube Tutorial:**
> β
**Pro Tip:** Install VS Code in your Applications folder (macOS) or Program Files (Windows) for easy access from your dock or start menu.
####
[](#id-2.-essential-development-tools)
2\. **Essential Development Tools**
Basic software required for coding efficiently:
* Homebrew (macOS)
* Node.js
* Git
π Follow our detailed guide on Installing Essential Development Tools with step-by-step help from Cline.
πΊ **Recommended YouTube Tutorials:**
* **For macOS:**
* **For Windows:**
> β οΈ **Note:** If you run into permission issues during installation, try running your terminal or command prompt as an administrator.
####
[](#id-3.-organize-your-projects)
3\. **Organize Your Projects**
Create a dedicated folder named `Cline` in your Documents folder for all your coding projects:
* **macOS:** `/Users/[your-username]/Documents/Cline`
* **Windows:** `C:\Users\[your-username]\Documents\Cline`
Inside your `Cline` folder, structure projects clearly:
* `Documents/Cline/workout-app` _(e.g., for a fitness tracking app)_
* `Documents/Cline/portfolio-website` _(e.g., to showcase your work)_
> π‘ **Tip:** Keeping your projects organized from the start will save you time and confusion later!
####
[](#id-4.-install-the-cline-vs-code-extension)
4\. **Install the Cline VS Code Extension**
Enhance your coding workflow by installing the Cline extension directly within VS Code:
* Get Started with Cline Extension Tutorial
> β
**Pro Tip:** After installing, reload VS Code to ensure the extension is activated properly.
π You're all set! Dive in and start coding smarter and faster with **Cline**.
πΊ **Recommended YouTube Tutorial:**
[Download VS Code](https://code.visualstudio.com/)
[How to Install VS Code](https://www.youtube.com/watch?v=MlIzFUI1QGA)
[Install Homebrew on Mac](https://www.youtube.com/watch?v=hwGNgVbqasc)
[Install Git on MacOS 2024](https://www.youtube.com/watch?v=B4qsvQ5IqWk)
[Install Node.js on Mac (M1 | M2 | M3)](https://www.youtube.com/watch?v=I8H4wolRFBk)
[Install Git on Windows 10/11 (2024)](https://www.youtube.com/watch?v=yjxv1HuRQy0)
[Install Node.js in Windows 10/11](https://www.youtube.com/watch?v=uCgAuOYpJd0)
[How To Install Extensions in VS Code](https://www.youtube.com/watch?v=E7trgwZa-mk)
---
# Installing Dev Essentials | Cline
###
[](#the-essential-tools)
π§° The Essential Tools
Here are the core tools you'll need for development:
* **Node.js & npm:** Required for JavaScript and web development
* **Git:** For tracking changes in your code and collaborating with others
* **Package Managers:** Tools that make it easy to install other development tools
* Homebrew for macOS
* Chocolatey for Windows
* apt/yum for Linux
> π‘ **Tip:** These tools are the foundation of your developer toolkit. Installing them properly will set you up for success!
###
[](#let-cline-install-everything)
π Let Cline Install Everything
Copy one of these prompts based on your operating system and paste it into **Cline**:
####
[](#for-macos)
For macOS
Copy
Hello Cline! I need help setting up my Mac for software development. Could you please help me install the essential development tools like Homebrew, Node.js, Git, and any other core utilities that are commonly needed for coding? I'd like you to guide me through the process step-by-step.
####
[](#for-windows)
For Windows
Copy
Hello Cline! I need help setting up my Windows PC for software development. Could you please help me install the essential development tools like Node.js, Git, and any other core utilities that are commonly needed for coding? I'd like you to guide me through the process step-by-step.
####
[](#for-linux)
For Linux
Copy
Hello Cline! I need help setting up my Linux system for software development. Could you please help me install the essential development tools like Node.js, Git, and any other core utilities that are commonly needed for coding? I'd like you to guide me through the process step-by-step.
> β
**Pro Tip:** Cline will show you each command before running it. You stay in control the entire time!
###
[](#what-will-happen)
π What Will Happen
Cline will guide you through the following steps:
1. Installing the appropriate package manager for your system
2. Using the package manager to install Node.js and Git
3. Showing you the exact command before it runs (you approve each step!)
4. Verifying each installation is successful
> β οΈ **Note:** You might need to enter your computer's password for some installations. This is normal!
###
[](#why-these-tools-are-important)
π‘ Why These Tools Are Important
* **Node.js & npm:**
* Build websites with frameworks like React or Next.js
* Run JavaScript code
* Install JavaScript packages
* **Git:**
* Save different versions of your code
* Collaborate with other developers
* Back up your work
* **Package Managers:**
* Quickly install and update development tools
* Keep your environment organized and up to date
###
[](#notes)
π§© Notes
> π‘ **Tip:** The installation process is interactive β Cline will guide you step by step!
* All commands are shown to you for approval before they run.
* If you run into any issues, Cline will help troubleshoot them.
* You may need to enter your computer's password for certain steps.
###
[](#additional-tips-for-new-coders)
π§βπ» Additional Tips for New Coders
####
[](#understanding-the-terminal)
Understanding the Terminal
The Terminal is an application where you can type commands to interact with your computer.
* **macOS:** Open it by searching for "Terminal" in Spotlight.
* **Example:**
Copy
$ open -a Terminal
####
[](#understanding-vs-code-features)
Understanding VS Code Features
* **Terminal in VS Code:** Run commands directly from within VS Code!
* Go to **View > Terminal** or press \`Ctrl + \`\`.
* Example:
Copy
$ node -v
v16.14.0
* **Document View:** Where you edit your code files.
* Open files from the Explorer panel on the left.
* **Problems Section:** View errors or warnings in your code.
* Access it by clicking the lightbulb icon or **View > Problems**.
####
[](#common-features)
Common Features
* **Command Line Interface (CLI):** A powerful tool for running commands.
* **Permissions:** You might need to grant permissions to certain commands β this keeps your system secure.
[PreviousInstalling Cline](/getting-started/installing-cline)
[NextOur Favorite Tech Stack](/getting-started/our-favorite-tech-stack)
Last updated 23 days ago
---
# Our Favorite Tech Stack | Cline
[PreviousInstalling Dev Essentials](/getting-started/installing-dev-essentials)
[NextContext Management](/getting-started/understanding-context-management)
Last updated 2 months ago
[](#recommended-stack-for-new-cline-users-2025)
Recommended Stack for New Cline Users (2025)
-------------------------------------------------------------------------------------------------
###
[](#your-complete-development-environment)
Your Complete Development Environment
####
[](#development-tools)
Development Tools
* **VS Code** - Your code editor,
* **GitHub** - Where your code lives,
####
[](#frontend)
Frontend
* **Next.js 14+** - React framework with App Router
* **Tailwind CSS** - Beautiful styling without writing CSS
* **TypeScript** - JavaScript, but safer and smarter
####
[](#backend)
Backend
* **Supabase** - Your complete backend solution,
* PostgreSQL database
* Authentication
* File storage
* Real-time updates
####
[](#deployment)
Deployment
* * Automatic deployments from GitHub
* Preview deployments for testing
* Production-ready CDN
####
[](#ai-development)
AI Development
Choose your AI assistant based on your needs:
Model
Input Cost (per 1M tokens)
Output Cost (per 1M tokens)
Best For
Claude 3.5 Sonnet
$3.00
$15.00
Production apps, complex tasks
DeepSeek R1
$1.00
$3.00
Budget-conscious production
DeepSeek V3
$0.14
$2.20
Budget-conscious development
####
[](#free-tier-benefits)
Free Tier Benefits
**Vercel (Hobby)**
* 100 GB data transfer/month
* 100k serverless function invocations
* 100 MB deployment size
* Automatic HTTPS & CI/CD
**Supabase (Free)**
* 500 MB database storage
* 1 GB file storage
* 50k monthly active users
* 2M real-time messages/month
**GitHub (Free)**
* Unlimited public repositories
* GitHub Actions CI/CD
* Project management tools
* Collaboration features
###
[](#getting-started)
Getting Started
1. Install the development essentials:
2. Set up Cline's Memory Bank:
* Create an empty `cline_docs` folder in your project root
* Create `projectBrief.md` in the `cline_docs` folder (see example below)
* Tell Cline to "initialize memory bank"
3. Add our recommended stack configuration:
* Create `.clinerules` file (see template below)
* Let Cline handle the rest!
####
[](#example-project-brief)
Example Project Brief
Copy
# Project Brief
## Overview
Building a [type of application] that will [main purpose].
## Core Features
- Feature 1
- Feature 2
- Feature 3
## Target Users
[Describe who will use your application]
## Technical Preferences (optional)
- Any specific technologies you want to use
- Any specific requirements or constraints
###
[](#clinerules-template)
.clinerules Template
Copy
# Project Configuration
## Tech Stack
- Next.js 14+ with App Router
- Tailwind CSS for styling
- Supabase for backend
- Vercel for deployment
- GitHub for version control
## Project Structure
/src
/app # Next.js App Router pages
/components # React components
/lib # Utility functions
/types # TypeScript types
/supabase
/migrations # SQL migration files
/seed # Seed data files
/public # Static assets
## Database Migrations
SQL files in /supabase/migrations should:
- Use sequential numbering: 001, 002, etc.
- Include descriptive names
- Be reviewed by Cline before execution
Example: 001_create_users_table.sql
## Development Workflow
- Cline helps write and review code changes
- Vercel automatically deploys from main branch
- Database migrations reviewed by Cline before execution
## Security
DO NOT read or modify:
- .env files
- **/config/secrets.*
- Any file containing API keys or credentials
###
[](#learning-resources-2025)
Learning Resources (2025)
Want to learn more about the technologies we're using? Here are some great resources:
####
[](#next.js-and-react)
Next.js and React
####
[](#supabase)
Supabase
####
[](#tailwind-css)
Tailwind CSS
###
[](#other-things-to-know)
Other Things to Know
####
[](#working-with-git-and-github)
Working with Git & GitHub
Git helps you track changes in your code and collaborate with others. Here are the essential commands you'll use:
**Daily Development**
Copy
# Save your changes (do this often!)
git add . # Stage all changed files
git commit -m "Add login page" # Save changes with a clear message
# Share your changes
git push origin main # Upload to GitHub
**Common Workflow**
1. **Start of day**: Get latest changes
Copy
bashCopygit pull origin main # Download latest code
2. **During development**: Save work regularly
Copy
bashCopygit add .
git commit -m "Clear message about changes"
3. **End of day**: Share your progress
Copy
bashCopygit push origin main # Upload to GitHub
**Best Practices**
* Commit often with clear messages
* Pull before starting new work
* Push completed work to share with others
* Use `.gitignore` to avoid committing sensitive files
> **Tip**: Vercel automatically deploys when you push to main!
####
[](#environment-variables)
Environment Variables
* Store secrets in `.env.local` for development
* Add them to Vercel project settings for production
* Never commit `.env` files to Git
####
[](#getting-help)
Getting Help
1. Use `/help` in Cline chat for immediate assistance
4. Search GitHub issues for common problems
Remember: Cline is here to help at every step. Just ask for guidance or clarification when needed!
**Vercel** - Where your app runs,
Follow our
Follow the
\- Interactive tutorial
\- Quick overview
\- Practical examples
\- Comprehensive course
Interactive course at
Check
Join our
[download here](https://code.visualstudio.com/)
[sign up here](https://github.com)
[sign up with GitHub](https://supabase.com)
[sign up with GitHub](https://vercel.com)
[Development Essentials Installation Guide](https://docs.cline.bot/getting-started/getting-started-new-coders/installing-dev-essentials)
[Memory Bank setup instructions](https://docs.cline.bot/improving-your-prompting-skills/custom-instructions-library/cline-memory-bank)
[Official Learn Next.js Course](https://nextjs.org/learn)
[NextJS App Router: Modern Web Dev in 1 Hour](https://www.youtube.com/nextjs-modern)
[Building Real-World Apps with Next.js](https://www.youtube.com/nextjs-real-world)
[Supabase From Scratch](https://www.udemy.com/supabase-scratch)
[Official Quickstart Guides](https://supabase.com/docs/guides/getting-started)
[Real-Time Apps with Next.js and Supabase](https://www.newline.co/courses/supabase-nextjs)
[Tailwind CSS Tutorial for Beginners](https://www.youtube.com/tailwind-2025)
[Official Tailwind Documentation](https://tailwindcss.com/docs)
[Scrimba Tailwind CSS Course](https://scrimba.com/learn/tailwind)
[Cline Documentation](https://docs.cline.bot)
[Discord Community](https://discord.gg/cline)
---
# Context Management | Cline
[PreviousOur Favorite Tech Stack](/getting-started/our-favorite-tech-stack)
[NextModel Selection Guide](/getting-started/model-selection-guide)
Last updated 27 days ago
> π‘ **Quick Reference**
>
> * Context = The information Cline knows about your project
>
> * Context Window = How much information Cline can hold at once
>
> * Use context files to maintain project knowledge
>
> * Reset when the context window gets full
>
[](#understanding-context-and-context-windows)
Understanding Context & Context Windows
-------------------------------------------------------------------------------------------
Think of working with Cline like collaborating with a thorough, proactive teammate:
###
[](#how-context-is-built)
How Context is Built
Cline actively builds context in two ways:
1. **Automatic Context Gathering (i.e. Cline-driven)**
* Proactively reads related files
* Explores project structure
* Analyzes patterns and relationships
* Maps dependencies and imports
* Asks clarifying questions
2. **User-Guided Context**
* Share specific files
* Provide documentation
* Answer Cline's questions
* Guide focus areas
* Share design thoughts and requirements
π‘ **Key Point**: Cline isn't passive - it actively seeks to understand your project. You can either let it explore or guide its focus, especially in [Plan](https://docs.cline.bot/exploring-clines-tools/plan-and-act-modes-a-guide-to-effective-ai-development)
mode.
###
[](#context-and-context-windows)
Context & Context Windows
Think of context like a whiteboard you and Cline share:
* **Context** is all the information available:
* What Cline has discovered
* What you've shared
* Your conversation history
* Project requirements
* Previous decisions
* **Context Window** is the size of the whiteboard itself:
* Measured in tokens (1 token β 3/4 of an English word)
* Each model has a fixed size:
* Claude 3.5 Sonnet: 200,000 tokens
* DeepSeek: 64,000 tokens
* When the whiteboard is full, you need to erase (clear context) to write more
* [How Cline manages context under the hood](https://cline.bot/blog/understanding-the-new-context-window-progress-bar-in-cline)
β οΈ **Important**: Having a large context window (like Claude's 200k tokens) doesn't mean you should fill it completely. Just like a cluttered whiteboard, too much information can make it harder to focus on what's important.
[](#understanding-the-context-window-progress-bar)
Understanding the Context Window Progress Bar
-----------------------------------------------------------------------------------------------------
Cline provides a visual way to monitor your context window usage through a progress bar:
###
[](#reading-the-bar)
Reading the Bar
* β shows input tokens (what you've sent to the LLM)
* β shows output tokens (what the LLM has generated)
* The progress bar visualizes how much of your context window you've used
* The total shows your model's maximum capacity (e.g., 200k for Claude 3.5-Sonnet)
###
[](#when-to-watch-the-bar)
When to Watch the Bar
* During long coding sessions
* When working with multiple files
* Before starting complex tasks
* When Cline seems to lose context
π‘ **Tip**: Consider starting a fresh session when usage reaches 70-80% to maintain optimal performance.
[](#working-with-context-files)
Working with Context Files
---------------------------------------------------------------
Context files help maintain understanding across sessions. They serve as documentation specifically designed to help AI assistants understand your project.
####
[](#approaches-to-context-files)
Approaches to Context Files
1. **Evergreen Project Context (i.e.** [**Memory Bank**](https://docs.cline.bot/improving-your-prompting-skills/custom-instructions-library/cline-memory-bank)
**)**
* Living documentation that evolves with your project
* Updated as architecture and patterns emerge
* Example: The Memory Bank pattern maintains files like `techContext.md` and `systemPatterns.md`
* Useful for long-running projects and teams
2. **Task-Specific Context (i.e.** [**Structured Approach**](https://cline.bot/blog/building-advanced-software-with-cline-a-structured-approach)
**)**
* Created for specific implementation tasks
* Document requirements, constraints, and decisions
* Example:
Copy
# auth-system-implementation.md
## Requirements
- OAuth2 implementation
- Support for Google and GitHub
- Rate limiting on auth endpoints
## Technical Decisions
- Using Passport.js for provider integration
- JWT for session management
- Redis for rate limiting
3. **Knowledge Transfer Docs**
* Switch to plan mode and ask Cline to document everything you've accomplished so far, along with the remaining steps, in a markdown file.
* Copy the contents of the markdown file.
* Start a new task using that content as context.
####
[](#using-context-files-effectively)
Using Context Files Effectively
1. **Structure and Format**
* Use clear, consistent organization
* Include relevant examples
* Link related concepts
* Keep information focused
2. **Maintenance**
* Update after significant changes
* Version control your context files
* Remove outdated information
* Document key decisions
[](#practical-tips)
Practical Tips
---------------------------------------
1. **Starting New Projects**
* Let Cline explore the codebase
* Answer its questions about structure and patterns
* Consider setting up basic context files
* Document key design decisions
2. **Ongoing Development**
* Update context files with significant changes
* Share relevant documentation
* Use Plan mode for complex discussions
* Start fresh sessions when needed
3. **Team Projects**
* Share common context files (consider using [.clinerules](https://docs.cline.bot/improving-your-prompting-skills/prompting)
files in project roots)
* Document architectural decisions
* Maintain consistent patterns
* Keep documentation current
Remember: The goal is to help Cline maintain consistent understanding of your project across sessions.
In a world of infinite context, the context window is what Cline currently has available


---
# Cline Tools Guide | Cline
[](#what-can-cline-do)
What Can Cline Do?
----------------------------------------------
Cline is your AI assistant that can:
* Edit and create files in your project
* Run terminal commands
* Search and analyze your code
* Help debug and fix issues
* Automate repetitive tasks
* Integrate with external tools
[](#first-steps)
First Steps
---------------------------------
1. **Start a Task**
* Type your request in the chat
* Example: "Create a new React component called Header"
2. **Provide Context**
* Use @ mentions to add files, folders, or URLs
* Example: "@file:src/components/App.tsx"
3. **Review Changes**
* Cline will show diffs before making changes
* You can edit or reject changes
[](#key-features)
Key Features
-----------------------------------
1. **File Editing**
* Create new files
* Modify existing code
* Search and replace across files
2. **Terminal Commands**
* Run npm commands
* Start development servers
* Install dependencies
3. **Code Analysis**
* Find and fix errors
* Refactor code
* Add documentation
4. **Browser Integration**
* Test web pages
* Capture screenshots
* Inspect console logs
[](#available-tools)
Available Tools
-----------------------------------------
Cline has access to the following tools for various tasks:
1. **File Operations**
* `write_to_file`: Create or overwrite files
* `read_file`: Read file contents
* `replace_in_file`: Make targeted edits to files
* `search_files`: Search files using regex
* `list_files`: List directory contents
2. **Terminal Operations**
* `execute_command`: Run CLI commands
* `list_code_definition_names`: List code definitions
3. **MCP Tools**
* `use_mcp_tool`: Use tools from MCP servers
* `access_mcp_resource`: Access MCP server resources
* Users can create custom MCP tools that Cline can then access
* Example: Create a weather API tool that Cline can use to fetch forecasts
4. **Interaction Tools**
* `ask_followup_question`: Ask user for clarification
* `attempt_completion`: Present final results
Each tool has specific parameters and usage patterns. Here are some examples:
* Create a new file (write\_to\_file):
Copy
src/components/Header.tsx
// Header component code
* Search for a pattern (search\_files):
Copy
src
function\s+\w+\(
*.ts
* Run a command (execute\_command):
Copy
npm install axios
false
[](#common-tasks)
Common Tasks
-----------------------------------
1. **Create a New Component**
* "Create a new React component called Footer"
2. **Fix a Bug**
* "Fix the error in src/utils/format.ts"
3. **Refactor Code**
* "Refactor the Button component to use TypeScript"
4. **Run Commands**
* "Run npm install to add axios"
[](#getting-help)
Getting Help
-----------------------------------
* Check the documentation
* Provide feedback to improve Cline
[PreviousCline Memory Bank](/improving-your-prompting-skills/cline-memory-bank)
[NextCheckpoints and Messages](/exploring-clines-tools/checkpoints)
Last updated 3 months ago
For the most up-to-date implementation details, you can view the full source code in the .
[Cline repository](https://github.com/cline/cline/blob/main/src/core/Cline.ts)
[Join the Discord community](https://discord.gg/cline)
---
# Model Selection Guide | Cline
[](#understanding-context-windows)
Understanding Context Windows
---------------------------------------------------------------------
Think of a context window as your AI assistant's working memory - similar to RAM in a computer. It determines how much information the model can "remember" and process at once during your conversation. This includes:
* Your code files and conversations
* The assistant's responses
* Any documentation or additional context provided
Context windows are measured in tokens (roughly 3/4 of a word in English). Different models have different context window sizes:
* Claude 3.5 Sonnet: 200K tokens
* DeepSeek Models: 128K tokens
* Gemini Flash 2.0: 1M tokens
* Gemini 1.5 Pro: 2M tokens
When you reach the limit of your context window, older information needs to be removed to make room for new information - just like clearing RAM to run new programs. This is why sometimes AI assistants might seem to "forget" earlier parts of your conversation.
Cline helps you manage this limitation with its Context Window Progress Bar, which shows:
* Input tokens (what you've sent to the model)
* Output tokens (what the model has generated)
* A visual representation of how much of your context window you've used
* The total capacity for your chosen model
This visibility helps you work more effectively with Cline by letting you know when you might need to start fresh or break tasks into smaller chunks.
###
[](#model-comparison)
Model Comparison
[](#llm-model-comparison-for-cline-feb-2025)
LLM Model Comparison for Cline (Feb 2025)
-------------------------------------------------------------------------------------------
Model
Input Cost\*
Output Cost\*
Context Window
Best For
Claude 3.5 Sonnet
$3.00
$15.00
200K
Best code implementation & tool use
DeepSeek R1
$0.55
$2.19
128K
Planning & reasoning champion
DeepSeek V3
$0.14
$0.28
128K
Value code implementation
o3-mini
$1.10
$4.40
200K
Flexible use, strong planning
Gemini Flash 2.0
$0.00
$0.00
1M
Strong all-rounder
Gemini 1.5 Pro
$0.00
$0.00
2M
Large context processing
\*Costs per million tokens
###
[](#top-picks-for-2025)
Top Picks for 2025
1. **Claude 3.5 Sonnet**
* Best overall code implementation
* Most reliable tool usage
* Expensive but worth it for critical code
2. **DeepSeek R1**
* Exceptional planning & reasoning
* Great value pricing
3. **o3-mini**
* Strong for planning with adjustable reasoning
* Three reasoning modes for different needs
* Requires OpenAI Tier 3 API access
* 200K context window
4. **DeepSeek V3**
* Reliable code implementation
* Great for daily coding
* Cost-effective for implementation
5. **Gemini Flash 2.0**
* Massive 1M context window
* Improved speed and performance
* Good all-around capabilities
###
[](#best-models-by-mode-plan-or-act)
Best Models by Mode (Plan or Act)
####
[](#planning)
Planning
1. **DeepSeek R1**
* Best reasoning capabilities in class
* Excellent at breaking down complex tasks
* Strong math/algorithm planning
* MoE architecture helps with reasoning
2. **o3-mini (high reasoning)**
* Three reasoning levels:
* High: Complex planning
* Medium: Daily tasks
* Low: Quick ideas
* 200K context helps with large projects
3. **Gemini Flash 2.0**
* Massive context window for complex planning
* Strong reasoning capabilities
* Good with multi-step tasks
####
[](#acting-coding)
Acting (coding)
1. **Claude 3.5 Sonnet**
* Best code quality
* Most reliable with Cline tools
* Worth the premium for critical code
2. **DeepSeek V3**
* Nearly Sonnet-level code quality
* Better API stability than R1
* Great for daily coding
* Strong tool usage
3. **Gemini 1.5 Pro**
* 2M context window
* Good with complex codebases
* Reliable API
* Strong multi-file understanding
###
[](#a-note-on-local-models)
A Note on Local Models
###
[](#key-takeaways)
Key Takeaways
1. **Plan vs Act Matters**: Choose models based on task type
2. **Real Performance > Benchmarks**: Focus on actual Cline performance
3. **Mix & Match**: Use different models for planning and implementation
4. **Cost vs Quality**: Premium models worth it for critical code
5. **Keep Backups**: Have alternatives ready for API issues
_\*Note: Based on real usage patterns and community feedback rather than just benchmarks. Your experience may vary. This is not an exhaustive list of all the models available for use within Cline._
[PreviousContext Management](/getting-started/understanding-context-management)
[NextPrompt Engineering Guide](/improving-your-prompting-skills/prompting)
Last updated 2 months ago
While running models locally might seem appealing for cost savings, we currently don't recommend any local models for use with Cline. at using Cline's essential tools and typically retain only 1-26% of the original model's capabilities. The full cloud version of DeepSeek-R1, for example, is 671B parameters - local versions are drastically simplified copies that struggle with complex tasks and tool usage. Even with high-end hardware (RTX 3070+, 32GB+ RAM), you'll experience slower responses, less reliable tool execution, and reduced capabilities. For the best development experience, we recommend sticking with the cloud models listed above.
[Local models are significantly less reliable](https://docs.cline.bot/running-models-locally/read-me-first)

---
# Cloud Provider Integration | Cline
[PreviousSecurity Concerns](/enterprise-solutions/security-concerns)
[NextMCP Servers](/enterprise-solutions/mcp-servers)
Last updated 1 month ago
Cline supports major cloud providers like AWS Bedrock and Google's Cloud Vertex; whichever your team currently uses is appropriate, and there's no need to change providers to utilize Cline's features. For the purpose of this document, we assume your organization will use cloud-based frontier models. Cloud inference providers offer cutting-edge capabilities and the flexibility to select models which best suit your needs.
Certain scenarios may warrant using local models, including handling highly sensitive data, applications requiring consistent low-latency responses, or compliance with strict data sovereignty requirements. If your team needs to utilize local models, see with Cline.
* * *
[](#aws-bedrock-setup-guides)
AWS Bedrock Setup Guides
-----------------------------------------------------------
####
[](#iam-security-best-practices-for-administrators)
(For administrators)
####
[](#aws-bedrock-setup-for-legacy-iam-aws-credentials)
####
[](#aws-bedrock-setup-for-sso-token-aws-profile)
####
[](#vpc-endpoint-setup)
VPC Endpoint Setup
To protect your team's data, Cline supports VPC (Virtual Private Cloud) endpoints, which create private connections between your data and AWS Bedrock. AWS VPCs enhance security by eliminating the need for public IP addresses, network gateways, or complex firewall rulesβessentially creating a private highway for data that bypasses the public internet entirely. By keeping traffic within AWSβs private network, teams also benefit from lower latency and more predictable performance when accessing services like AWS Bedrock or custom APIs. For those working with confidential information or operating in highly regulated industries like healthcare or finance, VPCs offers the perfect balance between the accessibility of cloud services and the security of private infrastructure.
* * *
1. Consult the to creating VPC endpoints. This document specifies pre-requisites and describes the syntax used for creating VPC endpoints.
2. Follow the directions for in the AWS console. The image below pertains to steps 4 and 5 of the AWS guide linked above.
3. Note the IP address of your VPC endpoint, open Cline's settings menu, and select `AWS Bedrock`from the API Provider dropdown.
4. Click the `Use Custom VPC endpoint`checkbox and enter the IP address of your VPC endpoint
[Running Local Models](/running-models-locally/read-me-first)
[IAM Security Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)
[AWS Bedrock setup for Legacy IAM (AWS Credentials)](/custom-model-configs/aws-bedrock)
[AWS Bedrock setup for SSO token (AWS Profile)](/custom-model-configs/aws-bedrock-w-profile-authentication)
[AWS guide](https://docs.aws.amazon.com/bedrock/latest/userguide/vpc-interface-endpoints.html)
[creating a VPC endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html#create-interface-endpoint-aws)


---
# Cline Memory Bank | Cline
[PreviousPrompt Engineering Guide](/improving-your-prompting-skills/prompting)
[NextCline Tools Guide](/exploring-clines-tools/cline-tools-guide)
Last updated 1 month ago
[](#the-complete-guide-to-cline-memory-bank)
The Complete Guide to Cline Memory Bank
-----------------------------------------------------------------------------------------
###
[](#quick-setup-guide)
Quick Setup Guide
To get started with Cline Memory Bank:
1. **Install or Open Cline**
2. **Copy the Custom Instructions** - Use the code block below
3. **Paste into Cline** - Add as custom instructions or in a .clinerules file
4. **Initialize** - Ask Cline to "initialize memory bank"
###
[](#cline-memory-bank-custom-instructions-copy-this)
Cline Memory Bank Custom Instructions \[COPY THIS\]
Copy
# Cline's Memory Bank
I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
## Memory Bank Structure
The Memory Bank consists of core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
flowchart TD
PB[projectbrief.md] --> PC[productContext.md]
PB --> SP[systemPatterns.md]
PB --> TC[techContext.md]
PC --> AC[activeContext.md]
SP --> AC
TC --> AC
AC --> P[progress.md]
### Core Files (Required)
1. `projectbrief.md`
- Foundation document that shapes all other files
- Created at project start if it doesn't exist
- Defines core requirements and goals
- Source of truth for project scope
2. `productContext.md`
- Why this project exists
- Problems it solves
- How it should work
- User experience goals
3. `activeContext.md`
- Current work focus
- Recent changes
- Next steps
- Active decisions and considerations
- Important patterns and preferences
- Learnings and project insights
4. `systemPatterns.md`
- System architecture
- Key technical decisions
- Design patterns in use
- Component relationships
- Critical implementation paths
5. `techContext.md`
- Technologies used
- Development setup
- Technical constraints
- Dependencies
- Tool usage patterns
6. `progress.md`
- What works
- What's left to build
- Current status
- Known issues
- Evolution of project decisions
### Additional Context
Create additional files/folders within memory-bank/ when they help organize:
- Complex feature documentation
- Integration specifications
- API documentation
- Testing strategies
- Deployment procedures
## Core Workflows
### Plan Mode
flowchart TD
Start[Start] --> ReadFiles[Read Memory Bank]
ReadFiles --> CheckFiles{Files Complete?}
CheckFiles -->|No| Plan[Create Plan]
Plan --> Document[Document in Chat]
CheckFiles -->|Yes| Verify[Verify Context]
Verify --> Strategy[Develop Strategy]
Strategy --> Present[Present Approach]
### Act Mode
flowchart TD
Start[Start] --> Context[Check Memory Bank]
Context --> Update[Update Documentation]
Update --> Execute[Execute Task]
Execute --> Document[Document Changes]
## Documentation Updates
Memory Bank updates occur when:
1. Discovering new project patterns
2. After implementing significant changes
3. When user requests with **update memory bank** (MUST review ALL files)
4. When context needs clarification
flowchart TD
Start[Update Process]
subgraph Process
P1[Review ALL Files]
P2[Document Current State]
P3[Clarify Next Steps]
P4[Document Insights & Patterns]
P1 --> P2 --> P3 --> P4
end
Start --> Process
Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.
###
[](#what-is-the-cline-memory-bank)
What is the Cline Memory Bank?
The Memory Bank is a structured documentation system that allows Cline to maintain context across sessions. It transforms Cline from a stateless assistant into a persistent development partner that can effectively "remember" your project details over time.
####
[](#key-benefits)
Key Benefits
* **Context Preservation**: Maintain project knowledge across sessions
* **Consistent Development**: Experience predictable interactions with Cline
* **Self-Documenting Projects**: Create valuable project documentation as a side effect
* **Scalable to Any Project**: Works with projects of any size or complexity
* **Technology Agnostic**: Functions with any tech stack or language
###
[](#how-memory-bank-works)
How Memory Bank Works
The Memory Bank isn't a Cline-specific feature - it's a methodology for managing AI context through structured documentation. When you instruct Cline to "follow custom instructions," it reads the Memory Bank files to rebuild its understanding of your project.
####
[](#understanding-the-files)
Understanding the Files
Memory Bank files are simply markdown files you create in your project. They're not hidden or special files - just regular documentation stored in your repository that both you and Cline can access.
Files are organized in a hierarchical structure that builds up a complete picture of your project:
###
[](#memory-bank-files-explained)
Memory Bank Files Explained
####
[](#core-files)
Core Files
1. **projectbrief.md**
* The foundation of your project
* High-level overview of what you're building
* Core requirements and goals
* Example: "Building a React web app for inventory management with barcode scanning"
2. **productContext.md**
* Explains why the project exists
* Describes the problems being solved
* Outlines how the product should work
* Example: "The inventory system needs to support multiple warehouses and real-time updates"
3. **activeContext.md**
* The most frequently updated file
* Contains current work focus and recent changes
* Tracks active decisions and considerations
* Stores important patterns and learnings
* Example: "Currently implementing the barcode scanner component; last session completed the API integration"
4. **systemPatterns.md**
* Documents the system architecture
* Records key technical decisions
* Lists design patterns in use
* Explains component relationships
* Example: "Using Redux for state management with a normalized store structure"
5. **techContext.md**
* Lists technologies and frameworks used
* Describes development setup
* Notes technical constraints
* Records dependencies and tool configurations
* Example: "React 18, TypeScript, Firebase, Jest for testing"
6. **progress.md**
* Tracks what works and what's left to build
* Records current status of features
* Lists known issues and limitations
* Documents the evolution of project decisions
* Example: "User authentication complete; inventory management 80% complete; reporting not started"
####
[](#additional-context)
Additional Context
Create additional files when needed to organize:
* Complex feature documentation
* Integration specifications
* API documentation
* Testing strategies
* Deployment procedures
###
[](#getting-started-with-memory-bank)
Getting Started with Memory Bank
####
[](#first-time-setup)
First-Time Setup
1. Create a `memory-bank/` folder in your project root
2. Have a basic project brief ready (can be technical or non-technical)
3. Ask Cline to "initialize memory bank"
####
[](#project-brief-tips)
Project Brief Tips
* Start simple - it can be as detailed or high-level as you like
* Focus on what matters most to you
* Cline will help fill in gaps and ask questions
* You can update it as your project evolves
###
[](#working-with-cline)
Working with Cline
####
[](#core-workflows)
Core Workflows
**Plan Mode**
Start in this mode for strategy discussions and high-level planning.
**Act Mode**
Use this for implementation and executing specific tasks.
####
[](#key-commands)
Key Commands
* **"follow your custom instructions"** - This tells Cline to read the Memory Bank files and continue where you left off (use this at the start of tasks)
* **"initialize memory bank"** - Use when starting a new project
* **"update memory bank"** - Triggers a full documentation review and update during a task
* Toggle Plan/Act modes based on your current needs
####
[](#documentation-updates)
Documentation Updates
Memory Bank updates should automatically occur when:
1. You discover new patterns in your project
2. After implementing significant changes
3. When you explicitly request with **"update memory bank"**
4. When you feel context needs clarification
###
[](#frequently-asked-questions)
Frequently Asked Questions
####
[](#where-are-the-memory-bank-files-stored)
Where are the memory bank files stored?
The Memory Bank files are regular markdown files stored in your project repository, typically in a `memory-bank/` folder. They're not hidden system files - they're designed to be part of your project documentation.
####
[](#should-i-use-custom-instructions-or-.clinerules)
Should I use custom instructions or .clinerules?
Either approach works - it's based on your preference:
* **Custom Instructions**: Applied globally to all Cline conversations. Good for consistent behavior across all projects.
* **.clinerules file**: Project-specific and stored in your repository. Good for per-project customization.
Both methods achieve the same goal - the choice depends on whether you want global or local application of the Memory Bank system.
####
[](#managing-context-windows)
Managing Context Windows
As you work with Cline, your context window will eventually fill up (note the progress bar). When you notice Cline's responses slowing down or references to earlier parts of the conversation becoming less accurate, it's time to:
1. Ask Cline to **"update memory bank"** to document the current state
2. Start a new conversation/task
3. Ask Cline to **"follow your custom instructions"** in the new conversation
This workflow ensures that important context is preserved in your Memory Bank files before the context window is cleared, allowing you to continue seamlessly in a fresh conversation.
####
[](#how-often-should-i-update-the-memory-bank)
How often should I update the memory bank?
Update the Memory Bank after significant milestones or changes in direction. For active development, updates every few sessions can be helpful. Use the **"update memory bank"** command when you want to ensure all context is preserved. However, you will notice Cline automatically updating the Memory Bank as well.
####
[](#does-this-work-with-other-ai-tools-beyond-cline)
Does this work with other AI tools beyond Cline?
Yes! The Memory Bank concept is a documentation methodology that can work with any AI assistant that can read documentation files. The specific commands might differ, but the structured approach to maintaining context works across tools.
####
[](#how-does-the-memory-bank-relate-to-context-window-limitations)
How does the memory bank relate to context window limitations?
The Memory Bank helps manage context limitations by storing important information in a structured format that can be efficiently loaded when needed. This prevents context bloat while ensuring critical information is available.
####
[](#can-the-memory-bank-concept-be-used-for-non-coding-projects)
Can the memory bank concept be used for non-coding projects?
Absolutely! The Memory Bank approach works for any project that benefits from structured documentation - from writing books to planning events. The file structure might vary, but the concept remains powerful.
####
[](#is-this-different-from-using-readme-files)
Is this different from using README files?
While similar in concept, the Memory Bank provides a more structured and comprehensive approach specifically designed to maintain context across AI sessions. It goes beyond what a single README typically covers.
###
[](#best-practices)
Best Practices
####
[](#getting-started)
Getting Started
* Start with a basic project brief and let the structure evolve
* Let Cline help create the initial structure
* Review and adjust files as needed to match your workflow
####
[](#ongoing-work)
Ongoing Work
* Let patterns emerge naturally as you work
* Don't force documentation updates - they should happen organically
* Trust the process - the value compounds over time
* Watch for context confirmation at the start of sessions
####
[](#documentation-flow)
Documentation Flow
* **projectbrief.md** is your foundation
* **activeContext.md** changes most frequently
* **progress.md** tracks your milestones
* All files collectively maintain project intelligence
###
[](#detailed-setup-instructions)
Detailed Setup Instructions
####
[](#for-custom-instructions-global)
For Custom Instructions (Global)
1. Open VSCode
2. Click the Cline extension settings βοΈ
3. Find "Custom Instructions"
4. Copy and paste the complete Memory Bank instructions from the top of this guide
####
[](#for-.clinerules-project-specific)
For .clinerules (Project-Specific)
1. Create a `.clinerules` file in your project root
2. Copy and paste the Memory Bank instructions from the top of this guide
3. Save the file
4. Cline will automatically apply these rules when working in this project
###
[](#remember)
Remember
The Memory Bank is Cline's only link to previous work. Its effectiveness depends entirely on maintaining clear, accurate documentation and confirming context preservation in every interaction.
* * *
###
[](#contributing-to-cline-memory-bank)
Contributing to Cline Memory Bank
This guide is maintained by the Cline and the Cline Discord Community:
* nickbaumann98
* Krylo
* snipermunyshotz
* * *
_The Memory Bank methodology is an open approach to AI context management and can be adapted to different tools and workflows._
_For more information, reference our_ _on Cline Memory Bank_
[_blog_](https://cline.bot/blog/memory-bank-how-to-make-cline-an-ai-agent-that-never-forgets)
[See detailed setup instructions](/improving-your-prompting-skills/cline-memory-bank#getting-started-with-memory-bank)
![flowchart LR A[Session Starts] --> B[Read Memory Bank Files] B --> C[Rebuild Context] C --> D[Continue Work] D --> E[Update Documentation] E --> F[Session Ends] F -.-> A](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252FJnxDKnHwFc180rVhBIu9%252Fimage.png%3Falt%3Dmedia%26token%3D3fa2f84e-e158-48b1-9548-20be5e191c41&width=768&dpr=4&quality=100&sign=fbd52a9b&sv=2)
![flowchart TD PB[projectbrief.md] --> PC[productContext.md] PB --> SP[systemPatterns.md] PB --> TC[techContext.md] PC --> AC[activeContext.md] SP --> AC TC --> AC AC --> P[progress.md]](https://docs.cline.bot/~gitbook/image?url=https%3A%2F%2F3321249260-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Ff8Oh1Lcy6yWYq1caYESV%252Fuploads%252Flh2tPJtrViHchynBAsU8%252Fimage.png%3Falt%3Dmedia%26token%3D59ca7fe6-d38a-4017-9aec-616851468f28&width=768&dpr=4&quality=100&sign=8479ab96&sv=2)


---
# MCP Servers | Cline
[PreviousCloud Provider Integration](/enterprise-solutions/cloud-provider-integration)
[NextCustom Instructions](/enterprise-solutions/custom-instructions)
Last updated 1 month ago
**Model Context Protocol (MCP) servers expand Cline's capabilities by providing standardized access to external data sources and executable functions. By implementing MCP servers, LLM tools can dynamically retrieve and incorporate relevant information from both local and remote data sources. This capability ensures that the models operate with the most current and contextually appropriate data, improving the accuracy and relevance of their outputs.**
* * *
###
[](#secure-architecture-fundamentals)
Secure Architecture Fundamentals
MCP servers follow a client-server architecture where hosts (LLM applications like Cline) initiate connections through a transport layer to MCP servers. This architecture inherently provides security benefits as it maintains clear separation between components. Enterprise deployments should focus on the proper implementation of this architecture to ensure secure operations, particularly regarding the message exchange patterns and connection lifecycle management. For MCP architecture details, see , and for latest specifications, see .
###
[](#transport-layer-security)
Transport Layer Security
For enterprise environments, selecting the appropriate transport mechanism is crucial. While stdio transport works efficiently for local processes, HTTP with Server-Sent Events (SSE) transport requires additional security measures. TLS should be used for all remote connections whenever possible. This is especially important when MCP servers are deployed across different network segments within corporate infrastructure.
###
[](#message-validation-and-access-control)
Message Validation and Access Control
The MCP architecture defines standard error codes and message types (Requests, Results, Errors, and Notifications), providing a structured framework for secure communication. Security teams should consider message validation, sanitizing inputs, checking message size limits, and verifying JSON-RPC format. Additionally, implementing resource protection through access controls, path validation, and request rate limiting helps prevent potential abuse of MCP server capabilities.
###
[](#monitoring-and-compliance)
Monitoring and Compliance
For enterprise compliance requirements, implementing comprehensive logging of protocol events, message flows, and errors is essential. The MCP architecture supports diagnostic capabilities including health checks, connection state monitoring, and resource usage tracking. Organizations should extend these capabilities to meet their specific compliance needs, particularly for audit trails of all MCP server interactions and resource access patterns.
By leveraging the client-server design of the MCP architecture and implementing appropriate security controls at each layer, enterprises can safely integrate MCP servers into their environments while maintaining their security posture and meeting regulatory requirements.
[MCP Architecture](https://modelcontextprotocol.io/docs/concepts/architecture)
[MCP Specifications](https://spec.modelcontextprotocol.io/specification/2024-11-05/)
---
# Checkpoints and Messages | Cline
[PreviousCline Tools Guide](/exploring-clines-tools/cline-tools-guide)
[NextPlan & Act Modes: A Guide to Effective AI Development](/exploring-clines-tools/plan-and-act-modes-a-guide-to-effective-ai-development)
Last updated 11 days ago
Checkpoints automatically save snapshots of your workspace after each step in a task. This powerful feature lets you:
* Track and review changes made during a task
* Roll back to any previous point if needed
* Experiment confidently with auto-approve mode
* Maintain full control over your workspace
###
[](#how-checkpoints-work)
βοΈ How Checkpoints Work
Cline creates a checkpoint after each tool use (file edits, commands, etc.). These checkpoints:
* Work alongside your Git workflow without interference
* Maintain context between restores
* Use a shadow Git repository to track changes
For example, if you're working on a feature and Cline makes multiple file changes, each change creates a checkpoint. This means you can review each modification and, if needed, roll back to any point without affecting your main Git repository.
####
[](#viewing-changes-and-restoring-to-checkpoint)
Viewing Changes & Restoring to Checkpoint
After each tool use, you can:
1. Click the "Compare" button to see modified files
2. Click the "Restore" button to open restore options
####
[](#rolling-back)
Rolling Back
To restore to a previous point:
1. Click the "Restore" button next to any step
2. Choose from three options:
* **Restore Task and Workspace**: Reset both codebase and task to that point
* **Restore Task Only**: Keep codebase changes but revert task context
* **Restore Workspace Only**: Reset codebase while preserving task context
Example: If Cline makes changes you don't like while styling a component, you can use "Restore Workspace Only" to revert the code changes while keeping the conversation context, allowing you to try a different approach.
###
[](#use-cases)
π‘ Use Cases
Checkpoints let you be more experimental with Cline. While human coding is often methodical and iterative, AI can make substantial changes quickly. Checkpoints help you track these changes and revert if needed.
####
[](#id-1.-using-auto-approve-mode)
1\. Using Auto-Approve Mode
* Provides safety net for rapid iterations
* Makes it easy to undo unexpected results
####
[](#id-2.-testing-different-approaches)
2\. Testing Different Approaches
* Try multiple solutions confidently
* Compare different implementations
* Quickly revert to working states
* Ideal for exploring different design patterns or architectural approaches
###
[](#best-practices)
β¨ Best Practices
1. Use checkpoints as safety nets when experimenting
2. Leverage auto-approve mode more confidently, knowing you can always roll back
3. Restore selectively based on needs:
* Use "Restore Task and Workspace" for a fresh start, reversing changes to files and the task conversation.
* Use "Restore Task Only" to try different prompts, but leave all files as they exist
* Use "Restore Workspace Only" to attempt different implementations, or prune context from the task
π Checkpoints are your safety net when working with Cline, enabling you to experiment freely while maintaining full control over your codebase. Whether you're refactoring a complex component, trying different implementation approaches, or using auto-approve mode for rapid development, checkpoints ensure you can always review changes and roll back if needed.
####
[](#deleting-checkpoints)
ποΈ Deleting Checkpoints
You can delete all checkpoints by using the **"Delete All History"** button in the task history menu. Note that this will also delete all tasks. Checkpoints are stored in VS Code's globalStorage.
* * *
[](#editing-messages)
Editing Messages
-------------------------------------------
Cline allows you to edit chat messages in a task after they've been submitted (with the exception of the message that started the task).
Perhaps you didn't get the results you wanted, thought of a better way to phrase your request, or need to add more information. Editing your message allows you to re-submit a request without starting over or restoring your files or workspace with checkpoints. There are two Restore options:
* **"Restore Chat"** restores just the task state and re-submits an API request to your provider with your edited message.
* **"Restore All"** restores both the task state and workspace state before re-submitting an API request. "Workspace state" refers to the condition of your workspace (files, content, etc.) at different points in the conversation.
**Interactive Editing:**
* Messages can be clicked to enter edit mode
* Cline automatically selects all text when entering edit mode
**Keyboard Shortcuts:**
* Escape: Exit edit mode
* Enter: Restore just the task
* Cmd/Ctrl + Enter: Restore the task and workspace
* Shift + Enter: Insert new line / line break
In this case, I didn't like the changes Cline made to my robot dog-walking website (still working on the robots) and I wanted to revert both the codebase and the task to before any changes were made so I could start fresh.



---
# Custom Instructions | Cline
[](#building-custom-instructions-for-teams)
Building Custom Instructions for Teams
---------------------------------------------------------------------------------------
**Creating standardized project instructions ensures that all team members work within consistent guidelines. Start by documenting your project's technical foundation, then identify which information needs to be included in the instructions. The exact scope will vary depending on your team's needs, but generally it's best to provide as much information as possible. By creating comprehensive instructions that all team members follow, you establish a shared understanding of how code should be written, tested, and deployed across your project, resulting in more maintainable and consistent software.**
* * *
Here are a few topics and examples to consider for your team's custom instructions:
1. **Testing framework and specific commands**
* "All components must include Jest tests with at least 85% coverage. Run tests using `npm run test:coverage` before submitting any pull request."
2. **Explicit library preferences**
* "Use React Query for data fetching and state management. Avoid Redux unless specifically required for complex global state. For styling, use Tailwind CSS with our custom theme configuration found in `src/styles/theme.js.`"
3. **Where to find documentation**
* "All API documentation is available in our internal Notion workspace under 'Engineering > API Reference'. For component usage examples, refer to our Storybook instance at `https://storybook.internal.company.com`"
4. **Which MCP servers to use, and for which purposes**
* "For database operations, use the Postgres MCP server with credentials stored in 1Password under 'Development > Database'. For deployments, use the AWS MCP server which requires the deployment role from IAM. Refer to `docs/mcp-setup.md` for configuration instructions."
5. **Coding conventions specific to your project**
* "Name all React components using PascalCase and all helper functions using camelCase. Place components in the `src/components` directory organized by feature, not by type. Always use TypeScript interfaces for prop definitions."
[PreviousMCP Servers](/enterprise-solutions/mcp-servers)
[NextMCP Overview](/mcp-servers/mcp)
Last updated 1 month ago
---
# Security Concerns | Cline
[PreviousRemote Browser Support](/exploring-clines-tools/remote-browser-support)
[NextCloud Provider Integration](/enterprise-solutions/cloud-provider-integration)
Last updated 1 month ago
[](#enterprise-security-with-cline)
Enterprise Security with Cline
-----------------------------------------------------------------------
####
[](#cline-addresses-enterprise-security-concerns-through-its-unique-client-side-architecture-that-priori)
Cline addresses enterprise security concerns through its unique client-side architecture that prioritizes data privacy, secure cloud integration, and transparent operations. Below is a comprehensive overview of how Cline maintains robust security measures for enterprise environments.
* * *
###
[](#client-side-architecture)
Client-Side Architecture
Cline operates exclusively as a client-side VSCode extension with zero server-side components. This fundamental design choice ensures that your code and data remain within your secure environment at all times. Unlike traditional AI assistants that send data to external servers for processing, Cline connects directly to your chosen cloud provider's AI endpoints, keeping all sensitive information within your infrastructure boundaries.
###
[](#data-privacy-commitment)
Data Privacy Commitment
Cline implements a strict zero data retention policy, meaning your intellectual property never leaves your secure environment. The extension does not collect, store, or transmit your code to any central servers. This approach significantly reduces potential attack vectors that might otherwise be introduced through data transmission to third-party systems. Telemetry collection is optional and requires explicit consent.
###
[](#cloud-provider-integration)
Cloud Provider Integration
Enterprise teams can access cutting-edge AI models through their existing cloud deployments. Cline supports seamless integration with:
* AWS Bedrock
* Google Cloud Vertex AI
* Microsoft Azure
These integrations utilize your organization's existing security credentials, including native IAM role assumption for AWS. This ensures that all AI processing occurs within your corporate cloud environment, maintaining compliance with your established security protocols.
###
[](#open-source-transparency)
Open-Source Transparency
Cline's codebase is completely open-source, allowing for comprehensive security auditing by your internal teams. This transparency enables security professionals to verify exactly how the extension functions and confirm that it adheres to your organization's security requirements. Organizations can review the code to ensure it aligns with their security policies before deployment.
###
[](#controlled-modifications)
Controlled Modifications
The extension implements safeguards against unauthorized changes to your codebase. Cline requires explicit user approval for all file modifications and terminal commands, preventing accidental or unwanted alterations. This approval-based workflow maintains the integrity of your projects while still providing AI assistance.
###
[](#enterprise-deployment-support)
Enterprise Deployment Support
For organizations with strict security review processes, Cline provides comprehensive documentation including detailed deployment diagrams, sequence diagrams illustrating all data flows, and complete security posture documentation. These materials facilitate thorough security reviews and help demonstrate compliance with enterprise data handling standards and regulations.
###
[](#access-control)
Access Control
Enterprise editions of Cline (planned for Q2 2025) will include centralized administration features that allow organizations to:
* Manage user access with customizable permission levels
* Provision accounts with corporate credentials
* Immediately revoke access when needed
* Control which AI providers and LLM endpoints can be used
* Deploy standardized settings across the organization
* Prevent unauthorized use of personal API keys
###
[](#compliance-and-governance)
Compliance and Governance
Cline's architecture supports compliance with data sovereignty requirements and enterprise data handling regulations. The planned Enterprise Complete edition will further enhance governance with detailed audit logging, compliance reporting, and automated policy enforcement mechanisms.
By combining client-side processing, direct cloud provider integration, and transparent operations, Cline offers enterprise teams a secure way to leverage AI assistance while maintaining strict control over their sensitive code and data.
Cline's relationship to local and remote assets

---
# Remote Browser Support | Cline
The Remote Browser feature in Cline allows the AI assistant to interact with web content directly through a controlled browser instance. This enables several powerful capabilities:
* Viewing and interacting with websites
* Testing locally running web applications
* Monitoring console logs and errors
* Performing browser actions like clicking, typing, and scrolling
[](#remote-browser-in-cline)
Remote Browser in Cline
---------------------------------------------------------
###
[](#what-is-remote-browser)
What is Remote Browser?
Remote Browser allows Cline to view and interact with websites directly. This feature enables Cline to:
* Visit websites and view their content
* Test your locally running web applications
* Fill out forms and click on elements
* Capture screenshots of what it sees
* Scroll through pages to see more content
###
[](#how-to-use-remote-browser)
How to Use Remote Browser
####
[](#basic-commands)
Basic Commands
You can ask Cline to use the browser with simple instructions:
* **Click on elements**: "Click the login button"
* **Type text**: "Type 'Hello world' in the search box"
* **Scroll the page**: "Scroll down to see more content"
* **Close the browser**: "Close the browser now"
####
[](#example-workflows)
Example Workflows
**Testing a Web Application:**
Copy
Can you start my React app with "npm start" and then check if it's working properly at http://localhost:3000?
**Analyzing a Website:**
Copy
Can you visit https://example.com and tell me what you think about its design and layout?
**Filling Out a Form:**
Copy
Please go to https://example.com/contact, fill out the contact form with some test data, and submit it.
###
[](#important-things-to-know)
Important Things to Know
####
[](#one-browser-at-a-time)
One Browser at a Time
Cline can only use one browser at a time. If you want to visit a different website, you can either:
* Ask Cline to navigate to a new URL within the same browser session
* Ask Cline to close the current browser and open a new one
####
[](#browser-must-be-closed-before-using-other-tools)
Browser Must Be Closed Before Using Other Tools
If you want Cline to edit files or run commands after using the browser, you must first ask it to close the browser:
Copy
Close the browser and then update the CSS file to fix the alignment issue we saw.
####
[](#what-cline-sees)
What Cline Sees
The browser has a fixed viewport size (900x600 pixels by default), similar to a small laptop screen. Cline will share screenshots after each action so you can see exactly what it sees.
####
[](#console-logs)
Console Logs
Cline captures browser console logs, which can be helpful for debugging web applications. These logs are included with each screenshot.
###
[](#common-use-cases)
Common Use Cases
* **Web Development**: Test your websites and web applications
* **UI/UX Review**: Get feedback on website design and usability
* **Content Research**: Have Cline browse websites to gather information
* **Form Testing**: Verify that forms work correctly
* **Responsive Design Testing**: Check how websites look at different screen sizes
###
[](#troubleshooting)
Troubleshooting
* **If a website doesn't load**: Try providing a direct URL with the http:// or https:// prefix
* **If clicking doesn't work**: Try describing the location of the element more precisely
* **If the browser seems stuck**: Ask Cline to close the browser and try again
###
[](#using-remote-browser-with-vs-code-in-wsl)
Using Remote Browser with VS Code in WSL
When running VS Code in WSL, you'll need to configure Windows to allow WSL to connect to Chrome. Follow these steps:
####
[](#open-powershell-as-administrator-and-run)
Open PowerShell as Administrator and Run:
Copy
# Allow WSL to connect to Chrome's debugging port
New-NetFirewallRule -DisplayName "WSL Chrome Debug" -Direction Inbound -LocalPort 9222 -Protocol TCP -Action Allow
####
[](#configure-cline-in-vs-code)
Configure Cline in VS Code:
1. Open VS Code settings
2. Search for "Cline: Chrome Executable Path"
3. Set the value to the path of your Chrome executable (e.g., `C:\Program Files\Google\Chrome\Application\chrome.exe`)
Cline should now be able to use the Remote Browser feature from within WSL.
[PreviousNew Task Tool](/exploring-clines-tools/new-task-tool)
[NextSecurity Concerns](/enterprise-solutions/security-concerns)
Last updated 25 days ago
**Open a website**: "Use the browser to check the website at "
[https://example.com](https://example.com/)
---
# New Task Tool | Cline
###
[](#the-new_task-tool-and-context-management-strategies)
The `new_task` Tool & Context Management Strategies
####
[](#overview)
Overview
Cline includes a powerful internal tool, `new_task`, designed to help manage workflow continuity and context preservation, especially during complex or long-running tasks. This tool, combined with Cline's awareness of its own context window usage and the flexibility of `.clinerules`, enables sophisticated strategies for breaking down work and ensuring seamless transitions between task sessions.
Understanding the core capabilities and how they interact with custom rules is key to leveraging this feature effectively.
####
[](#core-capabilities)
Core Capabilities
Two fundamental capabilities enable advanced context management:
1. **The** `**new_task**` **Tool:**
* **Function:** Allows Cline, upon user approval, to end the current task session and immediately start a new one.
* **Context Preloading:** Crucially, Cline can **preload** this new task session with specific context provided within the tool's `` block. This context can be anything Cline or a `.clinerules` file defines β summaries, code snippets, next steps, project state, etc.
2. **Context Window Awareness:**
* **Tracking:** Cline internally tracks the percentage of its available context window currently being used during a task.
* **Visibility:** This information is visible in the `environment_details` provided to Cline in its prompt.
####
[](#using-the-new_task-slash-command)
Using the `/new_task` Slash Command
As a quick alternative to Cline suggesting the `new_task` tool or defining complex rules, you can directly initiate the process using a Slash Command.
* **How:** Simply type `/new_task` in the chat input field.
* **Action:** Cline will propose creating a new task, typically suggesting context based on the current session (similar to its default behavior when using the tool). You will still get the `ask_followup_question` prompt to confirm and potentially modify the context before the new task is created.
* **Benefit:** Provides a fast, user-initiated way to leverage the `new_task` functionality for branching explorations or managing long sessions without waiting for Cline to suggest it.
####
[](#default-behavior-without-.clinerules)
Default Behavior (Without `.clinerules`)
By default, without specific `.clinerules` dictating its behavior:
* **Tool Availability:** The `new_task` tool exists, and Cline _can_ choose to use it.
* **Context Awareness:** Cline _is_ aware of its context usage percentage.
* **No Automatic Trigger:** Cline **will not** automatically initiate a task handoff _solely_ based on context usage reaching a specific percentage (like 50%). The decision to suggest using `new_task` comes from the AI model's reasoning based on the overall task progress and prompt instructions.
* **Basic Context Preloading:** If `new_task` is used without specific rules defining the `` block structure, Cline will attempt to preload relevant information based on its current understanding (e.g., a basic summary of progress and next steps), but this may be less comprehensive than a rule-driven approach.
####
[](#the-power-of-.clinerules-enabling-custom-workflows)
The Power of `.clinerules`: Enabling Custom Workflows
While the core capabilities exist by default, the true power, automation, and customization emerge when you combine `new_task` and context awareness with custom workflows defined in `.clinerules`. This allows you to precisely control _when_ and _how_ Cline manages context and task continuity.
Key benefits of using `.clinerules` with `new_task`:
* **Automated Context Management:** Define rules to automatically trigger handoffs at specific context percentages (e.g., >50%, >70%) or token counts, ensuring optimal performance and preventing context loss.
* **Model-Specific Optimization:** Tailor handoff triggers based on known thresholds for different LLMs (e.g., trigger earlier for models known to degrade past a certain token count).
* **Intelligent Breakpoints:** Instruct Cline via rules to find logical stopping points (e.g., after completing a function or test) _after_ a context threshold is passed, ensuring cleaner handoffs.
* **Structured Task Decomposition:** Use Plan Mode to define subtasks, then use `.clinerules` to have Cline automatically create a new task via `new_task` upon completing each subtask, preloading the context for the _next_ subtask.
* **Custom Context Packaging:** Mandate the exact structure and content of the `` block in `.clinerules` for highly detailed and consistent handoffs (see example below).
* **Improved Memory Persistence:** Use `new_task` context blocks as a primary, integrated way to persist information across sessions, potentially replacing or supplementing file-based memory systems.
* **Workflow Automation:** Define rules for specific scenarios, like always preloading certain setup instructions or project boilerplate when starting tasks of a particular type.
####
[](#example-rule-driven-workflow-task-handoff-process)
Example Rule-Driven Workflow: Task Handoff Process
A common workflow, **driven by specific** `**.clinerules**` **like the example below**, involves these steps:
1. **Trigger Identification (Rule-Based):** Cline monitors for handoff points defined in the rules (e.g., context usage > 50%, task completion).
2. **User Confirmation:** Cline uses `ask_followup_question` to propose creating a new task, often showing the intended context defined by the rules.
Copy
I've completed [specific accomplishment] and context usage is high (XX%). Would you like me to create a new task to continue with [remaining work], preloading the following context?
["Yes, create new task", "Modify context first", "No, continue this session"]
3. **User Control:** You can approve, deny, or ask Cline to modify the context before the new task is created.
4. **Context Packaging (**`**new_task**` **Tool):** If approved, Cline uses `new_task`, packaging the context according to the structure mandated by the `.clinerules`.
5. **New Task Creation:** The current task ends, and a new session begins immediately, preloaded with the specified context.
####
[](#the-handoff-context-block-rule-defined-structure)
The Handoff Context Block (Rule-Defined Structure)
The effectiveness of rule-driven handoffs depends heavily on how `.clinerules` define the `` block. A comprehensive structure often includes:
* `**## Completed Work**`: Detailed list of accomplishments, files modified/created, key decisions.
* `**## Current State**`: Project status, running processes, key file states.
* `**## Next Steps**`: Clear, prioritized list of remaining tasks, implementation details, known challenges.
* `**## Reference Information**`: Links, code snippets, patterns, user preferences.
* **Actionable Start:** A clear instruction for the immediate next action.
####
[](#potential-use-cases-and-workflows)
Potential Use Cases & Workflows
The flexibility of `new_task` combined with `.clinerules` opens up many possibilities:
* **Proactive Context Window Management:** Automatically trigger handoffs at specific percentages (e.g., 50%, 70%) or token counts to maintain optimal performance.
* **Intelligent Breakpoints:** Instruct Cline to find logical stopping points (e.g., after completing a function or test) _after_ a context threshold is passed, ensuring cleaner handoffs.
* **Structured Task Decomposition:** Use Plan Mode to define subtasks, then use `.clinerules` to have Cline automatically create a new task via `new_task` upon completing each subtask.
* **Automated Session Summaries:** Configure the `` block to always include a summary of the previous session's key discussion points.
* **Preloading Boilerplate/Setup:** Start new tasks related to specific projects preloaded with standard setup instructions or file templates.
* **"Memory Bank" Alternative:** Use `new_task` context blocks as the primary way to persist information across sessions, potentially replacing file-based memory systems.
Experimenting with `.clinerules` is encouraged to discover workflows that best suit your needs!
####
[](#example-.clinerules-task-handoff-strategy-guide)
Example `.clinerules`: Task Handoff Strategy Guide
Below is an example `.clinerules` file focused specifically on using `new_task` for context window management. **Remember, this is just one specific strategy; the core** `**new_task**` **tool can be used differently with other custom rules.**
Copy
# You MUST use the `new_task` tool: Task Handoff Strategy Guide
**β οΈ CRITICAL INSTRUCTIONS - YOU MUST FOLLOW THESE GUIDELINES β οΈ**
This guide provides **MANDATORY** instructions for effectively breaking down complex tasks and implementing a smooth handoff process between tasks. You **MUST** follow these guidelines to ensure continuity, context preservation, and efficient task completion.
## β οΈ CONTEXT WINDOW MONITORING - MANDATORY ACTION REQUIRED β οΈ
You **MUST** monitor the context window usage displayed in the environment details. When usage exceeds 50% of the available context window, you **MUST** initiate a task handoff using the `new_task` tool.
Example of context window usage over 50% with a 200K context window:
\`\`\`text
# Context Window Usage
105,000 / 200,000 tokens (53%)
Model: anthropic/claude-3.7-sonnet (200K context window)
\`\`\`
**IMPORTANT**: When you see context window usage at or above 50%, you MUST:
1. Complete your current logical step
2. Use the `ask_followup_question` tool to offer creating a new task
3. If approved, use the `new_task` tool with comprehensive handoff instructions
## Task Breakdown in Plan Mode - REQUIRED PROCESS
Plan Mode is specifically designed for analyzing complex tasks and breaking them into manageable subtasks. When in Plan Mode, you **MUST**:
### 1. Initial Task Analysis - REQUIRED
- **MUST** begin by thoroughly understanding the full scope of the user's request
- **MUST** identify all major components and dependencies of the task
- **MUST** consider potential challenges, edge cases, and prerequisites
### 2. Strategic Task Decomposition - REQUIRED
- **MUST** break the overall task into logical, discrete subtasks
- **MUST** prioritize subtasks based on dependencies (what must be completed first)
- **MUST** aim for subtasks that can be completed within a single session (15-30 minutes of work)
- **MUST** consider natural breaking points where context switching makes sense
### 3. Creating a Task Roadmap - REQUIRED
- **MUST** present a clear, numbered list of subtasks to the user
- **MUST** explain dependencies between subtasks
- **MUST** provide time estimates for each subtask when possible
- **MUST** use Mermaid diagrams to visualize task flow and dependencies when helpful
\`\`\`mermaid
graph TD
A[Main Task] --> B[Subtask 1: Setup]
A --> C[Subtask 2: Core Implementation]
A --> D[Subtask 3: Testing]
A --> E[Subtask 4: Documentation]
B --> C
C --> D
\`\`\`
### 4. Getting User Approval - REQUIRED
- **MUST** ask for user feedback on the proposed task breakdown
- **MUST** adjust the plan based on user priorities or additional requirements
- **MUST** confirm which subtask to begin with
- **MUST** request the user to toggle to Act Mode when ready to implement
## Task Implementation and Handoff Process - MANDATORY PROCEDURES
When implementing tasks in Act Mode, you **MUST** follow these guidelines for effective task handoff:
### 1. Focused Implementation - REQUIRED
- **MUST** focus on completing the current subtask fully
- **MUST** document progress clearly through comments and commit messages
- **MUST** create checkpoints at logical completion points
### 2. Recognizing Completion Points - CRITICAL
You **MUST** identify natural handoff points when:
- The current subtask is fully completed
- You've reached a logical stopping point in a larger subtask
- The implementation is taking longer than expected and can be continued later
- The task scope has expanded beyond the original plan
- **CRITICAL**: The context window usage exceeds 50% (e.g., 100,000+ tokens for a 200K context window)
### 3. Initiating the Handoff Process - MANDATORY ACTION
When you've reached a completion point, you **MUST**:
1. Summarize what has been accomplished so far
2. Clearly state what remains to be done
3. **MANDATORY**: Use the `ask_followup_question` tool to offer creating a new task:
\`\`\`xml
I've completed [specific accomplishment]. Would you like me to create a new task to continue with [remaining work]?
["Yes, create a new task", "No, continue in this session", "Let me think about it"]
\`\`\`
### 4. Creating a New Task with Context - REQUIRED ACTION
If the user agrees to create a new task, you **MUST** use the `new_task` tool with comprehensive handoff instructions:
\`\`\`xml
# Task Continuation: [Brief Task Title]
## Completed Work
- [Detailed list of completed items]
- [Include specific files modified/created]
- [Note any important decisions made]
## Current State
- [Description of the current state of the project]
- [Any running processes or environment setup]
- [Key files and their current state]
## Next Steps
- [Detailed list of remaining tasks]
- [Specific implementation details to address]
- [Any known challenges to be aware of]
## Reference Information
- [Links to relevant documentation]
- [Important code snippets or patterns to follow]
- [Any user preferences noted during the current session]
Please continue the implementation by [specific next action].
\`\`\`
### 5. Detailed Context Transfer - MANDATORY COMPONENTS
When creating a new task, you **MUST** always include:
#### Project Context - REQUIRED
- **MUST** include the overall goal and purpose of the project
- **MUST** include key architectural decisions and patterns
- **MUST** include technology stack and dependencies
#### Implementation Details - REQUIRED
- **MUST** list files created or modified in the current session
- **MUST** describe specific functions, classes, or components implemented
- **MUST** explain design patterns being followed
- **MUST** outline testing approach
#### Progress Tracking - REQUIRED
- **MUST** provide checklist of completed items
- **MUST** provide checklist of remaining items
- **MUST** note any blockers or challenges encountered
#### User Preferences - REQUIRED
- **MUST** note coding style preferences mentioned by the user
- **MUST** document specific approaches requested by the user
- **MUST** highlight priority areas identified by the user
## Best Practices for Effective Handoffs - MANDATORY GUIDELINES
### 1. Maintain Continuity - REQUIRED
- **MUST** use consistent terminology between tasks
- **MUST** reference previous decisions and their rationale
- **MUST** maintain the same architectural approach unless explicitly changing direction
### 2. Preserve Context - REQUIRED
- **MUST** include relevant code snippets in the handoff
- **MUST** summarize key discussions from the previous session
- **MUST** reference specific files and line numbers when applicable
### 3. Set Clear Next Actions - REQUIRED
- **MUST** begin the handoff with a clear, actionable next step
- **MUST** prioritize remaining tasks
- **MUST** highlight any decisions that need to be made
### 4. Document Assumptions - REQUIRED
- **MUST** clearly state any assumptions made during implementation
- **MUST** note areas where user input might be needed
- **MUST** identify potential alternative approaches
### 5. Optimize for Resumability - REQUIRED
- **MUST** structure the handoff so the next session can begin working immediately
- **MUST** include setup instructions if environment configuration is needed
- **MUST** provide a quick summary at the top for rapid context restoration
## Example Task Handoff
### Example #1 of an effective task handoff:
\`\`\`xml
# Task Continuation: Implement User Authentication System
## Completed Work
- Created basic Express.js server structure
- Implemented MongoDB connection and user schema
- Completed user registration endpoint with password hashing
- Added input validation using Joi
- Created initial test suite for registration endpoint
## Current State
- Server runs successfully on port 3000
- MongoDB connection is established
- Registration endpoint (/api/users/register) is fully functional
- Test suite passes for all registration scenarios
## Next Steps
1. Implement login endpoint (/api/users/login)
- Use bcrypt to compare passwords
- Generate JWT token upon successful login
- Add proper error handling for invalid credentials
2. Create authentication middleware
- Verify JWT tokens
- Extract user information
- Handle expired tokens
3. Add protected routes that require authentication
4. Implement password reset functionality
## Reference Information
- JWT secret should be stored in .env file
- Follow the existing error handling pattern in routes/users.js
- User schema is defined in models/User.js
- Test patterns are established in tests/auth.test.js
Please continue by implementing the login endpoint following the same patterns established in the registration endpoint.
\`\`\`
### Example #2 of an ineffective task handoff:
*(Note: The example provided in the original rules showing "YOLO MODE Implementation" seems less like a direct handoff context block and more like a general status update with future considerations. A true ineffective handoff might lack detail in 'Current State' or 'Next Steps').*
## When to Use Task Handoffs - MANDATORY TRIGGERS
You **MUST** initiate task handoffs in these scenarios:
1. **CRITICAL**: When context window usage exceeds 50% (e.g., 100,000+ tokens for a 200K context window)
2. **Long-running projects** that exceed a single session
3. **Complex implementations** with multiple distinct phases
4. **When context window limitations** are approaching
5. **When switching focus areas** within a larger project
6. **When different expertise** might be beneficial for different parts of the task
**β οΈ FINAL REMINDER - CRITICAL INSTRUCTION β οΈ**
You **MUST** monitor the context window usage in the environment details section. When it exceeds 50% (e.g., "105,000 / 200,000 tokens (53%)"), you **MUST** proactively initiate the task handoff process using the `ask_followup_question` tool followed by the `new_task` tool. You MUST use the `new_task` tool.
By strictly following these guidelines, you'll ensure smooth transitions between tasks, maintain project momentum, and provide the best possible experience for users working on complex, multi-session projects.
```markdown
## User Interaction & Workflow Considerations
* **Linear Flow:** Currently, using `new_task` creates a linear sequence. The old task ends, and the new one begins. The old task history remains accessible for backtracking.
* **User Approval:** You always have control, approving the handoff and having the chance to modify the context Cline proposes to carry forward.
* **Flexibility:** The core `new_task` tool is a flexible building block. Experiment with `.clinerules` to create workflows that best suit your needs, whether for strict context management, task decomposition, or other creative uses.
[PreviousPlan & Act Modes: A Guide to Effective AI Development](/exploring-clines-tools/plan-and-act-modes-a-guide-to-effective-ai-development)
[NextRemote Browser Support](/exploring-clines-tools/remote-browser-support)
Last updated 9 days ago
---