Cline - 中文版 Docs
  • Cline Documentation
  • 入门指南
    • 快速开始
    • What is Cline?
  • Basics
    • Cline - 中文版胜算 说明文档
      • Cline 和模型上下文协议 (MCP) 服务器:提升 AI 能力
      • Interactive blocks
        • OpenAPI
      • Integrations
        • Cloud Provider Integration
        • Security Concerns
      • .clineignore 功能支持
  • Cline - 中文版胜算 说明文档
    • 什么是Cline - 胜算云增强版
    • 对于新程序员
    • 安装 Cline-胜算云增强版
    • 安装 Dev Essentials
    • 我们最喜欢的技术栈
    • 上下文管理
    • 型号选择指南
  • Getting Started
    • What is Cline?
    • For New Coders
    • Installing Cline
    • Installing Dev Essentials
    • Our Favorite Tech Stack
    • Context Management
    • Model Selection Guide
  • 提高提示技巧
    • 提示工程指南
    • Cline-胜算云增强版 内存库
  • Improving Your Prompting Skills
    • Prompt Engineering Guide
    • Cline Memory Bank
  • 探索 Cline 的工具
    • Cline-胜算云增强版 工具指南
  • 检查站
  • 计划与行动模式:有效人工智能发展指南
  • 新建任务工具
  • Remote Browser 支持
  • Exploring Cline's Tools
    • Cline Tools Guide
    • Checkpoints
    • Plan & Act Modes: A Guide to Effective AI Development
    • New Task Tool
  • Remote Browser Support
  • 企业解决方案
    • 安全问题
  • 云提供商集成
  • MCP 服务器
  • 自定义说明
  • Security Concerns
    • Security Concerns
  • Cloud Provider Integration
  • MCP Servers
  • Custom Instructions
  • MCP服务器
    • MCP概述
    • MCP市场
  • 从 GitHub 添加 MCP 服务器
  • 配置 MCP 服务器
  • 连接到远程服务器
  • MCP 传输机制
  • MCP 服务器开发协议
  • MCP Servers
    • MCP Overview
  • MCP Marketplace
  • Adding MCP Servers from GitHub
  • Configuring MCP Servers
  • Connecting to a Remote Server
  • MCP Transport Mechanisms
  • MCP Server Development Protocol
  • 自定义模型配置
    • 带有凭证身份验证的 AWS Bedrock
    • 带配置文件身份验证的 AWS Bedrock
    • GCP Vertex AI
  • LiteLLM 和 Cline-胜算云增强版(使用 Codestral)
  • Custom Model Configs
    • AWS Bedrock w/ Credentials Authentication
  • AWS Bedrock w/ Profile Authentication
  • GCP Vertex AI
  • LiteLLM & Cline (using Codestral)
  • 本地运行模型
    • 请先阅读
    • Ollama
    • LM 工作室
  • Ollama
  • LM Studio
  • Running Models Locally
  • More Info
    • Telemetry
    • 遥测
Powered by GitBook
On this page
  • Understanding Context & Context Windows
  • Understanding the Context Window Progress Bar
  • Working with Context Files
  • Practical Tips
  1. Getting Started

Context Management

PreviousOur Favorite Tech StackNextModel Selection Guide

Last updated 2 months ago

Context is key to getting the most out of Cline

💡 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 & Context Windows

In a world of infinite context, the context window is what Cline currently has available

Think of working with Cline like collaborating with a thorough, proactive teammate:

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

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

⚠️ 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

Cline provides a visual way to monitor your context window usage through a progress 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

  • 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

Context files help maintain understanding across sessions. They serve as documentation specifically designed to help AI assistants understand your project.

Approaches to Context Files

    • 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

    • 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
  1. 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

  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

  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

    • Document architectural decisions

    • Maintain consistent patterns

    • Keep documentation current

Remember: The goal is to help Cline maintain consistent understanding of your project across sessions.

💡 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 mode.

Evergreen Project Context (i.e. )

Task-Specific Context (i.e. )

Share common context files (consider using files in project roots)

Plan
How Cline manages context under the hood
Memory Bank
Structured Approach
.clinerules