Claude connect

From sundial-org/awesome-openclaw-skills · View interactive version

Claude connect is an AI agent skill from the GitHub repository sundial-org/awesome-openclaw-skills. Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.

How to use this skill

Skill file

claude-connect

Connect your Claude subscription to Clawdbot in one step.

Automatically:


Quick Start

1. Install the skill:

clawdhub install claude-connect
cd ~/clawd/skills/claude-connect

2. Ensure Claude CLI is logged in:

claude auth
# Follow the browser login flow

3. Run installer:

./install.sh

That's it! Tokens will refresh automatically every 2 hours.


What It Does

Fixes `clawdbot onboard` OAuth Bug

When you run clawdbot onboard --auth-choice claude-cli, it sometimes doesn't properly write OAuth tokens to auth-profiles.json.

This skill:

  1. Reads OAuth tokens from macOS Keychain (where Claude CLI stores them)
  2. Writes them to ~/.clawdbot/agents/main/agent/auth-profiles.json in proper OAuth format:

```json

{

"profiles": {

"anthropic:claude-cli": {

"type": "oauth",

"provider": "anthropic",

"access": "sk-ant-...",

"refresh": "sk-ant-ort...",

"expires": 1234567890

}

}

}

```

  1. Sets up auto-refresh (runs every 2 hours via launchd)
  2. Keeps your connection alive 24/7

Installation

Automatic (Recommended)

cd ~/clawd/skills/claude-connect
./install.sh

The installer will:

Manual

  1. Copy example config:

```bash

cp claude-oauth-refresh-config.example.json claude-oauth-refresh-config.json

```

  1. Edit config (optional):

```bash

nano claude-oauth-refresh-config.json

```

  1. Test refresh:

```bash

./refresh-token.sh --force

```

  1. Install launchd job (optional - for auto-refresh):

```bash

cp com.clawdbot.claude-oauth-refresher.plist ~/Library/LaunchAgents/

launchctl load ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist

```


Configuration

Edit claude-oauth-refresh-config.json:

{
  "refresh_buffer_minutes": 30,
  "log_file": "~/clawd/logs/claude-oauth-refresh.log",
  "notifications": {
    "on_success": true,
    "on_failure": true
  },
  "notification_target": "YOUR_CHAT_ID"
}

Options:


Usage

Manual Refresh

# Refresh now (even if not expired)
./refresh-token.sh --force

# Refresh only if needed
./refresh-token.sh

Check Status

# View recent logs
tail ~/clawd/logs/claude-oauth-refresh.log

# Check auth profile
cat ~/.clawdbot/agents/main/agent/auth-profiles.json | jq '.profiles."anthropic:claude-cli"'

# Check Clawdbot status
clawdbot models status

Disable Notifications

Ask Clawdbot:

Disable Claude refresh success notifications

Or edit config:

{
  "notifications": {
    "on_success": false,
    "on_failure": true
  }
}

How It Works

Refresh Process

  1. Read from Keychain: Gets OAuth tokens from Claude Code-credentials
  2. Check Expiry: Only refreshes if < 30 minutes left (or --force)
  3. Call OAuth API: Gets new access + refresh tokens
  4. Update auth-profiles.json: Writes proper OAuth format
  5. Update Keychain: Syncs new tokens back
  6. Restart Gateway: Picks up new tokens
  7. Notify: Sends success/failure message (optional)

Auto-Refresh (launchd)

Runs every 2 hours via ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist

Controls:

# Stop auto-refresh
launchctl unload ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist

# Start auto-refresh
launchctl load ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist

# Check if running
launchctl list | grep claude

Troubleshooting

OAuth not working after onboard

Symptom: clawdbot onboard --auth-choice claude-cli completes but Clawdbot can't use tokens

Fix:

cd ~/clawd/skills/claude-connect
./refresh-token.sh --force

This will write tokens in proper OAuth format.

Tokens keep expiring

Symptom: Auth keeps failing after 8 hours

Fix: Ensure launchd job is running:

launchctl load ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist
launchctl list | grep claude

No tokens in Keychain

Symptom: No 'Claude Code-credentials' entries found

Fix: Log in with Claude CLI:

claude auth
# Follow browser flow

Then run refresh again:

./refresh-token.sh --force

Uninstall

cd ~/clawd/skills/claude-connect
./uninstall.sh

Or manually:

# Stop auto-refresh
launchctl unload ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist
rm ~/Library/LaunchAgents/com.clawdbot.claude-oauth-refresher.plist

# Remove skill
rm -rf ~/clawd/skills/claude-connect

Upgrade

If you previously installed an older version:

cd ~/clawd/skills/claude-connect
./validate-update.sh  # Check what changed
clawdhub update claude-connect  # Update to latest
./install.sh  # Re-run installer if needed

See Also


Version: 1.1.0

Author: TunaIssaCoding

License: MIT

Repo: https://github.com/TunaIssaCoding/claude-connect

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.