This morning I woke up to all 6 of my AI Agents running perfectly — for the first time without me touching anything.


That's new.
I run @openclaw with Claude Max on Mac Mini, and Anthropic's OAuth access tokens expire every 8 hours. When they do, every agent goes silent. For weeks I was manually regenerating setup tokens 2-3 times a day.
A few days ago I was reminded by one friend that I could have more solutions.
Here's what I built:
1/ Claude Code stores a refresh token in macOS Keychain alongside an expiresAt field
2/ The trick: Claude Code won't refresh a token that isn't expired yet — so you have to force it
3/ My macOs launchd job runs every 6 hours, sets expiresAt to the past in Keychain, then calls Claude to trigger the OAuth refresh flow silently
4/ The new token gets extracted and synced to all 6 agents automatically
5/ Gateway restarts. If anything fails, I get a notification.
The whole thing runs on my Mac Mini while I sleep.
The Keychain expiresAt manipulation is the non-obvious part — everything else is just scripting around it.
Honestly this is the most comfortable moment I've felt in a long time.
This may or may not apply to you but I'm really happy to automate more workflows.
post-image
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments
  • Pin