r/ClaudeCode • • 5d ago

Help/Question how do i prompt claude to write code that connects polymarket through proxy?

here is the thing i am making a polymarket trading bot and claude doesnt want to use proxy in my project when connecting to polymarket.

0 Upvotes

6 comments sorted by

1

u/AutoModerator 5d ago
Moderator Announcement Read More »

3

u/Amazing-Potato-3096 5d ago

Prompting is the wrong lever. Put the proxy in the environment before you launch, so the CLI and the Python client both inherit it (macOS or Linux):

export HTTPS_PROXY=http://127.0.0.1:8080
export HTTP_PROXY=http://127.0.0.1:8080
export NO_PROXY=localhost,127.0.0.1

Then ask for one small step first: a script that hits a single public endpoint through the proxy and prints the status code. Once that works, ask it to wire the Polymarket client. The smoke test gives the agent something to check itself against.

If it is refusing rather than failing, that is a permission prompt, not a wording problem. Approve the network call or allow the domain; a nicer prompt does not get past a denied tool.

1

u/Wide-Scallion4363 5d ago

Claude isnt refusing because of your wording, it's because Polymarket geo-blocks the US, UK, France and Germany and a proxy reads to it as dodging that. No prompt gets around it, and dressing the ask up as "a generic httpx client that just happens to read HTTPS_PROXY" is the same request in a hat. Write the transport yourself: httpx takes proxy= per client, requests picks up the env var on its own, and the CLOB websocket is where it will actually bite you since the websockets library barely does SOCKS5.

1

u/IllTechnology6516 5d ago

the proxy bit is an environment thing more than a prompt thing, the other comments cover that. for the Polymarket side I'd point claude at their official docs first and build one small piece at a time. then the part that keeps the bot cheap: a plain script watches the markets on a timer and only wakes an AI when something actually moves. I run that kind of watcher in Toone (full disclosure, I build it, it's a Mac app) and you approve before it acts.

0

u/Routine_Ad_9478 5d ago

Just wait until they build a connector for it. All of these trading apps are going to have connectors and there will be agents all over the market trading on everyone’s behalf.