---
name: cline
description: Use when building features, debugging code, automating tasks, or
  managing complex development workflows. Cline is an AI coding agent that reads
  files, writes code, runs commands, and helps you build through natural
  conversation. Use this skill when you need to understand how to configure
  Cline, run tasks via CLI or IDE, customize behavior with rules and skills,
  integrate external tools, and manage context across sessions.
metadata:
  mintlify-proj: cline
  version: "1.0"
---

# Cline Skill

## Product Summary

Cline is an AI coding agent that lives in your editor and terminal. It reads and writes files, runs commands, uses a browser, and helps you build features through conversation. Every action requires your explicit approval (or auto-approval if configured). Cline runs across multiple platforms: VS Code, Cursor, Windsurf, JetBrains IDEs, Zed, Neovim, and CLI. Configuration lives in `~/.cline/` (global) and `.cline/` (project-level). Key CLI command: `npm i -g cline` then `cline` to start. Primary docs: https://docs.cline.bot

## When to Use

Reach for this skill when:
- **Configuring Cline** — setting up providers, authentication, rules, skills, plugins, or MCP servers
- **Running tasks via CLI** — automating workflows, CI/CD integration, headless execution, or scripting
- **Customizing behavior** — creating rules for coding standards, skills for domain-specific tasks, or hooks for lifecycle events
- **Managing context** — using Memory Bank for multi-session persistence, checkpoints for rollback, or slash commands for context compression
- **Integrating external tools** — adding MCP servers, custom tools via plugins, or connecting to APIs
- **Troubleshooting** — diagnosing configuration issues, permission problems, or unexpected behavior
- **Optimizing workflows** — choosing Plan vs Act mode, enabling auto-approve, or using Kanban for parallel tasks

## Quick Reference

### Configuration Locations

| Scope | Path | Contents |
|-------|------|----------|
| Global | `~/.cline/data/settings/` | API keys, provider config, MCP settings |
| Global | `~/.cline/` | Rules, hooks, skills, plugins, agents, cron specs |
| Project | `.cline/` | Project-specific rules, skills, hooks, plugins, agents |
| Docs | `~/Documents/Cline/` | Additional global rules, hooks, plugins, workflows |

### Essential CLI Commands

```bash
cline                          # Start interactive mode
cline "your task"              # Run one task
cline --auto-approve true "task"  # Autonomous execution
cline -p "task"                # Start in Plan mode
cline --json "task"            # Structured JSON output
cline auth                     # Configure provider/model
cline config                   # View/edit settings
cline mcp                      # Manage MCP servers
cline doctor                   # Diagnose issues
cline schedule                 # Manage scheduled tasks
cline kanban                   # Launch Kanban board
```

### Built-In Tools

| Tool | Purpose | Approval |
|------|---------|----------|
| `bash` | Execute shell commands | Usually requires approval |
| `editor` | View and edit files | Usually requires approval |
| `read_files` | Batch read multiple files | Auto-approved (read-only) |
| `apply_patch` | Apply unified diffs | Usually requires approval |
| `search` | Ripgrep-powered codebase search | Auto-approved (read-only) |
| `fetch_web` | HTTP requests with HTML conversion | Usually requires approval |
| `ask_question` | Request user input | Always requires approval |

### Global Flags

| Flag | Purpose |
|------|---------|
| `-p, --plan` | Start in Plan mode (read-only exploration) |
| `--auto-approve <bool>` | Auto-approve all tools (default: `true` in CLI) |
| `-m, --model <id>` | Override model for this run |
| `-P, --provider <id>` | Override provider for this run |
| `-c, --cwd <path>` | Set working directory |
| `--json` | Output newline-delimited JSON |
| `--thinking <level>` | Reasoning effort: `none|low|medium|high|xhigh` |
| `-t, --timeout <seconds>` | Task timeout |

### Slash Commands

| Command | Purpose |
|---------|---------|
| `/newtask` | Start fresh task with distilled context |
| `/smol` | Compress conversation history |
| `/newrule` | Create a rule file interactively |
| `/deep-planning` | Investigate codebase and create detailed plan |
| `/reportbug` | Report issue with diagnostics |

### File Mention Syntax

```bash
@/path/to/file          # Include file content
@/path/to/folder/       # Include folder structure and contents
@workspace-name:/path   # Multi-root workspace reference
```

## Decision Guidance

### When to Use Plan vs Act Mode

| Scenario | Mode | Reason |
|----------|------|--------|
| Starting new features, unclear approach | Plan | Explore and strategize without changing files |
| Debugging tricky issues | Plan | Understand problem before implementing |
| Architectural decisions | Plan | Discuss tradeoffs before committing |
| Learning unfamiliar codebase | Plan | Read and understand without risk |
| Implementing known solution | Act | Execute against established plan |
| Routine changes, obvious solution | Act | Skip planning overhead |
| Running tests and fixing failures | Act | Iterative implementation |

### When to Use Rules vs Skills vs Hooks

| Need | Use | Reason |
|------|-----|--------|
| Persistent coding standards, project context | Rules | Always active, included in every session |
| Domain-specific task guidance (e.g., deployment) | Skills | Load on-demand, don't consume context when unused |
| Lifecycle logic, policy enforcement, logging | Hooks | Run at specific stages (before/after tool calls) |
| Reusable tools, commands, multiple capabilities | Plugins | Package tools, hooks, commands together |

### When to Use Auto-Approve vs YOLO Mode

| Scenario | Setting | Risk Level |
|----------|---------|-----------|
| Routine read operations, safe commands | Auto-approve specific tools | Low |
| Rapid prototyping, throwaway experiments | YOLO mode | High |
| Production code, sensitive operations | Require approval | Lowest |
| CI/CD automation with validation | Auto-approve + checkpoints | Medium |

### When to Use Checkpoints vs Git

| Scenario | Use | Benefit |
|----------|-----|---------|
| Undo Cline changes mid-task | Checkpoints | Revert without affecting Git history |
| Preserve conversation context | Checkpoints | Restore files, keep discussion |
| Permanent version control | Git | Commit and push when satisfied |
| Experimental branches | Git | Isolate work, merge when ready |

## Workflow

### Typical Task Execution

1. **Understand the project**
   - Read `.cline/rules/` and `.cline/skills/` to understand project standards
   - Check Memory Bank files (`memory-bank/projectbrief.md`, etc.) if they exist
   - Ask Cline to "follow your custom instructions" if resuming work

2. **Plan the approach** (for non-trivial tasks)
   - Start in Plan mode: `cline -p "describe what you want to build"`
   - Let Cline explore relevant files and understand the codebase
   - Discuss architecture, edge cases, and implementation strategy
   - Ask clarifying questions before committing to changes

3. **Execute the implementation**
   - Switch to Act mode or start fresh: `cline "implement the solution"`
   - Cline reads the conversation history and implements based on the plan
   - Review changes using checkpoint diffs before approving
   - Use `/newtask` if context window fills up mid-task

4. **Verify and iterate**
   - Run tests and check for regressions
   - Use checkpoints to roll back if something breaks
   - Ask Cline to fix issues or try a different approach
   - Commit changes to Git when satisfied

5. **Preserve context for next session**
   - Ask Cline to "update memory bank" before ending session
   - Commit Memory Bank files to version control
   - Next session: ask Cline to "follow your custom instructions"

### Setting Up a New Project

1. Create `.cline/rules/` directory
2. Add project-specific rules (coding standards, architecture, constraints)
3. Create `.cline/skills/` directory for domain-specific tasks
4. Initialize Memory Bank: ask Cline to "initialize memory bank"
5. Commit `.cline/` to version control for team sharing

### Configuring Providers

1. Run `cline auth` to authenticate
2. Choose provider (Cline, ClinePass, OpenAI, Anthropic, AWS Bedrock, etc.)
3. Enter API key or follow OAuth flow
4. Select model
5. Verify with `cline config`

### Adding MCP Servers

1. Run `cline mcp` (CLI) or open MCP Servers panel (IDE)
2. Add server: local (STDIO) or remote (HTTP/SSE)
3. Configure credentials via environment variables or headers
4. Verify tools appear in tool list
5. Test one tool call to confirm connectivity

## Common Gotchas

- **Context window fills up mid-task** — Use `/newtask` or `/smol` to compress history. Update Memory Bank before starting new conversation.
- **Rules not activating** — Check that rule files are in `.clinerules/` or `.cline/rules/`. Verify YAML frontmatter syntax for conditional rules. Toggle rule on in Rules panel.
- **Skills not triggering** — Ensure skill description matches your request. Check that skill is enabled. Use `/skill-name` slash command to force trigger.
- **Auto-approve not working** — Verify `--auto-approve true` flag is set. Check that specific tool categories are enabled in settings. Remember: auto-approve is per-tool, not global.
- **Checkpoints disabled in multi-root workspaces** — Checkpoints use shadow Git repo; multi-root workspaces have multiple Git histories. Use normal Git workflow instead.
- **MCP server won't connect** — Verify command/URL is correct. Check environment variables and credentials. Test server directly. Increase timeout if server is slow.
- **Files excluded from context** — Check `.clineignore` patterns (deprecated but still supported). Use `@/path/to/file` to explicitly include files. Verify file isn't in `.gitignore`.
- **Cline missing context about a file** — Explicitly mention file with `@/path/to/file`. Check that file isn't being excluded by ignore patterns. Use `/deep-planning` for complex tasks.
- **Provider authentication fails** — Run `cline doctor` to diagnose. Check API key is valid and not expired. Verify provider credentials in `~/.cline/data/settings/providers.json`.
- **Commands not allowed** — Check `CLINE_COMMAND_PERMISSIONS` environment variable. Verify command matches allow/deny patterns. Use `allowRedirects: true` if using shell redirects.

## Verification Checklist

Before submitting work with Cline:

- [ ] **Rules are active** — Check Rules panel shows expected rules enabled. Verify conditional rules match current file paths.
- [ ] **Context is sufficient** — Use `@/path/to/file` to include relevant files. Check Memory Bank is up-to-date if resuming work.
- [ ] **Changes are reviewed** — Use checkpoint Compare to inspect diffs. Run tests to verify no regressions.
- [ ] **Approval settings are correct** — Verify auto-approve is set appropriately for the task. Check YOLO mode is disabled for production work.
- [ ] **MCP servers are configured** — Run `cline mcp` to list servers. Test one tool call to confirm connectivity.
- [ ] **Configuration is committed** — Commit `.cline/rules/`, `.cline/skills/`, and Memory Bank files to version control for team sharing.
- [ ] **Checkpoints are available** — Verify checkpoints are enabled if you might need to roll back. Check storage isn't excessive for large repos.
- [ ] **Provider is authenticated** — Run `cline config` to verify provider and model are set. Check API key is valid.

## Resources

- **Comprehensive navigation**: https://docs.cline.bot/llms.txt — Full page-by-page listing for agent reference
- **Configuration guide**: https://docs.cline.bot/getting-started/config — Global and project config, environment variables
- **CLI reference**: https://docs.cline.bot/cli/cli-reference — Complete command and flag reference
- **Rules and customization**: https://docs.cline.bot/customization/cline-rules — Writing effective rules with conditional activation
- **Skills guide**: https://docs.cline.bot/customization/skills — Creating domain-specific task guidance
- **Plan & Act modes**: https://docs.cline.bot/core-workflows/plan-and-act — When and how to use each mode
- **Checkpoints**: https://docs.cline.bot/core-workflows/checkpoints — Rolling back changes while preserving context
- **Memory Bank**: https://docs.cline.bot/best-practices/memory-bank — Multi-session persistence and context management
- **MCP overview**: https://docs.cline.bot/mcp/mcp-overview — Adding external tools and integrations

---

> For additional documentation and navigation, see: https://docs.cline.bot/llms.txt