Skip to main content

Claude Code

网站: https://docs.anthropic.com/en/docs/claude-code/setup

Claude Code 提供商让您可以在 Caret 中使用现有的 Claude 订阅。如果您有 Claude Max 或 Pro,这意味着您可以在 Caret 中使用 Claude 而无需支付额外的 API 费用。

在 Caret 中使用 Claude Code 提供商与 Opus 模型

设置

首先,您需要在系统上安装并认证 Claude Code:

  1. 安装 Claude Code:按照 Anthropic 的官方设置指南安装并认证 Claude CLI。

  2. 在 Caret 中配置

    • 打开 Caret 设置(⚙️ 图标)
    • API 提供商下拉菜单中选择 Claude Code
    • 设置 Claude CLI 可执行文件的路径(如果在 PATH 中,通常只需 claude
    Setting up the Claude Code provider in Caret

Anthropic introduced full support for Claude Code on Windows. Follow the instructions on how to set up Claude Code normally and make sure you have the latest Claude Code and Caret versions.

Finding your Claude Code path

If you're not sure where Claude Code is installed:

  • macOS / Linux: Run which claude in your terminal
  • Windows (Command Prompt): Run where claude
  • Windows (PowerShell): Run Get-Command claude

Supported Models

The Claude Code provider supports these models:

  • claude-sonnet-4-20250514 (Recommended)
  • claude-opus-4-1-20250805
  • claude-opus-4-20250514
  • claude-3-7-sonnet-20250219
  • claude-3-5-sonnet-20241022
  • claude-3-5-haiku-20241022

How it works

When you use Claude Code with Caret, here's what happens behind the scenes:

Caret wraps the Claude Code CLI to handle your requests. Each time you send a message, Caret starts a new claude process, sends your conversation, and streams the response back. The AI reasoning comes from Claude Code, but all the actual file editing, terminal commands, and other tools are handled by Caret.

The main difference you'll notice is that responses don't stream character-by-character like other providers. Instead, Claude Code processes your full request before sending back the complete response.

Limitations

There are a few things to keep in mind with Claude Code:

  • Images in your messages get converted to text placeholders since Claude Code doesn't support image uploads through the CLI
  • Prompt caching isn't available with this provider
  • Responses don't stream in real-time like other providers

Troubleshooting

If you run into issues:

Authentication problems: Make sure you're logged into Claude Code with your subscription account. Run claude auth status to check.

Path issues: Double-check that the Claude CLI path in Caret's settings is correct. Try running claude --version in your terminal to verify it's working.

Still having trouble? We're actively improving this integration. Report issues on our GitHub or ask for help in our Discord.

Usage with subscriptions

If you have a Claude Max subscription, your usage in Caret shows up as $0.00 in the billing interface since you're not paying additional API costs. Your usage still counts against your subscription limits, but you won't see per-token charges.

For more details about using Claude Code with your subscription, check out Anthropic's documentation: