-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Problem
When using cursor-api-proxy as a forwarding layer, the agent does not purely forward messages back to the client. Instead, it actively executes tool calls (such as file reads/writes) on the proxy server's own working directory.
Steps to Reproduce
- Deploy cursor-api-proxy on a remote server
- Configure Claude Code (CLI) to use the proxy endpoint
- Ask the agent to perform file operations (e.g., write content to a file, read a file)
Expected Behavior
The proxy should transparently forward all messages (including tool calls and their results) between the client and the upstream API. Tool executions like file editing should happen on the client side (where Claude Code is running), not on the server.
Actual Behavior
The agent interprets and executes tool calls locally on the proxy server. For example:
- When asked to write to
demo.txt, it writes to the server's filesystem, not the client's - When asked about the current working directory, it returns the server's working directory (e.g.,
/tmp/cursor-proxy-xxxxx) instead of the client's project path
This means the proxy is not acting as a transparent relay — it is consuming and acting on the tool calls itself.
Environment
- Client: Claude Code (Anthropic's official CLI tool)
- Proxy: cursor-api-proxy deployed on a remote server
Impact
This makes the proxy unusable in a server-client deployment model, since all file operations and tool executions affect only the server environment and have no effect on the client's local project. Claude Code expects tool results to come from its own local environment, but the proxy intercepts them.
Expected Solution
The proxy should forward tool call requests and responses transparently between Claude Code and the upstream API, without intercepting or executing them on the server side.
▐▛███▜▌ Claude Code v2.1.70
▝▜█████▛▘ Opus 4.6 · API Usage Billing
▘▘ ▝▝ ~/demo
Welcome to Opus 4.6
❯ @demo.txt Write any content into this file at will. This session will be
answered in English.
⎿ Read demo.txt (1 lines)
⏺ Done — I've written some content into demo.txt. Let me know if you'd like to
change anything in it.
✻ Churned for 33s
❯ What is the current working directory path?
⏺ The current working directory path is /tmp/cursor-proxy-2w643T.
! cat demo.txt
⎿ (No output)