Claude Connect
v1.1.0Connect Claude to Clawd机器人 instantly and keep it connected 24/7. 运行 after 设置up to link your subscription, then auto-refreshes 令牌s forever.
运行时依赖
安装命令
点击复制技能文档
claude-connect
Connect your Claude subscription to Clawd机器人 in one step.
Automatically:
✅ Reads Claude OAuth 令牌s from KeychAIn ✅ Writes them to Clawd机器人 in proper OAuth 格式化 ✅ Auto-refreshes every 2 hours (before expiry) ✅ Notifies you on 成功/失败 ✅ Works with clawd机器人 onboard (fixes OAuth auth-性能分析s bug) Quick 启动
- 安装 the 技能:
clawdhub 安装 claude-connect cd ~/clawd/技能s/claude-connect
- Ensure Claude 命令行工具 is 记录ged in:
claude auth # Follow the browser 记录in flow
- 运行 安装er:
./安装.sh
That's it! 令牌s will refresh automatically every 2 hours.
What It Does Fixes clawd机器人 onboard OAuth Bug
When you 运行 clawd机器人 onboard --auth-choice claude-命令行工具, it sometimes doesn't properly write OAuth 令牌s to auth-性能分析s.json.
This 技能:
Reads OAuth 令牌s from macOS KeychAIn (where Claude 命令行工具 stores them) Writes them to ~/.clawd机器人/代理s/mAIn/代理/auth-性能分析s.json in proper OAuth 格式化: { "性能分析s": { "anthropic:claude-命令行工具": { "type": "oauth", "提供者": "anthropic", "访问": "sk-ant-...", "refresh": "sk-ant-ort...", "expires": 1234567890 } } }
设置s up auto-refresh (运行s every 2 hours via launchd) Keeps your connection alive 24/7 安装ation Automatic (Recommended) cd ~/clawd/技能s/claude-connect ./安装.sh
The 安装er will:
✅ 验证 Claude 命令行工具 is 设置 up ✅ 创建 config file ✅ 设置 up auto-refresh job (launchd) ✅ 运行 first refresh to test Manual
Copy example config:
cp claude-oauth-refresh-config.example.json claude-oauth-refresh-config.json
Edit config (optional):
nano claude-oauth-refresh-config.json
Test refresh:
./refresh-令牌.sh --force
安装 launchd job (optional - for auto-refresh):
cp com.clawd机器人.claude-oauth-refresher.p列出 ~/库/Launch代理s/ launchctl load ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出
Configuration
Edit claude-oauth-refresh-config.json:
{ "refresh_buffer_minutes": 30, "记录_file": "~/clawd/记录s/claude-oauth-refresh.记录", "通知": { "on_成功": true, "on_失败": true }, "notification_tar获取": "YOUR_CHAT_ID" }
Options:
refresh_buffer_minutes: Refresh when 令牌 has this many minutes left (default: 30) 记录_file: Where to 记录 refresh activity 通知.on_成功: 通知 on 成功ful refresh (default: true) 通知.on_失败: 通知 on 失败 (default: true) notification_tar获取: Your Telegram chat ID (or leave empty to disable) Usage Manual Refresh # Refresh now (even if not expired) ./refresh-令牌.sh --force
# Refresh only if needed ./refresh-令牌.sh
检查 状态 # View recent 记录s tAIl ~/clawd/记录s/claude-oauth-refresh.记录
# 检查 auth 性能分析 cat ~/.clawd机器人/代理s/mAIn/代理/auth-性能分析s.json | jq '.性能分析s."anthropic:claude-命令行工具"'
# 检查 Clawd机器人 状态 clawd机器人 模型s 状态
Disable 通知
Ask Clawd机器人:
Disable Claude refresh 成功 通知
Or edit config:
{ "通知": { "on_成功": false, "on_失败": true } }
How It Works Refresh Process Read from KeychAIn: 获取s OAuth 令牌s from Claude Code-凭证s 检查 Expiry: Only refreshes if < 30 minutes left (or --force) Call OAuth API: 获取s new 访问 + refresh 令牌s 更新 auth-性能分析s.json: Writes proper OAuth 格式化 更新 KeychAIn: 同步s new 令牌s back Re启动 Gateway: Picks up new 令牌s 通知: 发送s 成功/失败 message (optional) Auto-Refresh (launchd)
运行s every 2 hours via ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出
Controls:
# 停止 auto-refresh launchctl unload ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出
# 启动 auto-refresh launchctl load ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出
# 检查 if 运行ning launchctl 列出 | grep claude
Troubleshooting OAuth not working after onboard
Symptom: clawd机器人 onboard --auth-choice claude-命令行工具 completes but Clawd机器人 can't use 令牌s
Fix:
cd ~/clawd/技能s/claude-connect ./refresh-令牌.sh --force
This will write 令牌s in proper OAuth 格式化.
令牌s keep expiring
Symptom: Auth keeps fAIling after 8 hours
Fix: Ensure launchd job is 运行ning:
launchctl load ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出 launchctl 列出 | grep claude
No 令牌s in KeychAIn
Symptom: No 'Claude Code-凭证s' entries found
Fix: 记录 in with Claude 命令行工具:
claude auth # Follow browser flow
Then 运行 refresh agAIn:
./refresh-令牌.sh --force
Un安装 cd ~/clawd/技能s/claude-connect ./un安装.sh
Or manually:
# 停止 auto-refresh launchctl unload ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出 rm ~/库/Launch代理s/com.clawd机器人.claude-oauth-refresher.p列出
# 移除 技能 rm -rf ~/clawd/技能s/claude-connect
升级
If you previously 安装ed an older version:
cd ~/clawd/技能s/claude-connect ./验证-更新.sh # 检查 what changed clawdhub 更新 claude-connect # 更新 to latest ./安装.sh # Re-运行 安装er if needed
See Also QUIC