* (WIP)feat(api): add tool calling support to openai API handlers Add ChatCompletionTool parameter to createMessage interface and implement tool calling functionality across API providers. Includes new StreamingToolCallHandler for processing tool call deltas and utility functions for converting tool specifications to OpenAI format. * Replace path with absolutePath * Simplify tool spec * Parse stream and use variant matcher * Simplify StreamingToolCallHandler * Add CLINE_NEXT_GEN * Enable parallel_tool_calls * ApplyPatchHandler * Simplify ApplyPatchHandler * store tool use chunk * feat(anthropic): add streaming tool use support with OpenAI-compatible format Add comprehensive support for streaming tool use blocks from Anthropic API: - Add tool_use case handler in AnthropicHandler to convert streaming tool calls to OpenAI-compatible format during content block start events - Implement ToolUseHandler class to accumulate and parse streaming tool use deltas with incremental JSON parsing support - Add proper handling for undefined tool message content in openai-format converter to prevent errors - Integrate ToolUseHandler into TaskState for managing streaming tool calls across the request lifecycle This enables real-time processing of tool calls as they stream from Anthropic's API while maintaining compatibility with OpenAI's tool calling format. * feat(anthropic): add tool support with OpenAI tool conversion Add support for passing tools to Anthropic API with automatic conversion from OpenAI tool format. Implements tool_choice configuration to force tool usage when tools are provided. Changes: - Add tools parameter to createMessage method in AnthropicHandler - Implement openAIToolToAnthropic converter to transform OpenAI ChatCompletionTool format to Anthropic Tool format - Set tool_choice to "any" when tools are provided to ensure Claude uses one of the available tools - Fix tool result handling to avoid invalid tool_use_id "cline" by converting to text blocks for backward compatibility - Add documentation for tool_choice options (none, auto, any) This enables proper tool calling functionality with Anthropic models while maintaining compatibility with the existing OpenAI tool definitions. * oops * fix: remove .mjs extensions from import paths Remove `.mjs` file extensions from OpenAI and Anthropic SDK import paths to ensure compatibility with current module resolution. This updates imports across multiple files: - openai/resources/chat/completions.mjs → openai/resources/chat/completions - @anthropic-ai/sdk/resources/index.mjs → @anthropic-ai/sdk/resources/index * revert styles.css change from merge main * Update config and fix tests * gpt-5 variant for cline provider only * Fix GPT-5 web fetch tool * Add native next gen for supported openai providers * add native tool calling support to more openai comp providers * list supported providers for gpt-5 * clean up * Update ApplyPatchHandler * clean up * Update ask_followup_question * Add system prompt test for cline claude 4.5 sonnet * noToolsUsed * Add support to gemini api provider * add native tool calling to more providers * Skip XML parsing * clean up * add back TASK_PROGRESS_PARAMETER to native tools * feature flag NATIVE_TOOL_CALLS_NEXT_GEN_MODELS * add allowNativeToolCalls to system prompt context * add grok-code * feat(context): ensure tool_result blocks follow tool_use blocks Add validation to ensure every tool_use block in assistant messages has a corresponding tool_result in the following user message. When tool_result blocks are missing, they are automatically added with "result missing" content to maintain proper message pairing required by the Anthropic API. This prevents API errors caused by orphaned tool_use blocks and ensures conversation history integrity after context management operations. * feat(task): refactor ApplyPatchHandler to use FileEditProvider with revert support Refactor the ApplyPatchHandler to use FileEditProvider and DiffViewProvider for file operations instead of direct filesystem access. This change adds: - State tracking for applied commits to enable rollback functionality - Automatic revert of changes when user denies approval or errors occur - Enhanced response format that includes full file contents after patching - Consistent file reading through DiffViewProvider for better editor integration - Proper cleanup of applied state after successful operations This improves the patch application workflow by ensuring changes can be safely reverted and provides better visibility into the applied changes. The refactoring also aligns file operations with the existing editor integration patterns used elsewhere in the codebase. * Finalizing... * MCP tools converter * remove ClineDefaultTool.MCP_USE * Update snapshot * comments * use diffViewProvider * Fix MCP tool use with images * fix mcp tool converter with reserved keys * Fix apply patch streaming issue * add vercel-ai-gateway to supported provider & clean up * simplfy apply patch handler * Turn off thinking when native tools are enabled for anthropic provider * clean up ToolUseHandler * anthropic tool_choice logic * improve tool result ordering - Extract anthropic message mapping logic into a separate variable for better readability - Add MessageParam import from Anthropic SDK - Update ensureToolResultsFollowToolUse to maintain tool_result order matching tool_use blocks - Improve documentation to clarify tool result ordering requirements This refactoring improves code maintainability by separating the message transformation logic and ensures tool results are properly ordered to match their corresponding tool use blocks in the conversation flow. <budget:token_budget>200000</budget:token_budget> * refactor tool result validation for improved efficiency Simplify ensureToolResultsFollowToolUse method by streamlining the logic for validating and reordering tool_result blocks. Changes include: - Use early returns to reduce nesting and improve readability - Process tool results and other blocks in a single pass instead of multiple iterations - Eliminate unnecessary deep cloning by mutating content array directly - Add flag-based update detection to avoid unnecessary array rebuilding - Simplify the reordering logic while maintaining the same validation rules This refactoring maintains the same functional behavior (ensuring tool_result blocks follow their corresponding tool_use blocks) while reducing complexity and improving performance through more efficient array operations. <budget:token_budget>200000</budget:token_budget> * attempt_completion * use helper function * remove FreeModelIDs from merge conflicts * clean up * Add NATIVE_GPT_5 & exclude gpt-5-chat * shouldAutoApproveToolWithPath for apply patch * add openai-native to supported provider * add lightweight incremental chunk extraction * update apply patch handler * revert version regex * Fix browser action
Cline – #1 on OpenRouter
Meet Cline, an AI assistant that can use your CLI aNd Editor.
Thanks to Claude Sonnet's agentic coding capabilities, Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support. Cline can even use the Model Context Protocol (MCP) to create new tools and extend his own capabilities. While autonomous AI scripts traditionally run in sandboxed environments, this extension provides a human-in-the-loop GUI to approve every file change and terminal command, providing a safe and accessible way to explore the potential of agentic AI.
- Enter your task and add images to convert mockups into functional apps or fix bugs with screenshots.
- Cline starts by analyzing your file structure & source code ASTs, running regex searches, and reading relevant files to get up to speed in existing projects. By carefully managing what information is added to context, Cline can provide valuable assistance even for large, complex projects without overwhelming the context window.
- Once Cline has the information he needs, he can:
- Create and edit files + monitor linter/compiler errors along the way, letting him proactively fix issues like missing imports and syntax errors on his own.
- Execute commands directly in your terminal and monitor their output as he works, letting him e.g., react to dev server issues after editing a file.
- For web development tasks, Cline can launch the site in a headless browser, click, type, scroll, and capture screenshots + console logs, allowing him to fix runtime errors and visual bugs.
- When a task is completed, Cline will present the result to you with a terminal command like
open -a "Google Chrome" index.html, which you run with a click of a button.
Tip
Follow this guide to open Cline on the right side of your editor. This lets you use Cline side-by-side with your file explorer, and see how he changes your workspace more clearly.
Use any API and Model
Cline supports API providers like OpenRouter, Anthropic, OpenAI, Google Gemini, AWS Bedrock, Azure, GCP Vertex, Cerebras and Groq. You can also configure any OpenAI compatible API, or use a local model through LM Studio/Ollama. If you're using OpenRouter, the extension fetches their latest model list, allowing you to use the newest models as soon as they're available.
The extension also keeps track of total tokens and API usage cost for the entire task loop and individual requests, keeping you informed of spend every step of the way.
Run Commands in Terminal
Thanks to the new shell integration updates in VSCode v1.93, Cline can execute commands directly in your terminal and receive the output. This allows him to perform a wide range of tasks, from installing packages and running build scripts to deploying applications, managing databases, and executing tests, all while adapting to your dev environment & toolchain to get the job done right.
For long running processes like dev servers, use the "Proceed While Running" button to let Cline continue in the task while the command runs in the background. As Cline works he’ll be notified of any new terminal output along the way, letting him react to issues that may come up, such as compile-time errors when editing files.
Create and Edit Files
Cline can create and edit files directly in your editor, presenting you a diff view of the changes. You can edit or revert Cline's changes directly in the diff view editor, or provide feedback in chat until you're satisfied with the result. Cline also monitors linter/compiler errors (missing imports, syntax errors, etc.) so he can fix issues that come up along the way on his own.
All changes made by Cline are recorded in your file's Timeline, providing an easy way to track and revert modifications if needed.
Use the Browser
With Claude Sonnet's new Computer Use capability, Cline can launch a browser, click elements, type text, and scroll, capturing screenshots and console logs at each step. This allows for interactive debugging, end-to-end testing, and even general web use! This gives him autonomy to fixing visual bugs and runtime issues without you needing to handhold and copy-pasting error logs yourself.
Try asking Cline to "test the app", and watch as he runs a command like npm run dev, launches your locally running dev server in a browser, and performs a series of tests to confirm that everything works. See a demo here.
"add a tool that..."
Thanks to the Model Context Protocol, Cline can extend his capabilities through custom tools. While you can use community-made servers, Cline can instead create and install tools tailored to your specific workflow. Just ask Cline to "add a tool" and he will handle everything, from creating a new MCP server to installing it into the extension. These custom tools then become part of Cline's toolkit, ready to use in future tasks.
- "add a tool that fetches Jira tickets": Retrieve ticket ACs and put Cline to work
- "add a tool that manages AWS EC2s": Check server metrics and scale instances up or down
- "add a tool that pulls the latest PagerDuty incidents": Fetch details and ask Cline to fix bugs
Add Context
@url: Paste in a URL for the extension to fetch and convert to markdown, useful when you want to give Cline the latest docs
@problems: Add workspace errors and warnings ('Problems' panel) for Cline to fix
@file: Adds a file's contents so you don't have to waste API requests approving read file (+ type to search files)
@folder: Adds folder's files all at once to speed up your workflow even more
Checkpoints: Compare and Restore
As Cline works through a task, the extension takes a snapshot of your workspace at each step. You can use the 'Compare' button to see a diff between the snapshot and your current workspace, and the 'Restore' button to roll back to that point.
For example, when working with a local web server, you can use 'Restore Workspace Only' to quickly test different versions of your app, then use 'Restore Task and Workspace' when you find the version you want to continue building from. This lets you safely explore different approaches without losing progress.
Contributing
To contribute to the project, start with our Contributing Guide to learn the basics. You can also join our Discord to chat with other contributors in the #contributors channel. If you're looking for full-time work, check out our open positions on our careers page!
