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:

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/:

Why This Is Bad

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

The code confirms the --max-turns=1 anti-pattern is hardcoded with no session resumption capability.

More comprehensive content coming soon…


  1. Cline GitHub Repository - AI coding assistant for VS Code
  2. Claude Code Documentation - Anthropic’s CLI for Claude
  3. VS Code Extension API - Platform for building VS Code extensions
  4. Command Line Interface - Text-based computer interaction paradigm
  5. Large Language Models - AI models for natural language processing
  6. Claude Code Memory Systems - Persistent context management
  7. Application Programming Interface - Software communication protocols
  8. Persistence in Computing - Data survival across sessions
  9. SQLite Database - Lightweight database engine
  10. Model Context Protocol - Standardized AI model data access