The claude-oauth-refresher skill has been updated with production-ready improvements focusing on better notifications, user experience, and maintainability.
Old: config.json
New: claude-oauth-refresh-config.json
Updated in:
- claude-oauth-refresh-config.example.json (new file)
- refresh-token.sh (reads new filename)
- install.sh (creates new filename, migrates old)
- verify-setup.sh (checks for both, suggests migration)
- uninstall.sh (removes both if present)
- SKILL.md (all references updated)
- QUICKSTART.md (all references updated)
- Removed old config.example.json
Migration: Automatic during install.sh
Changes:
- Updated install.sh header message explaining one-time setup
- Added prominent notice that config changes apply automatically
- Documented that only re-run installer to reinstall/fix
- Updated SKILL.md with clear workflow explanation
- Updated QUICKSTART.md with workflow clarification
User Experience:
This installer runs ONCE to set up automatic token refresh.
The refresh job will run every 2 hours in the background.
To change settings later:
1. Edit: ~/clawd/claude-oauth-refresh-config.json
2. Ask Clawdbot: "disable Claude refresh notifications"
3. Changes apply automatically - no need to re-run installer!
Old Structure:
{
"notify_on_success": false,
"notify_on_failure": true
}New Structure:
{
"notifications": {
"on_start": true, // "🔄 Refreshing Claude token..."
"on_success": true, // "✅ Claude token refreshed!"
"on_failure": true // "❌ Claude token refresh failed: [details]"
}
}Implementation:
- Updated config structure in example file
- Updated refresh-token.sh to read new structure
- Updated refresh-token.sh to send appropriate notifications
- Backward compatibility: falls back to defaults if config missing
- Migration logic in install.sh
Added to install.sh:
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]:
Features:
- Prompts for each notification type
- Defaults to Y (recommended for first run)
- Shows recommendation message
- Explains how to change later
- Creates config with user's preferences
- Shows summary after installation
Enhanced refresh-token.sh with:
- Context-specific error messages
- HTTP status code capture
- Network timeout detection (30s)
- Detailed troubleshooting based on error type
- Log file location in every failure message
- Common error patterns with specific solutions
Error Types with Custom Troubleshooting:
-
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
Example Full 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
Added comprehensive section to SKILL.md:
Examples:
- "disable Claude refresh start notifications"
- "disable Claude refresh success notifications"
- "enable all Claude refresh notifications"
- "show Claude refresh notification settings"
- "turn off all Claude token notifications"
- "reset Claude refresh notifications to defaults"
How It Works:
- User asks Clawdbot with natural language
- Clawdbot reads ~/clawd/claude-oauth-refresh-config.json
- Updates appropriate notification flags
- Saves file
- Confirms changes
- Changes apply automatically on next refresh
Documentation Includes:
- Examples section with common commands
- Explanation of how it works
- Note that changes apply immediately
- Referenced in multiple places (installation, config, usage)
refresh-token.sh:
- New config filename
- Three notification types
- Enhanced error handling
- Detailed failure messages
- Network timeout handling
- HTTP status code capture
- Context-specific troubleshooting
install.sh:
- Interactive notification prompts
- Auto-migration from old config
- New config filename
- One-time setup messaging
- Notification preference summary
- Better user guidance
verify-setup.sh:
- Checks for both old and new config
- Suggests migration if needed
- Better messaging
uninstall.sh:
- Removes both old and new configs
- Handles migration scenarios
Documentation:
- SKILL.md - Complete rewrite with all features
- QUICKSTART.md - Updated references
- README.md - Still accurate
- UPGRADE.md - New migration guide
- CHANGES.md - This file
claude-oauth-refresh-config.example.json- New config templateUPGRADE.md- Migration guide for existing usersCHANGES.md- This summary document
refresh-token.sh- Enhanced notifications and error handlinginstall.sh- Interactive setup and migrationverify-setup.sh- Config filename handlinguninstall.sh- Config cleanupSKILL.md- Complete documentation overhaulQUICKSTART.md- Updated references
config.example.json- Replaced with new filename
detect-notification-config.sh- Works as-istest-detection.sh- Works as-isREADME.md- No changes neededSUMMARY.md- Still accurateAUTO-DETECTION-FLOW.md- Still accurateDETECTION-EXAMPLES.md- Still accurate.gitignore- Still accurate
- Run
./test-detection.sh- auto-detection works - Run
./verify-setup.sh- all checks pass - Run
./install.sh- interactive prompts work - Config created with correct filename
- Config has new notification structure
- Manual refresh test works
- Launchd service loads
- Notifications arrive as configured
- Old config.json detected
- Migration prompt shown
- Old config migrated to new format
- Settings preserved (channel, target)
- Old file removed
- Service updated
- Manual refresh works with new config
- Edit config file directly - changes apply
- Disable on_start - no start notifications
- Disable on_success - no success notifications
- Enable all - all notifications arrive
- Invalid JSON - error logged, script continues with defaults
- Network timeout - detailed message sent
- Invalid token - re-auth steps provided
- Keychain error - permission steps provided
- Missing profile - setup steps provided
- Ask to disable notifications - config updated
- Ask to show settings - current config displayed
- Ask to enable all - all set to true
- No secrets in logs
- No secrets in config file
- Keychain for refresh tokens
- Secure OAuth endpoints
- Proper file permissions
- Error handling for all failure modes
- Automatic migration
- Backward compatible defaults
- Comprehensive logging
- User-friendly error messages
- Interactive setup
- Smart defaults
- Auto-detection
- Clear documentation
- Easy troubleshooting
- Clawdbot integration
- Clear code structure
- Comprehensive comments
- Migration path documented
- Upgrade guide provided
- Testing checklist
Action Required: Re-run installer for automatic migration Impact: 2 minutes to upgrade, smoother experience afterward Benefit: Better notifications, easier troubleshooting
Action Required: None beyond normal setup Impact: Enhanced experience from day one Benefit: Interactive setup, clear feedback
- ✅ SKILL.md - Complete reference
- ✅ QUICKSTART.md - Fast onboarding
- ✅ README.md - Overview
- ✅ UPGRADE.md - Migration guide
- ✅ Inline help in scripts
- ✅ CHANGES.md - This file
- ✅ Code comments
- ✅ Clear error messages
- ✅ Testing checklist
- Installation Success Rate: Interactive prompts reduce configuration errors
- Notification Relevance: Users can disable noisy notifications
- Troubleshooting Speed: Detailed errors reduce support burden
- Migration Success: Automatic migration prevents user frustration
- User Satisfaction: Clawdbot integration for hands-free control
Not in this release, but could add:
- Web dashboard for viewing refresh history
- Configurable refresh intervals per user
- Integration with other Claude CLI tools
- Metrics/analytics (success rate, etc.)
- Multiple notification targets
- Smart retry logic with exponential backoff
✅ All 7 requirements implemented ✅ Production-ready quality ✅ Comprehensive documentation ✅ Automatic migration path ✅ Enhanced user experience
Status: Ready for production use.
Installation: Run ./install.sh (fresh install or migration)