Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问clear审计未展示

claude-oauth-refresherClaude OAuth refresher 搜索

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

13,945

周安装

397

GitHub Stars

公开资料未说明

下载量

4,778
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:claude-oauth-refresher(Claude OAuth refresher 搜索)
来源仓库:https://github.com/clawdbot/skills
仓库路径:skills/claude-oauth-refresher
安装命令:
npx skills add clawdbot/skills --skill "claude-oauth-refresher"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add clawdbot/skills --skill "claude-oauth-refresher"

简介

该技能专注于 OAuth 凭证管理与安全审计,协助排查认证流程中的潜在风险。

  • 可帮助 Agent 梳理敏感配置并识别依赖项的安全隐患。
  • 输出结果不可直接采信,尤其在涉及令牌或用户数据时需人工复核。
  • 安装前请确保已设置适当的操作边界与日志记录机制。
  • 推荐结合业务实际需求调整权限级别以避免过度授权。

SKILL.md

name
claude-oauth-refresher
description
Keep your Claude access token fresh 24/7. Automatically refreshes OAuth tokens before expiry so you never see authentication failures.

claude-oauth-refresher

Automatic OAuth token refresh for Claude Code CLI on macOS

Keep your Claude account logged in 24/7 by automatically refreshing OAuth tokens before they expire.


⚠️ Requirements

This skill is macOS-only and requires:

  1. macOS (uses Keychain for secure credential storage)
  2. Claude Code CLI already installed (claude command available)
  3. Already logged into your Claude account (run claude then login - stores tokens in Keychain)
  4. Clawdbot installed and running

Not sure if you're set up? Run the verification script:

./verify-setup.sh

What It Does

  • Monitors your Claude CLI token expiration
  • Refreshes tokens automatically before they expire (default: 30 min buffer)
  • Notifies you with three notification types:

- 🔄 Start: "Refreshing Claude token..." - ✅ Success: "Claude token refreshed!" - ❌ Failure: Detailed error with troubleshooting steps

  • Logs all refresh attempts for debugging

Installation

Quick Setup (Recommended)

cd ~/clawd/skills/claude-oauth-refresher
./install.sh

This installer runs ONCE and sets up automatic token refresh that runs every 2 hours.

The installer will:

  1. Verify your system meets requirements
  2. Interactively configure notification preferences
  3. Auto-detect your notification target (Telegram, Slack, etc.)
  4. Set up launchd for automatic refresh
  5. Test the refresh immediately

After installation:

  • Config changes apply automatically (refresh script reads config each run)
  • Edit claude-oauth-refresh-config.json to change settings
  • Ask Clawdbot to modify settings for you
  • Only re-run installer if you need to reinstall or fix the job

Interactive Notification Setup

During installation, you'll be prompted:

Configure Notifications:
💡 Recommendation: Keep all enabled for the first run to verify it works.
   You can disable them later by:
   1. Editing ~/clawd/claude-oauth-refresh-config.json
   2. Asking Clawdbot: "disable Claude refresh notifications"

Enable "🔄 Refreshing token..." notification? [Y/n]: 
Enable "✅ Token refreshed!" notification? [Y/n]: 
Enable "❌ Refresh failed" notification? [Y/n]: 

Recommendation: Keep all enabled initially to verify everything works, then disable start/success notifications once you're confident.


Managing Notifications with Clawdbot

You can ask Clawdbot to change notification settings for you! No need to edit JSON manually.

Examples

Disable specific notification types:

"disable Claude refresh start notifications"
"disable Claude refresh success notifications"
"turn off Claude token refresh start messages"

Enable notification types:

"enable Claude refresh start notifications"
"enable all Claude refresh notifications"
"turn on Claude token refresh success messages"

Check current settings:

"show Claude refresh notification settings"
"what are my Claude token refresh notification settings?"

Disable all notifications:

"disable all Claude refresh notifications"
"turn off all Claude token notifications"

Reset to defaults:

"reset Claude refresh notifications to defaults"

How It Works

Clawdbot will:

  1. Read your ~/clawd/claude-oauth-refresh-config.json
  2. Update the appropriate notification flags
  3. Save the file
  4. Confirm the changes

Changes apply immediately on the next refresh (no need to restart anything).


Auto-Detection (Smart Defaults)

The install script automatically detects your notification settings!

It reads ~/.clawdbot/clawdbot.json to find:

  • Which messaging channels you have enabled
  • Your chat ID, phone number, or user ID
  • Automatically populates claude-oauth-refresh-config.json with these values

Example: If you have Telegram enabled with chat ID 123456789, the installer creates:

{
  "notification_channel": "telegram",
  "notification_target": "123456789"
}

To override: Simply edit claude-oauth-refresh-config.json after installation to use a different channel or target.

If auto-detection fails: The installer will prompt you to configure manually (see "Finding Your Target ID" below).

Test detection before installing:

./test-detection.sh
# Shows what would be auto-detected without modifying anything

Finding Your Target ID

To receive notifications, you need to configure your notification_target in claude-oauth-refresh-config.json. Here's how to find it for each channel:

Telegram

Format: Numeric chat ID (e.g., 123456789)

How to find:

# Option 1: Use Clawdbot CLI
clawdbot message telegram account list

# Option 2: Message @userinfobot on Telegram
# Send any message, it will reply with your ID

# Option 3: Check recent messages
clawdbot message telegram message search --limit 1 --from-me true

Example config:

{
  "notification_channel": "telegram",
  "notification_target": "123456789"
}

Slack

Format:

  • Direct messages: user:U01234ABCD
  • Channels: channel:C01234ABCD

How to find:

# List channels
clawdbot message slack channel list

# Find user ID
clawdbot message slack user list | grep " [email protected] "

# Or click on your profile in Slack → More → Copy member ID

Example config:

{
  "notification_channel": "slack",
  "notification_target": "user:U01234ABCD"
}

Discord

Format:

  • Direct messages: user:123456789012345678
  • Channels: channel:123456789012345678

How to find:

# Enable Developer Mode in Discord (Settings → Advanced → Developer Mode)
# Then right-click your username → Copy ID

# Or list channels
clawdbot message discord channel list

Example config:

{
  "notification_channel": "discord",
  "notification_target": "user:123456789012345678"
}

WhatsApp

Format: E.164 phone number (e.g., +15551234567)

How to find:

  • Use your full phone number with country code
  • Format: +[country code][number] (no spaces, dashes, or parentheses)

Examples:

  • US: +15551234567
  • UK: +447911123456
  • Australia: +61412345678

Example config:

{
  "notification_channel": "whatsapp",
  "notification_target": "+15551234567"
}

iMessage

Format (preferred): chat_id:123

How to find:

# List recent chats to find your chat_id
clawdbot message imessage thread list --limit 10

# Find the chat with yourself or your preferred device

Alternative formats:

  • Phone: +15551234567 (E.164 format)
  • Email: [email protected]

Example config:

{
  "notification_channel": "imessage",
  "notification_target": "chat_id:123"
}

Signal

Format: E.164 phone number (e.g., +15551234567)

How to find:

  • Use your Signal-registered phone number
  • Format: +[country code][number] (no spaces, dashes, or parentheses)

Example config:

{
  "notification_channel": "signal",
  "notification_target": "+15551234567"
}

Configuration

File: claude-oauth-refresh-config.json

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

Options

OptionTypeDefaultDescription
refresh_buffer_minutesnumber30Refresh tokens this many minutes before expiry
log_filestring~/clawd/logs/claude-oauth-refresh.logWhere to write logs
notifications.on_startbooleantrueSend "🔄 Refreshing token..." notification
notifications.on_successbooleantrueSend "✅ Token refreshed!" notification
notifications.on_failurebooleantrueSend "❌ Refresh failed" notification with details
notification_channelstringtelegramChannel to use (see above for options)
notification_targetstringYOUR_CHAT_IDTarget ID (see "Finding Your Target ID")

Notification Types Explained

🔄 Start (on_start)

  • Sent when refresh process begins
  • Useful for debugging or knowing when refresh runs
  • Recommendation: Disable once you verify it works (can be noisy)

✅ Success (on_success)

  • Sent when token successfully refreshed
  • Includes validity duration (e.g., "valid for 24h")
  • Recommendation: Disable once you trust the setup (can be noisy)

❌ Failure (on_failure)

  • Sent when refresh fails with detailed error info
  • Includes troubleshooting steps based on error type
  • Recommendation: Keep enabled! You want to know about failures.

Example Configurations

Minimal (failures only):

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

Verbose (all notifications):

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

Silent (no notifications):

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

Detailed Failure Messages

When a refresh fails, you'll receive a detailed notification with:

  1. Error message - What went wrong
  2. Details - Additional context (HTTP codes, error responses, etc.)
  3. Troubleshooting - Specific steps based on the error type
  4. Help - Where to find logs and get support

Example Failure Notification

❌ Claude token refresh failed

Error: Network timeout connecting to auth.anthropic.com
Details: Connection timed out after 30s

Troubleshooting:
- Check your internet connection
- Verify you can reach auth.anthropic.com
- Try running manually: ~/clawd/skills/claude-oauth-refresher/refresh-token.sh

Need help? Message Clawdbot or check logs:
~/clawd/logs/claude-oauth-refresh.log

Common Errors and Solutions

Network/Timeout Errors

Troubleshooting:
- Check your internet connection
- Verify you can reach auth.anthropic.com
- Try running manually: ./refresh-token.sh

Invalid Refresh Token

Troubleshooting:
- Your refresh token may have expired
- Re-authenticate: claude auth logout && claude auth
- Verify Keychain access: security find-generic-password -s 'claude-cli-auth' -a 'default'

Keychain Access Denied

Troubleshooting:
- Check Keychain permissions
- Re-run authentication: claude auth
- Verify setup: ./verify-setup.sh

Missing Auth Profile

Troubleshooting:
- Run: claude auth
- Verify file exists: ~/.config/claude/auth-profiles.json
- Check file permissions: chmod 600 ~/.config/claude/auth-profiles.json

Usage

Check Status

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

# Check launchd status
launchctl list | grep claude-oauth-refresher

# Manual refresh (for testing)
cd ~/clawd/skills/claude-oauth-refresher
./refresh-token.sh

Modify Settings

Option 1: Ask Clawdbot (easiest)

"disable Claude refresh start notifications"
"show Claude refresh notification settings"

Option 2: Edit config file

nano ~/clawd/skills/claude-oauth-refresher/claude-oauth-refresh-config.json

Changes apply automatically on next refresh (every 2 hours, or when you run manually).

No need to restart anything! The refresh script reads the config file each time it runs.


Troubleshooting

Problem: verify-setup.sh says Claude CLI not found

Solution:

# Install Claude CLI
brew install claude

# Or download from https://github.com/anthropics/claude-cli

Problem: verify-setup.sh says no refresh token found

Solution:

# Authenticate with Claude
claude auth

# Follow the prompts to log in

Problem: Notifications not arriving

Solution:

  1. Check your notification_target format matches the examples above
  2. Test manually:
   clawdbot message [channel] send --target "[your_target]" --message "Test"
  1. Check Clawdbot is running: clawdbot gateway status
  2. Verify notification settings:
   cat ~/clawd/skills/claude-oauth-refresher/claude-oauth-refresh-config.json | jq .notifications

Problem: Token refresh fails with "invalid_grant"

Solution:

# Re-authenticate from scratch
claude auth logout
claude auth

# Test refresh again
cd ~/clawd/skills/claude-oauth-refresher
./refresh-token.sh

Problem: "Config file not found" after upgrade

Solution: The config file was renamed from config.json to claude-oauth-refresh-config.json.

# If you have an old config.json, run the installer to migrate:
cd ~/clawd/skills/claude-oauth-refresher
./install.sh
# Choose to keep existing config when prompted

Problem: Want to reinstall or fix the job

Solution:

# Re-run the installer (safe to run multiple times)
cd ~/clawd/skills/claude-oauth-refresher
./install.sh

The installer will:

  • Detect existing config and ask if you want to keep it
  • Update the launchd job
  • Test the refresh

Uninstall

cd ~/clawd/skills/claude-oauth-refresher
./uninstall.sh

This will:

  • Stop and unload the launchd service
  • Remove the plist file
  • Optionally delete logs and config

How It Works

  1. Installer (install.sh) - Run ONCE to set up:

- Auto-detects notification target - Interactively configures notification types - Creates launchd job - Tests refresh immediately

  1. Launchd - Runs refresh-token.sh every 2 hours automatically
  1. Refresh Script (refresh-token.sh) - Each run:

- Reads config file (changes apply automatically!) - Checks token expiration from ~/.config/claude/auth-profiles.json - If token expires within buffer window (default 30 min): - Sends start notification (if enabled) - Retrieves refresh token from Keychain - Calls OAuth endpoint to get new tokens - Updates auth profile and Keychain - Sends success notification (if enabled) - If refresh fails: - Sends detailed failure notification with troubleshooting - All activity logged to ~/clawd/logs/claude-oauth-refresh.log

  1. Config Changes - Applied automatically:

- Edit claude-oauth-refresh-config.json anytime - Ask Clawdbot to edit for you - Changes take effect on next refresh - No restart needed!


Security

  • Tokens are never written to logs or config files
  • Refresh tokens stored securely in macOS Keychain
  • Access tokens cached in ~/.config/claude/auth-profiles.json (permissions: 600)
  • All HTTP requests use Claude's official OAuth endpoints
  • Config file is world-readable (contains no secrets)

Support

Logs: ~/clawd/logs/claude-oauth-refresh.log

Issues:

  1. Run ./verify-setup.sh to diagnose
  2. Check logs for detailed error messages
  3. Test manual refresh: ./refresh-token.sh
  4. Check notification settings: cat claude-oauth-refresh-config.json | jq .notifications

Need help? Open an issue with:

  • Output of ./verify-setup.sh
  • Last 20 lines of logs: tail -20 ~/clawd/logs/claude-oauth-refresh.log
  • macOS version: sw_vers
  • Config (redacted): cat claude-oauth-refresh-config.json | jq 'del(.notification_target)'

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

windsurf

29.62%
按下载量换算1,415

Codex

23.59%
按下载量换算1,127

trae

16.45%
按下载量换算786

OpenCode

12.9%
按下载量换算616

Cursor

7.32%
按下载量换算350

Claude Code

3.64%
按下载量换算174

安全审计

暂无安全审计结果可展示。

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills