#How can I get clawdbot to use my Claude Max subscription on a Hetzner VPS

1 messages ยท Page 1 of 1 (latest)

open juniper
#

I've got Clawdbot installed on a Hetzner VPS. Trying to connet to my Claude Max subscription and everything claude tries doesn't work. What is the proper config file setup to allow this to work with the oauth token from Claude?

unborn saddleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> โœ… Mark Solution

viral pineBOT
# open juniper I've got Clawdbot installed on a Hetzner VPS. Trying to connet to my Claude Max...

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

  1. One-time sync:

    cd /path/to/clawdbot
    ./scripts/sync-claude-code-auth.sh
    
  2. 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! ๐ŸŽ‰

open juniper
viral pineBOT
# open juniper Is that correct from the comments and links in: https://github.com/clawdbot/cla...

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:

  1. 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

  2. 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)
  3. 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? ๐Ÿฆ

open juniper
viral pineBOT
# open juniper Um the PR is CLOSED so it's unlikley to get merged. Claude is running on my ma...

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:

  1. Use an Anthropic API key (recommended for VPS):

  2. If you MUST use OAuth:

    • Do the OAuth flow on your Mac (where you have a browser)
    • Copy ~/.clawdbot/credentials/oauth.json to 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! ๐Ÿฆ

open juniper
#

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

viral pineBOT
# open juniper I don't want to use API, I want to use oauth. clawdbot is not installed on my m...

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? ๐Ÿฆ

open juniper
#

sure

viral pineBOT
# open juniper sure

Step-by-step OAuth for your headless VPS:

On your Mac (5 min):

  1. Install Clawdbot:

    curl -fsSL https://clawd.bot/install.sh | bash
    
  2. Run OAuth configure:

    clawdbot configure --section anthropic
    

    This will open a browser for you to log in with your Claude Max account.

  3. 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/
  1. Verify on VPS:

    ssh user@your-hetzner-ip
    cat ~/.clawdbot/credentials/oauth.json  # Should show your tokens
    clawdbot status  # Should show Anthropic auth active
    
  2. (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! ๐Ÿฆ

open juniper
#

Bash(clawdbot configure --section anthropic)
โŽฟ ย Error: Exit code 1
Invalid --section: anthropic. Expected one of: workspace, model, web, gateway, daemon, channels, skills, health.

viral pineBOT
# open juniper Bash(clawdbot configure --section anthropic) ...

Just run clawdbot configure without flags โ€” it's interactive:

clawdbot configure

Then:

  1. Choose "Anthropic OAuth (Claude Pro/Max)" from the menu
  2. Follow the browser prompts to log in with your Claude Max account
  3. 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! ๐Ÿฆ

open juniper
#

โš ๏ธ 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"

viral pineBOT
#

# 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! ๐Ÿฆ

open juniper
#

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)

viral pineBOT
# open juniper which auth method should I use when doing the configure? Anthropic auth method ...

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:

  1. 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
  1. On your Mac (temporary Clawdbot install) or wherever you configure:

    clawdbot configure
    # Choose: Anthropic token (paste setup-token)
    # Paste the token
    
  2. 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! ๐Ÿฆ

open juniper
#

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
โ””

viral pineBOT
# open juniper thats what we did before for that didn't work. what shoudl I do here: ...

The configure wizard needs to run on your Mac (not the VPS) โ€” that's why it's not finding Keychain credentials.

Fix:

  1. 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
    
  2. Copy auth to VPS:

#
   scp ~/.clawdbot/agents/main/agent/auth-profiles.json user@vps:~/.clawdbot/agents/main/agent/
  1. 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? ๐Ÿฆ

open juniper
#

i am running oit on the mac

viral pineBOT
# open juniper 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. ๐Ÿฆ

open juniper
#

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

viral pineBOT
# open juniper different error in telegram now: โš ๏ธ Agent failed before reply: All models faile...

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! ๐Ÿฆ

open juniper
viral pineBOT
# open juniper 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! ๐Ÿฆ

open juniper
#

Finally got it to work. Here is a summary from Claude of what worked incase it helps you or others: