Connecting Claude Code Subscription to OpenClaw
Step-by-step guide: how to connect your Claude Code subscription (Max/Team) to OpenClaw via a proxy bridge. Works on any VPS.
What Changed
On April 4, Anthropic banned the use of OAuth tokens for third-party services. Now the connection goes through a proxy bridge — Claude CLI authorizes on the server, and OpenClaw communicates with it via a local API.
Requirements
1Create clawuser
Create a separate user for secure Claude CLI operation:
useradd -m clawuser mkdir -p /home/clawuser/.config chown -R clawuser:clawuser /home/clawuser/ echo "clawuser ALL=(ALL) NOPASSWD:ALL" | tee /etc/sudoers.d/clawuser
2Authorize Claude CLI
Log in to Claude as the new user. A link will appear in terminal — open in browser, authorize, paste the code:
sudo -u clawuser claude login # Verify: sudo -u clawuser claude --version
3Set up proxy server (bridge)
Install the proxy that connects OpenClaw to Claude CLI:
npm install -g proxy-acpx-x chmod -R 777 /usr/lib/node_modules/proxy-acpx-x/ # Create systemd service, start, enable systemctl daemon-reload && systemctl enable claude-proxy && systemctl start claude-proxy
4Configure OpenClaw
Connect the proxy as a model provider in OpenClaw:
openclaw config set models.providers.claude-local '...' --strict-json chown -R clawuser:clawuser /root/.openclaw/workspace/ openclaw config set agents.defaults.model claude-local/claude-code-proxy
5Launch and test
Restart gateway and test in Telegram:
openclaw gateway stop && openclaw gateway start
Verification
If the bot responds in Telegram and can create files — everything works. Cost: €0 on top of your Claude subscription.
Security
The proxy only runs on localhost (127.0.0.1:52088). Not accessible externally. All requests go through Claude CLI with your authorization.
6 Pitfalls We Stepped On
1Wall of blood — HTTP 429 rate_limit_error
Symptoms: Bot spams red error text about exhausted limits, even though you have a Pro/Max subscription.
Cause: You're using the old auth method (API token) or an old free account is still in your config.
Fix: Remove the old provider completely and set up the local proxy bridge.
openclaw config unset models.providers.anthropic
2Permission denied creating folders and users
Symptoms: You run useradd or mkdir and Linux slaps your hand: access denied.
Cause: You're logged in as a regular user but trying to modify system files.
Fix: Always use sudo for system commands. To create folders in the new user's home — switch to them first.
sudo useradd -m clawuser sudo su - clawuser
3Munchausen trick with Sudo rights
Symptoms: You switched to clawuser and try to grant sudo. Error: clawuser is not in the sudoers file.
Cause: You're trying to grant admin rights from a user that doesn't HAVE admin rights.
Fix: Go back to the main user (exit) and grant rights from there.
echo "clawuser ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/clawuser
4Ghost in the machine — claude: command not found
Symptoms: Logged in as clawuser, try claude login — terminal says command not found.
Cause: Claude CLI was installed locally for the first user only. New user is completely bare.
Fix: Install CLI globally on the server.
sudo npm install -g @anthropic-ai/claude-code
5Claude got too smart — Login command error
Symptoms: You type claude login, and the bot asks: where do you want to log in? GitHub? AWS?
Cause: Anthropic updated the CLI. The word login no longer works as an external argument.
Fix: Run claude, then inside the chat type /login.
claude # Inside chat: /login
6Illusion of victory in Telegram
Symptoms: Everything set up, proxy is green. Bot responds in TG but uses the wrong model (e.g. gpt-5.4).
Cause: Telegram agents didn't pick up new OpenClaw defaults and stayed on fallback models.
Fix: Force-switch the model via chat command.
/model claude-local/claude-code-proxy
Need help setting up?
We set up OpenClaw turnkey: installation, configuration, subscription connection, training. Everything works in 1 day.