-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Description
When configuring Claude Code to use cursor-api-proxy as the API endpoint, the agent cannot respond in a normal conversational manner. Instead, it repeatedly invokes tools (e.g., Read) to access local files.
Steps to Reproduce
- Configure Claude Code to use cursor-api-proxy as the API proxy
- Send the agent a message (e.g., ask it to complete a task based on context already provided)
- Observe that the agent does not reply directly but instead repeatedly calls the
Readtool
Expected Behavior
The agent should respond conversationally based on the user's message and any context already available, without forcing file system access.
Actual Behavior
The agent repeatedly calls the Read tool (e.g., Read tool with file_path: ...), even when:
- The workspace is empty (the proxy cannot access the original file system)
- Sufficient context has already been provided in the user's message
The agent ends up outputting duplicate content (e.g., repeating "Let me read the file..." multiple times) and fails to produce a useful response.
Possible Cause
cursor-api-proxy likely preserves the Claude Code system prompt when forwarding requests. This system prompt contains instructions that force the agent to use tools before responding (e.g., "You MUST use the Read tool at least once before editing"). In the proxy scenario, these tool calls cannot execute properly, causing the agent to loop.
Suggestions:
- Consider adapting or stripping the system prompt when forwarding requests
- Ensure tool call responses are properly formatted so the agent can gracefully handle tool call failures
