#How can I get clawdbot to use my Claude Max subscription on a Hetzner VPS
1 messages ยท Page 1 of 1 (latest)
Hey TonyD! ๐ฆ
Got it โ you're running into the Claude Code OAuth collision issue. Both Clawdbot and Claude Code use the same client_id for Anthropic Max, so when Claude Code refreshes its tokens, it invalidates Clawdbot's refresh token โ invalid_grant errors.
Solution: Sync script + cron job
-
One-time sync:
cd /path/to/clawdbot ./scripts/sync-claude-code-auth.sh -
Set up automatic sync every 30 minutes:
(crontab -l 2>/dev/null; echo "*/30 * * * * /path/to/clawdbot/scripts/sync-claude-code-auth.sh --cron >> /tmp/clawdbot-auth-sync.log 2>&1") | crontab -
Why this happens: Both tools use the same OAuth client (9d1c250a-e61b-44d9-88ed-5944d1962f5e). Claude Code "wins" the refresh battle, so Clawdbot piggybacks on its tokens.
Docs: https://github.com/clawdbot/clawdbot/pull/390
Let me know if that gets you unstuck! ๐
Is that correct from the comments and links in: https://github.com/clawdbot/clawdbot/pull/390
Correction: PR #390 is not yet merged โ the sync script and docs don't exist in main yet.
You're early to the party! ๐
Your options right now:
-
Wait for the PR to merge (track it at https://github.com/clawdbot/clawdbot/pull/390) โ once merged, the script will be at
scripts/sync-claude-code-auth.sh -
Manually sync tokens in the meantime:
- Claude Code stores tokens at
~/.claude-code/ - Clawdbot uses
~/.config/clawdbot/(or wherever your config is) - Copy the Anthropic auth file from Claude Code's location to Clawdbot's
- Repeat whenever Claude Code refreshes (every ~30-60 min)
- Claude Code stores tokens at
-
Run Claude Code + Clawdbot on different machines (avoid collision entirely)
The PR looks solid and should land soon. Want me to ping you when it merges? ๐ฆ
Um the PR is CLOSED so it's unlikley to get merged. Claude is running on my mac, Clawdbot is running on a hetzner vps in another country enterily, so they are different machines. Can you find a newer working solution?
Found the issue! The docs recommend using an Anthropic API key instead of OAuth for headless VPS setups:
"For Anthropic we recommend an API key; claude setup-token is also supported."
Your options:
-
Use an Anthropic API key (recommended for VPS):
- Get one from https://console.anthropic.com/
- Run:
clawdbot configure --section anthropic - Or set env var:
ANTHROPIC_API_KEY=your-key
-
If you MUST use OAuth:
- Do the OAuth flow on your Mac (where you have a browser)
- Copy
~/.clawdbot/credentials/oauth.jsonto your Hetzner VPS at the same location - This is what the docs call the "Headless/server tip"
Why OAuth is painful on VPS:
- No browser for the OAuth callback flow
- Token refresh issues (even without Claude Code collisions)
- API keys are simpler and more reliable for server deployments
I'd go with option 1 โ just grab an API key from Anthropic's console and plug it in. Much cleaner for a headless setup! ๐ฆ
I don't want to use API, I want to use oauth. clawdbot is not installed on my mac, it's on the VPS. so there is no ~/.clawdbot/credentials/oauth.json on the mac
Got it โ you need OAuth on a headless server. Here are your real options:
Option 1: Temporary Mac install (easiest)
# On your Mac
curl -fsSL https://clawd.bot/install.sh | bash
clawdbot configure --section anthropic # Does OAuth flow
# Copy the file to VPS
scp ~/.clawdbot/credentials/oauth.json user@hetzner-vps:~/.clawdbot/credentials/
# Uninstall from Mac if you want
Option 2: SSH tunnel + local browser
# On Mac: SSH into VPS with port forwarding
ssh -L 8080:localhost:8080 user@hetzner-vps
# On VPS: Start the OAuth server
clawdbot configure --section anthropic --port 8080
# Complete OAuth on your Mac at http://localhost:8080/callback
Option 3: claude setup-token (if it works)
Some versions support:
clawdbot configure --section anthropic --headless
# Or check: clawdbot configure --help
I'd recommend Option 1 โ quick install on Mac, do OAuth once, copy the file, done. Takes 5 min.
Want me to walk you through it? ๐ฆ
sure
Step-by-step OAuth for your headless VPS:
On your Mac (5 min):
-
Install Clawdbot:
curl -fsSL https://clawd.bot/install.sh | bash -
Run OAuth configure:
clawdbot configure --section anthropicThis will open a browser for you to log in with your Claude Max account.
-
Copy the OAuth file to your VPS:
# Replace user@your-hetzner-ip with your actual VPS credentials
scp ~/.clawdbot/credentials/oauth.json user@your-hetzner-ip:~/.clawdbot/credentials/
-
Verify on VPS:
ssh user@your-hetzner-ip cat ~/.clawdbot/credentials/oauth.json # Should show your tokens clawdbot status # Should show Anthropic auth active -
(Optional) Uninstall from Mac if you want it clean:
rm -rf ~/.clawdbot
That's it! Once the file is on the VPS, Clawdbot will use your Claude Max OAuth.
Let me know when you've copied the file and I'll help you verify it's working! ๐ฆ
Bash(clawdbot configure --section anthropic)
โฟ ย Error: Exit code 1
Invalid --section: anthropic. Expected one of: workspace, model, web, gateway, daemon, channels, skills, health.
Just run clawdbot configure without flags โ it's interactive:
clawdbot configure
Then:
- Choose "Anthropic OAuth (Claude Pro/Max)" from the menu
- Follow the browser prompts to log in with your Claude Max account
- Once complete, copy the file to your VPS:
scp ~/.clawdbot/credentials/oauth.json user@your-hetzner-ip:~/.clawdbot/credentials/
The interactive wizard has options that the --section flag doesn't expose. Let me know how it goes! ๐ฆ
โ ๏ธ Agent failed before reply: No API key found for provider "anthropic". Auth store: โ
/home/node/.clawdbot/agents/main/agent/auth-profiles.json (agentDir: /home/node/.clawdbot/agents/main/agent). Configure auth
for this agent (clawdbot agents add <id>) or copy auth-profiles.json from the main agentDir.
Logs: clawdbot logs --follow
โบ The runtime validation is rejecting the token. Let me check if there's a different auth structure needed. The error says "copy
auth-profiles.json from the main agentDir"
The issue: You copied oauth.json but Clawdbot needs auth-profiles.json. Run this on your VPS:
clawdbot doctor
This should sync your OAuth credentials into the proper format at:
~/.clawdbot/agents/main/agent/auth-profiles.json
If that doesn't work, try manually syncing:
# Check what's in your oauth.json
cat ~/.clawdbot/credentials/oauth.json
# Force a sync
clawdbot models status
# Check if auth profile was created
cat ~/.clawdbot/agents/main/agent/auth-profiles.json
Still stuck? You can paste a setup-token directly:
# On your Mac with Claude Code
claude setup-token
# Copy the token string
# On VPS
clawdbot models auth paste-token --provider anthropic
# Paste the token when prompted
The doctor command is designed to handle this exact scenario. Let me know what clawdbot doctor outputs! ๐ฆ
which auth method should I use when doing the configure? Anthropic auth method
โ โ Anthropic token (paste setup-token)
โ โ Anthropic token (Claude Code CLI) (reuses existing Claude Code auth ยท requires Keychain access)
Choose: โ Anthropic token (paste setup-token)
Here's why:
-
Option 1 (paste setup-token) โ You generate the token on your Mac, copy it, paste into Clawdbot. Works anywhere.
-
Option 2 (Claude Code CLI) โ Requires Keychain access, which you don't have on a headless VPS.
Steps:
- On your Mac:
# Install Claude Code if needed curl -fsSL https://claude.com/claude-code.sh | bash # Generate the token
claude setup-token
# Copy the token string it outputs
-
On your Mac (temporary Clawdbot install) or wherever you configure:
clawdbot configure # Choose: Anthropic token (paste setup-token) # Paste the token -
Copy to VPS:
scp ~/.clawdbot/agents/main/agent/auth-profiles.json user@vps:~/.clawdbot/agents/main/agent/
That's the cleanest path for a headless VPS! ๐ฆ
thats what we did before for that didn't work. what shoudl I do here:
Store this token securely. You won't be able to see it again.
Use this token by setting: export CLAUDE_CODE_OAUTH_TOKEN=<token>
โ
โ Claude Code CLI OAuth โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ No Claude Code CLI credentials found in Keychain ("Claude Code-credentials") or โ
โ ~/.claude/.credentials.json. โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โ
โ Anthropic OAuth models
โ โป anthropic/claude-haiku-4-5
โ โผ anthropic/claude-opus-4-5 (Claude Opus 4.5 (latest) ยท ctx 195k ยท reasoning ยท auth missing)
โ โป anthropic/claude-sonnet-4-5
โ
The configure wizard needs to run on your Mac (not the VPS) โ that's why it's not finding Keychain credentials.
Fix:
-
On your Mac:
# Install Clawdbot temporarily curl -fsSL https://clawd.bot/install.sh | bash # Run configure (will find Keychain/Claude Code auth) clawdbot configure # Choose Anthropic token (Claude Code CLI) or let it auto-detect -
Copy auth to VPS:
scp ~/.clawdbot/agents/main/agent/auth-profiles.json user@vps:~/.clawdbot/agents/main/agent/
- Verify on VPS:
ssh user@vps cat ~/.clawdbot/agents/main/agent/auth-profiles.json clawdbot models status
Or the simpler alternative: Just use an API key on the VPS:
# On VPS
export ANTHROPIC_API_KEY="your-api-key-from-console.anthropic.com"
clawdbot models status
API keys are much cleaner for headless VPS setups. No OAuth, no token syncing, just works.
Your call โ which path do you prefer? ๐ฆ
i am running oit on the mac
Then you need to install Claude Code CLI on your Mac first:
# Install Claude Code CLI
curl -fsSL https://claude.com/claude-code.sh | bash
# Log in (sets up Keychain credentials)
claude login
# Now run configure - it will find the credentials
clawdbot configure
Or skip the login and just generate a setup-token:
claude setup-token
# Copy the token
clawdbot configure
# Choose: Anthropic token (paste setup-token)
# Paste the token
Either approach works. The CLI just needs Claude Code installed + authenticated first. ๐ฆ
different error in telegram now: โ ๏ธ Agent failed before reply: All models failed (3): anthropic/claude-opus-4-5: No API key found for provider "anthropic". Auth store: /home/node/.clawdbot/agents/main/agent/auth-profiles.json (agentDir: /home/node/.clawdbot/agents/main/agent). Configure auth for this agent (clawdbot agents add <id>) or copy auth-profiles.json from the main agentDir. (auth) | anthropic/claude-haiku-4-5: No API key found for provider "anthropic". Auth store: /home/node/.clawdbot/agents/main/agent/auth-profiles.json (agentDir: /home/node/.clawdbot/agents/main/agent). Configure auth for this agent (clawdbot agents add <id>) or copy auth-profiles.json from the main agentDir. (auth) | anthropic/claude-sonnet-4-5: No API key found for provider "anthropic". Auth store: /home/node/.clawdbot/agents/main/agent/auth-profiles.json (agentDir: /home/node/.clawdbot/agents/main/agent). Configure auth for this agent (clawdbot agents add <id>) or copy auth-profiles.json from the main agentDir. (auth).
Logs: clawdbot logs --follow
Check what's actually in your auth-profiles.json on the VPS:
ssh user@vps
cat ~/.clawdbot/agents/main/agent/auth-profiles.json
What does it show? Look for an entry with "anthropic" as the provider.
Also check if there's a credentials file:
ls -la ~/.clawdbot/credentials/
cat ~/.clawdbot/credentials/oauth.json # if it exists
The error says the file exists but doesn't have anthropic credentials. We need to see what's actually in there to debug.
Quick fix โ force re-sync on Mac:
# On Mac
clawdbot doctor
clawdbot models status
# Then copy again
scp ~/.clawdbot/agents/main/agent/auth-profiles.json user@vps:~/.clawdbot/agents/main/agent/
# On VPS
clawdbot gateway restart
clawdbot models status
Paste the contents of the auth-profiles.json here (redact any tokens) and I'll tell you what's wrong! ๐ฆ
here is the output
The file looks correct! You have a valid anthropic profile. The issue is probably one of these:
1. Restart the gateway on VPS:
ssh user@vps
clawdbot gateway restart
clawdbot models status
2. Check which agent/config it's actually using:
clawdbot status --all
3. Check permissions:
ls -la ~/.clawdbot/agents/main/agent/auth-profiles.json
4. Force a re-read:
clawdbot doctor
clawdbot models status
Try step 1 first โ the gateway might not have picked up the new file. Let me know what clawdbot models status shows after restart! ๐ฆ
Finally got it to work. Here is a summary from Claude of what worked incase it helps you or others: