This article explores the integration between Cline An AI coding assistant that integrates with VS Code for intelligent code editing and automation Read more → and Claude Code Anthropic's command-line interface for Claude, designed for software engineering tasks Read more → , two complementary AI-powered development tools.
Overview
Both tools serve different but complementary roles in modern development workflows:
- Cline An AI coding assistant that integrates with VS Code for intelligent code editing and automation Read more → : VS Code extension Extensions that add functionality to Visual Studio Code editor through the Extension API Read more → for real-time AI assistance
- Claude Code Anthropic's command-line interface for Claude, designed for software engineering tasks Read more → : Standalone CLI tool Command Line Interface tools that provide text-based interaction with computer programs Read more → for comprehensive project analysis
The Problem
Cline breaks Claude Code. Instead of using Claude Code properly, Cline treats it like a simple API.
How It Works Now
Cline’s integration is in src/integrations/claude-code/
:
run.ts
(line 204): Forces--max-turns=1
- Every interaction starts a new process
- Sends full conversation history each time
- Kills the process immediately
Why This Is Bad
- Wastes money: Repeats the same context over and over
- Breaks sessions: No
-r <session-id>
for continuing conversations - Kills features: Claude Code can’t do multi-step tasks
- Wrong approach: Treats a smart CLI tool like a dumb API
Code Evidence
The core function in src/integrations/claude-code/run.ts
shows the problematic pattern:
export async function runClaudeCode(
messages: ClaudeMessage[],
claudeCodePath: string,
claudeCodeTools: string,
cwd: string,
env: Record<string, string>
): Promise<ClaudeCodeResponse> {
return new Promise((resolve, reject) => {
// Creates new subprocess every time - no session reuse
const args = [
"--no-pretty",
"--json",
"--disallowedTools", // Line 200-201: Disables native tools
claudeCodeTools,
"--max-turns", // Line 203-204: Forces single turn
"1",
"--",
JSON.stringify({ role: "user", content: "..." })
]
const claudeCodeProcess = spawn(claudeCodePath, args, {
cwd,
env: { ...process.env, ...env },
stdio: ["pipe", "pipe", "pipe"]
})
let stdout = ""
let stderr = ""
claudeCodeProcess.stdout.on("data", (data) => {
stdout += data.toString()
})
claudeCodeProcess.stderr.on("data", (data) => {
stderr += data.toString()
})
claudeCodeProcess.on("close", (code) => {
// Process dies after single interaction
if (code === 0) {
resolve(parseClaudeCodeResponse(stdout))
} else {
reject(new Error(`Claude Code failed: ${stderr}`))
}
})
// Line 237: Dumps entire conversation history every time
claudeCodeProcess.stdin.write(JSON.stringify(messages))
claudeCodeProcess.stdin.end()
})
}
Missing Features
- No
-r
or--resume
arguments anywhere in args array - Session IDs exist in
types.ts
but are never used for resuming - No session management code in the entire integration directory
The code confirms the --max-turns=1
anti-pattern is hardcoded with no session resumption capability.
More comprehensive content coming soon…
- Cline GitHub Repository - AI coding assistant for VS Code
- Claude Code Documentation - Anthropic’s CLI for Claude
- VS Code Extension API - Platform for building VS Code extensions
- Command Line Interface - Text-based computer interaction paradigm
- Large Language Models - AI models for natural language processing
- Claude Code Memory Systems - Persistent context management
- Application Programming Interface - Software communication protocols
- Persistence in Computing - Data survival across sessions
- SQLite Database - Lightweight database engine
- Model Context Protocol - Standardized AI model data access