🔶 Cursor Bridge:在 Cursor 订阅中无限运行 Claude Code
英文标题:🔶 Cursor Bridge – Run Unlimited Claude Code on Your Cursor Subscription
Cursor Bridge 是一个 Rust 单二进制工具,可将 Claude Code 的 API 调用转换至 Cursor 的 agent CLI 后端运行。项目称,已订阅 Cursor 的用户可借助其包含在订阅中的 Auto 模型运行 Claude Code,无需另行支付 Anthropic API 用量或 Claude Pro 费用。该工具会自动读取 Cursor 认证令牌、启动临时本地 HTTP 代理、拉起 `claude` CLI,并在会话结束后清理资源。相较于常驻的 Node.js 代理方案,它主打零配置、随机端口、无需手动设置环境变量,但 Linux 用户仍需设置 `CURSOR_TOKEN`。
97.3 KB
中文
一个二进制文件。在 Cursor 后端运行 Claude Code。零配置。
你拥有 Cursor 订阅,并希望使用 Claude Code(CLI)。Cursor 的 Auto 模型已包含在订阅中——免费、无限使用,没有额外的按 Token 计费。
如果没有 cursor-bridge,你需要另外购买 Anthropic API 额度或 Claude Pro 订阅。使用 cursor-bridge 后,只需运行 cursor-bridge,即可在 Cursor 后端运行 Claude Code。
使用场景:
-
你已经在为 Cursor 付费 → 可额外免费获得 Claude Code
-
你希望使用 Claude Code 的 Agent 能力(编辑文件、执行 Shell 命令、调用工具),但不想承担 Anthropic 账单
-
Cursor 的 Auto 模型随订阅免费且无限使用 → Claude Code 实际上可免费运行
cursor-bridge # 交互式会话 cursor-bridge "refactor this file" # 单次提示 cursor-bridge -p "list files" # 管道模式
就是这样。无需管理代理,无需环境变量,一切自动完成。
cursor-bridge (Rust 二进制文件)
├── 在随机端口启动本地 HTTP 代理
├── 从 macOS 钥匙串读取你的 Cursor 认证 Token(Linux 上则读取 CURSOR_TOKEN 环境变量)
├── 启动 `claude`,并将环境变量指向代理
├── 代理将 Anthropic API 调用转换为 Cursor agent CLI 调用
└── 退出时清理资源
你看不到这个代理,也不需要管理它。它会出现,然后消失。
# 前置条件
# - 已安装 Cursor,且其 `agent` CLI 已完成认证(`agent login`)
# - 已安装 Claude Code(`curl -O https://claude-code.anthropic.com/claude && chmod +x claude`)
cargo install cursor-bridge
# 然后直接使用
cursor-bridge
或者从 Releases 下载二进制文件。
- macOS 或 Linux
- Cursor 订阅(其
agentCLI 位于 PATH 中) - Claude Code CLI(
claude位于 PATH 中) - macOS:自动从钥匙串读取 Token
- Linux:设置
CURSOR_TOKEN环境变量(不提供钥匙串回退机制)
与其他代理方案的区别
其他所有方案都是需要你自行管理的后台服务器。cursor-bridge 则是一条你直接运行的命令。
现有代理(cursor-api-proxy、cursor-composer-in-claude、cursor-proxy)都是 Node.js 服务器:它们常驻于进程列表中、占用端口,并需要手动配置环境变量。它们并不随 Claude Code 一起运行,而是夹在你与 Claude Code 之间,增加了额外操作。
cursor-bridge 则恰恰相反。 无需启动、停止或配置任何东西。它 就是 会话本身:
| 旧方式 | cursor-bridge |
|---|---|
启动代理守护进程,记录端口,设置环境变量,然后 运行 claude |
运行 cursor-bridge——完成 |
| 后台进程会在会话结束后继续存在 | 与终端同时启动和退出 |
| 选择端口,并祈祷它不会冲突 | 随机端口,零冲突 |
npm install + npx + Node.js 运行时(60+ MB) |
一个 Rust 二进制文件,约 780 KB,静态编译 |
| 多个 npm 包、对等依赖和版本不匹配 | cargo install 或下载即可。一个二进制文件,别无其他。 |
无需守护进程。无需 npm install。无需环境变量。无需寻找端口。无需清理。只需一个可直接工作的二进制文件。
cursor-bridge 完全替代 claude——它在内部管理代理生命周期、启动 CLI,并在完成后自行清理。
- Linux:需要
CURSOR_TOKEN环境变量(不支持钥匙串)。 - 不提供工作区沙箱——Agent 在你的当前目录中运行。
- 单账户——暂不支持多账户轮换。
本项目与 Anthropic 或 Cursor/Anysphere 没有关联。使用风险自负。
MIT
English / 原文
One binary. Claude Code on Cursor's backend. Zero config.
You have a Cursor subscription. You want to use Claude Code (the CLI). Cursor's Auto model is included with your subscription — free, unlimited, no extra per-token cost.
Without cursor-bridge, you'd pay separately for Anthropic API credits or a Claude Pro plan. With cursor-bridge, you just run cursor-bridge and it works — Claude Code runs on your Cursor backend.
Use cases:
-
You're already paying for Cursor → get Claude Code for free on top
-
You want Claude Code's agent capabilities (file editing, shell commands, tool use) without Anthropic billing
-
Cursor's Auto model is free and unlimited with subscription — Claude Code becomes effectively free to run
cursor-bridge # interactive session cursor-bridge "refactor this file" # one-shot prompt cursor-bridge -p "list files" # pipe mode
That's it. No proxy management. No env vars. Everything automatic.
cursor-bridge (Rust binary)
├── Starts a local HTTP proxy on a random port
├── Reads your Cursor auth token from macOS keychain (or CURSOR_TOKEN env var on Linux)
├── Spawns `claude` with env vars pointing at the proxy
├── Proxy translates Anthropic API calls → Cursor agent CLI
└── Cleans up on exit
You don't see the proxy. You don't manage it. It's there and gone.
# Prerequisites
# - Cursor installed with `agent` CLI authenticated (`agent login`)
# - Claude Code installed (`curl -O https://claude-code.anthropic.com/claude && chmod +x claude`)
cargo install cursor-bridge
# Then just use it
cursor-bridge
Or download a binary from Releases.
- macOS or Linux
- Cursor subscription (with
agentCLI in PATH) - Claude Code CLI (
claudein PATH) - macOS : token auto-read from keychain
- Linux : set
CURSOR_TOKENenv var (no keychain fallback)
How it differs from other proxies
All other solutions are background servers you manage. cursor-bridge is a command you run.
Existing proxies (cursor-api-proxy, cursor-composer-in-claude, cursor-proxy) are Node.js servers that live in your process list, occupy a port, and need manual env var wiring. They don't ship with Claude Code — they sit between you and it, adding ceremony.
cursor-bridge is the opposite. There is nothing to start, stop, or configure. It is the session:
| The old way | cursor-bridge |
|---|---|
Start a proxy daemon, note the port, set env vars, then run claude |
Run cursor-bridge — done |
| Background process that outlives your session | Lives and dies with your terminal |
| Pick a port, pray it doesn't clash | Random port, zero conflicts |
npm install + npx + Node.js runtime (60+ MB) |
One Rust binary, ~780 KB, statically compiled |
| Multiple npm packages, peer deps, version mismatches | cargo install or download. One binary. Nothing else. |
No daemon. No npm install. No env vars. No port hunting. No cleanup. Just a single binary that works.
cursor-bridge replaces claude entirely — it manages the proxy lifecycle internally, spawns the CLI, and cleans up after itself when you're done.
- Linux : requires
CURSOR_TOKENenv var (no keychain support). - No workspace sandboxing — the agent runs in your current directory.
- Single account — no multi-account rotation (yet).
This project is not affiliated with Anthropic or Cursor/Anysphere. Use at your own risk.
MIT