anthropic-token-refresh

Automate Anthropic Claude setup-token renewal for OpenClaw agents.

4|1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/jx1100370217/my-openclaw-skills --skill anthropic-token-refresh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: anthropic-token-refresh
Source: https://github.com/jx1100370217/my-openclaw-skills/tree/main/anthropic-token-refresh
Command: npx skills add https://github.com/jx1100370217/my-openclaw-skills --skill anthropic-token-refresh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) components.

What problem does it solve?

This skill automates the renewal of the Anthropic Claude setup-token before expiration for OpenClaw agents.

Core Features & Use Cases

  • Automated token refresh: Detects expiry and runs claude setup-token to obtain a new token via browser automation.
  • Seamless config update: Automatically updates auth-profiles.json with the new token and expiry time.
  • Use Case: Run daily checks to keep Claude access active for long-running agents without manual reauthentication.

Quick Start

  • Install Claude CLI and OpenClaw browser, and ensure jq is available.
  • Place this skill under anthropic-token-refresh with a scripts/ directory containing the provided scripts.
  • Run the expiry check: ./scripts/check-token-expiry.sh
  • If expiry is in less than 30 days, run the update flow: ./scripts/update-token.sh <new-token> and verify the update with openclaw models status.

Frequently Asked Questions about anthropic-token-refresh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate Claude setup-token refresh for long-running agents?

You can automate Claude setup-token refresh by running a script that detects token expiry and executes claude setup-token via browser automation to obtain a new token. The script then updates auth-profiles.json with the new token and expiry time to keep agent sessions alive without manual reauthentication.

Can I update auth-profiles.json automatically when my Claude token expires?

Yes, you can update auth-profiles.json automatically by running the token update flow. The script writes the new token and its expiry time directly into ~/.openclaw/agents/main/agent/auth-profiles.json, ensuring your OpenClaw agent configuration remains valid without manual file editing.

Do I need jq to refresh Anthropic Claude tokens for OpenClaw?

Yes, you need jq installed to parse and modify the JSON configuration files during the token refresh process. The skill also requires Claude CLI and the OpenClaw browser profile to execute the setup-token command and complete the automated authentication workflow.

How does automated token renewal work for Claude Max and Pro subscriptions?

Automated token renewal for Claude Max and Pro subscriptions works by checking the current token expiry date. If expiry is within 30 days, the script triggers the claude setup-token command to fetch a fresh token via browser automation and updates the local configuration file.

Why does my OpenClaw agent lose its Claude session before the token expires?

OpenClaw agents lose their Claude session when the setup-token expires without being renewed. Running a daily expiry check script detects the approaching expiration and executes the renewal flow beforehand to maintain continuous agent access.