Cline (Claude Dev) Mastery
Architecture
Open-source VS Code extension implementing an autonomous coding agent with human-in-the-loop approval for every action.
Capabilities
| Feature | Description |
|---|---|
| File Operations | Create, read, edit with integrated diff viewing |
| Terminal | Execute commands with real-time output monitoring |
| Browser | Headless browser: click, type, scroll, screenshot |
| AST Parsing | Code analysis via AST + regex search |
| Self-Correction | Auto-fixes compilation/linting errors |
| Cost Tracking | Token usage and API cost per task loop |
| Checkpoints | Snapshot at each step, restore previous states |
Model Support
OpenRouter, Anthropic, OpenAI, Gemini, Bedrock, Azure, Vertex, Cerebras, Groq, plus any OpenAI-compatible API or local models (Ollama/LM Studio).
Configuration
.clinerules (single file)
## Code Style
- Use TypeScript strict mode
- Prefer functional components
- All async functions must have try/catch
## Workflow
- Always run tests after changes
- Create descriptive commit messages
.clinerules/ (directory)
.clinerules/
typescript.md
testing.md
architecture.md
MCP Server Config
{
"mcpServers": {
"jira": {
"command": "npx",
"args": ["-y", "@my/jira-mcp-server"],
"env": {
"JIRA_URL": "https://myorg.atlassian.net",
"JIRA_TOKEN": "${JIRA_TOKEN}"
}
}
}
}
Context Mentions
| Mention | Purpose |
|---|---|
@url |
Fetch web content as markdown |
@problems |
Workspace errors/warnings |
@file |
Pre-load specific files |
@folder |
Pre-load folder contents |
MCP Server Creation
Cline can create MCP servers on demand:
- Say "add a tool that does X"
- Cline creates a tailored MCP server
- Auto-installs into the extension
- Tools available for future tasks
Best Practices
- Use
.clinerules/directory for modular rules - Leverage MCP for external integrations (Jira, AWS)
- Use checkpoints before risky operations
- Pre-load files with
@fileto reduce API calls - Configure auto-approve for safe commands
- Monitor cost tracking to optimize token usage