---
name: cline
description: Use when building features, debugging code, automating workflows,
  or managing complex development tasks. Agents should reach for this skill when
  users need AI-powered coding assistance, file operations, command execution,
  or structured planning across IDE, CLI, or SDK environments.
metadata:
  mintlify-proj: cline
  version: "1.0"
---

# Cline Skill Reference

## Product Summary

Cline is an AI coding agent that reads and writes files, runs terminal commands, and helps build features through natural conversation. It runs in VS Code, JetBrains IDEs, CLI, and as an SDK. Every action requires explicit approval unless auto-approved. Configuration lives in `~/.cline/` (global) and `.cline/` (project). Key CLI command: `cline "your task"`. Primary docs: https://docs.cline.bot

## When to Use

Reach for this skill when:
- A user asks Cline to build features, fix bugs, refactor code, or run commands
- You need to configure Cline's behavior (rules, skills, hooks, plugins, MCP servers)
- You're setting up authentication with AI providers (Anthropic, OpenAI, AWS Bedrock, etc.)
- You need to understand Plan vs Act modes, file context, or slash commands
- You're automating workflows via CLI, scheduling tasks, or building custom agents with the SDK
- You're troubleshooting configuration, networking, or tool approval issues

Do not use this skill for: installation/setup steps, account creation, pricing questions, or dashboard-only operations.

## Quick Reference

### Essential CLI Commands

| Command | Purpose |
|---------|---------|
| `cline` | Start interactive mode |
| `cline "task"` | Run one task immediately |
| `cline --plan "task"` | Start in Plan mode (read-only exploration) |
| `cline --auto-approve true "task"` | Run headless with auto-approval |
| `cline --json "task"` | Output newline-delimited JSON |
| `cline auth` | Authenticate with a provider |
| `cline config` | View/edit configuration |
| `cline mcp` | Manage MCP servers |
| `cline schedule` | Manage scheduled tasks |
| `cline history` | View session history |
| `cline doctor` | Diagnose configuration issues |

### Configuration Locations

| Scope | Path | Purpose |
|-------|------|---------|
| Global | `~/.cline/` | Applies to all Cline apps (IDE, CLI, SDK) |
| Global settings | `~/.cline/data/settings/` | API keys, provider config, MCP settings |
| Project | `.cline/` | Team-shared behavior in repo |
| Rules | `.cline/rules/` or `.clinerules/` | Coding standards, project context |
| Skills | `.cline/skills/` | Modular instruction sets |
| Hooks | `.cline/hooks/` | Lifecycle event handlers |
| Plugins | `.cline/plugins/` | Custom tools and extensions |

### Built-In Tools

| Tool | What It Does |
|------|--------------|
| `read_files` | Read one or more files |
| `search_codebase` | Search the workspace |
| `run_commands` | Execute shell commands |
| `editor` or `apply_patch` | Edit files (one or the other, not both) |
| `fetch_web_content` | Fetch web pages |
| `skills` | Invoke configured skills |
| `ask_question` | Ask user for input |
| `submit_and_exit` | Submit final answer and stop |

### 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, plan thoroughly |
| `/reportbug` | Report a bug with diagnostics |
| `/<skill-name>` | Trigger a skill directly |

### File Mention Syntax

| What | Syntax | Example |
|------|--------|---------|
| Single file | `@/path/to/file` | `@/src/index.ts` |
| Folder | `@/path/to/folder/` | `@/src/components/` |
| Multi-root workspace | `@workspace-name:/path` | `@web:/src/App.tsx` |

### Global Flags

| Flag | Purpose |
|------|---------|
| `-p, --plan` | Start in Plan mode |
| `--auto-approve <bool>` | Global tool auto-approval |
| `-m, --model <id>` | Override model for this run |
| `-P, --provider <id>` | Override provider for this run |
| `-c, --cwd <path>` | Set working directory |
| `--config <dir>` | Use custom config directory |
| `--json` | Output newline-delimited JSON |
| `--thinking <level>` | Set reasoning effort (none/low/medium/high/xhigh) |
| `-t, --timeout <seconds>` | Set task timeout |

## Decision Guidance

### When to Use Plan vs Act Mode

| Scenario | Mode | Why |
|----------|------|-----|
| Starting new features with unclear approach | Plan | Explore and strategize without changing files |
| Debugging tricky issues | Plan | Understand the problem before fixing |
| Making architectural decisions | Plan | Discuss tradeoffs before implementation |
| Learning unfamiliar codebase | Plan | Read and understand without risk |
| Implementing a planned solution | Act | Execute against your plan |
| Making routine changes with clear approach | Act | No planning overhead needed |
| Quick fixes where solution is obvious | Act | Act immediately |

### When to Use Rules vs Skills

| Need | Use | Why |
|------|-----|-----|
| Persistent instructions across all conversations | Rules | Always active, consume context |
| Coding standards, project context | Rules | Team-shared, version controlled |
| On-demand guidance for specific tasks | Skills | Load only when triggered |
| Deployment procedures, domain-specific workflows | Skills | Modular, don't clutter context |
| Conditional guidance based on file paths | Conditional Rules | Activate only for matching files |

### When to Use Global vs Project Configuration

| Configuration | Scope | Commit to Repo? |
|---------------|-------|-----------------|
| Personal preferences, API keys | Global (`~/.cline/`) | No |
| Team standards, coding guidelines | Project (`.cline/`) | Yes |
| Secrets, local-only settings | Global | No |
| Reusable skills, shared rules | Project | Yes |

### Headless vs Interactive Mode

| Use Case | Mode | Trigger |
|----------|------|---------|
| CI/CD pipelines, scripts | Headless | Use `--json`, pipe stdin, redirect stdout |
| Interactive development | Interactive | Run `cline` without flags |
| Unattended automation | Headless + `--auto-approve true` | Combine flags |

## Workflow

### Typical Task Workflow

1. **Start in Plan mode** (unless the solution is obvious)
   ```bash
   cline --plan "describe what you want to build"
   ```

2. **Explore and understand**
   - Cline reads files, searches codebase, discusses approach
   - Use `@/path/to/file` to add context
   - Ask clarifying questions

3. **Create a plan**
   - Discuss architecture, edge cases, implementation strategy
   - Ask Cline to write a markdown summary if complex

4. **Switch to Act mode**
   - Type your next message to switch modes
   - Cline retains full context from planning

5. **Implement and iterate**
   - Cline modifies files, runs commands, tests
   - Approve or reject each tool call
   - Use `/newtask` if context fills up

6. **Verify results**
   - Run tests, check output
   - Ask Cline to explain changes if needed

### Setting Up a New Project with Cline

1. **Initialize configuration**
   ```bash
   cline config
   ```

2. **Create project rules** (if team standards exist)
   - Create `.cline/rules/` directory
   - Add markdown files with coding standards, architecture patterns
   - Use conditional rules to scope guidance by file path

3. **Create project skills** (if domain-specific workflows exist)
   - Create `.cline/skills/` directory
   - Add `skill-name/SKILL.md` with YAML frontmatter and instructions
   - Include supporting files in `docs/`, `templates/`, `scripts/` subdirectories

4. **Configure MCP servers** (if external integrations needed)
   ```bash
   cline mcp
   ```

5. **Set up Memory Bank** (for multi-session projects)
   - Create `memory-bank/` directory with `projectbrief.md`, `activeContext.md`, etc.
   - Add Memory Bank instructions to `.cline/rules/memory-bank.md`
   - Ask Cline to "initialize memory bank"

### Automating with CLI

1. **For CI/CD integration**
   ```bash
   cline --json --auto-approve true "run tests and fix failures" | jq -r 'select(.type == "run_result") | .text'
   ```

2. **For scheduled tasks**
   ```bash
   cline schedule create --cron "0 9 * * *" "daily code review"
   ```

3. **For parallel task execution**
   ```bash
   cline kanban
   ```

## Common Gotchas

- **Auto-approval in production**: `--auto-approve true` runs without prompts. Always use on clean branches and review results. Default is `true` in CLI but `false` in ACP mode.

- **Context window filling up**: Use `/newtask` to extract key decisions and continue with a fresh context window. Or use `/smol` to compress history in the same task.

- **Rules consuming too many tokens**: Keep rules concise and use conditional rules to scope them to specific file paths. Avoid pasting entire style guides; link to external docs instead.

- **Skills not triggering**: Skill descriptions determine when they activate. Be specific: "Deploy to AWS using CDK" triggers better than "AWS stuff". Test by trying different phrasings.

- **File mentions not working**: Use exact paths starting with `/`. In multi-root workspaces, prefix with workspace name: `@workspace-name:/path`. Trailing slash on folders is required: `@/src/components/`.

- **MCP servers not connecting**: Verify the command/URL is correct, the server process is running, and the port is accessible. Check `cline mcp` status and test with `cline mcp add` wizard.

- **Hooks executing code**: Review hooks and plugins like any executable before adding globally. They run at lifecycle events and can modify behavior. Only use from trusted sources.

- **Proxy/networking issues**: Set `https_proxy`, `http_proxy`, and `NODE_EXTRA_CA_CERTS` environment variables. CLI only supports HTTP proxies, not SOCKS or PAC scripts.

- **Conditional rules not activating**: Ensure glob patterns match your file paths exactly. Patterns are case-sensitive. Use `**` for recursive matching, `*` for single-level. Test with a simple rule first.

- **Tool approval policies not working**: Policies apply per tool. `autoApprove: false` requires approval; `enabled: false` disables the tool entirely. Check that your policy targets the right tool name.

- **Deprecated patterns**: `.clineignore` is deprecated; use hooks instead. Old XML-style tool names (`read_file`, `execute_command`) are replaced by current names (`read_files`, `run_commands`).

- **Secrets in configuration**: Never commit API keys to `.cline/`. Store them in `~/.cline/data/settings/providers.json` (global, not in repo) or use environment variables.

## Verification Checklist

Before submitting work with Cline:

- [ ] **Configuration is correct**: Run `cline config` and verify provider, model, and settings
- [ ] **Rules are loaded**: Check that project rules appear in the Rules panel and are toggled on
- [ ] **Skills are available**: Verify skills are in `.cline/skills/` and descriptions match your use case
- [ ] **File context is complete**: Use `@/path` to include all relevant files in your prompt
- [ ] **Approval settings are appropriate**: For CI/CD, use `--auto-approve true` on clean branches; for interactive work, require approval for risky tools
- [ ] **MCP servers are connected**: Run `cline mcp` and confirm all needed servers show "enabled"
- [ ] **Hooks are reviewed**: If using custom hooks, verify they're from trusted sources and do what you expect
- [ ] **Plan mode was used for complex tasks**: For features touching multiple files, start with `/deep-planning` or `--plan`
- [ ] **Results are tested**: Run tests, check output, and review file changes before committing
- [ ] **Memory Bank is updated**: If using multi-session workflows, run "update memory bank" before context fills up

## Resources

**Comprehensive navigation**: https://docs.cline.bot/llms.txt

**Critical documentation**:
- [Cline Overview](https://docs.cline.bot/cline-overview) — What Cline is and how to use it
- [CLI Reference](https://docs.cline.bot/cli/cli-reference) — Complete command and flag reference
- [Configuration Guide](https://docs.cline.bot/getting-started/config) — Where config lives and how to organize it
- [Cline Rules](https://docs.cline.bot/customization/cline-rules) — Persistent instructions and conditional rules
- [Skills](https://docs.cline.bot/customization/skills) — Modular instruction sets and when to use them
- [Plan & Act Mode](https://docs.cline.bot/core-workflows/plan-and-act) — Thinking first, then building
- [Memory Bank](https://docs.cline.bot/best-practices/memory-bank) — Multi-session context management

---

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