TunaIssaCoding

Claude Connect

AI 智慧體v1.1.0
作者:TunaIssaCoding更新於 2026-05-18共 12 個版本 · 最新版本釋出於 2026-01-26claude-connect@clawhub_tunaissacoding/claude-connect
任務自動化工具呼叫

據 AlphaMoat 統計,截至 2026-10,Claude Connect 累計下載 9,787 次、獲 13 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 2,800 位,在「AI 智慧體」分類(1,632 個)中排名第 369 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
9787
星標
13
全站下載量排名
#2,800
全站前 26% · 「AI 智慧體」前 23%
平台累計下載星標評論
ClawHub ↗735413-
SkillHub ↗978713—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

功能:從 macOS Keychain 讀取 Claude CLI 儲存的 OAuth 令牌,以正確的 OAuth 格式寫入 ~/.clawdbot/agents/main/agent/auth-profiles.json(修復 clawdbot onboard 的 auth-profiles 問題),並經 launchd 每 2 小時自動重新整理(令牌剩餘不足 30 分鐘時重新整理,可 --force 強制)。配置項包括 refresh_buffer_minutes、log_file、成功/失敗通知與 Telegram 通知目標。重新整理流程共七步:讀 Keychain → 檢查過期 → 調 OAuth API → 更新 auth-profiles.json → 回寫 Keychain → 重啟閘道器 → 通知。注意:這是面向舊版 Clawdbot 設定的維護技能,若原生 onboarding 已夠用可優先用原生路徑,解除安裝用 ./uninstall.sh。

資料釋出於 2026-10-27

可以用來做什麼

  • 把 Claude 訂閱的 OAuth 令牌接入 Clawdbot
  • 配置每 2 小時的令牌自動重新整理與通知
  • 排查 onboard 後 OAuth 不生效或令牌頻繁過期問題

什麼時候用

  • 維護使用 Claude CLI OAuth 的舊版 Clawdbot 環境時
  • 需要自動重新整理 Claude OAuth 令牌時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

安裝 claude-connect 並驗證令牌重新整理
禁用 Claude 重新整理成功通知

月度資料趨勢

累計下載9787
586279701萬2026-05 · 累計下載 61532026-06 · 累計下載 63872026-07 · 累計下載 67722026-08 · 累計下載 69892026-09 · 累計下載 71542026-10 · 累計下載 978726-0526-0926-10
星標13
1213132026-05 · 星標 122026-06 · 星標 132026-07 · 星標 132026-08 · 星標 132026-09 · 星標 132026-10 · 星標 1326-0526-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-109787—13
2026-097154—13
2026-086989+3.2%13
2026-076772+6.0%13
2026-066387+3.8%13
2026-056153—12

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

6.0 KB · ClawHub v1.1.0
---
name: claude-connect
description: "Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever."
---

# claude-connect

**Connect your Claude subscription to Clawdbot in one step.**

Automatically:
展開全部(共 293 行)
- ✅ Reads Claude OAuth tokens from Keychain
- ✅ Writes them to Clawdbot in proper OAuth format
- ✅ Auto-refreshes every 2 hours (before expiry)
- ✅ Notifies you on success/failure
- ✅ Works with `clawdbot onboard` (fixes OAuth auth-profiles bug)

---

## Quick Start

**1. Install the skill:**
```bash
clawdhub install claude-connect
cd ~/clawd/skills/claude-connect
```

**2. Ensure Claude CLI is logged in:**
```bash
claude auth
# Follow the browser login flow
```

**3. Run installer:**
```bash
./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
       }
     }
   }
   ```
3. Sets up auto-refresh (runs every 2 hours via launchd)
4. Keeps your connection alive 24/7

---

## Installation

### Automatic (Recommended)

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

The installer will:
- ✅ Verify Claude CLI is set up
- ✅ Create config file
- ✅ Set up auto-refresh job (launchd)
- ✅ Run first refresh to test

### Manual

1. Copy example config:
   ```bash
   cp claude-oauth-refresh-config.example.json claude-oauth-refresh-config.json
   ```

2. Edit config (optional):
   ```bash
   nano claude-oauth-refresh-config.json
   ```

3. Test refresh:
   ```bash
   ./refresh-token.sh --force
   ```

4. 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`:

```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:**
- `refresh_buffer_minutes`: Refresh when token has this many minutes left (default: 30)
- `log_file`: Where to log refresh activity
- `notifications.on_success`: Notify on successful refresh (default: true)
- `notifications.on_failure`: Notify on failure (default: true)
- `notification_target`: Your Telegram chat ID (or leave empty to disable)

---

## Usage

### Manual Refresh

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

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

### Check Status

```bash
# 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:
```json
{
  "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:**
```bash
# 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:**
```bash
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:
```bash
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:
```bash
claude auth
# Follow browser flow
```

Then run refresh again:
```bash
./refresh-token.sh --force
```

---

## Uninstall

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

Or manually:
```bash
# 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:

```bash
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

- [QUICKSTART.md](QUICKSTART.md) - 60-second setup guide
- [UPGRADE.md](UPGRADE.md) - Upgrading from older versions
- [Clawdbot docs](https://docs.clawd.bot) - Model authentication

---

**Version:** 1.1.0  
**Author:** TunaIssaCoding  
**License:** MIT  
**Repo:** https://github.com/TunaIssaCoding/claude-connect

「AI 智慧體」分類下的熱門技能

TunaIssaCoding 的其他技能

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。