| name | token-wake |
| description | Wake the Claude Pro token window automatically — fires a bootstrap at reset+1min which creates a permanent 5h cron routine |
| metadata | {"phase":"setup","input":"none — fully automated"} |
token-loop
When to trigger
Use this skill when the user:
- explicitly invokes
/token-wake or asks to set up the token window wake routine
- asks to re-align or restart the Claude Pro 5-hour token window automation
Two routines are involved:
- Bootstrap (one-shot): fires at reset+1min, starts the window, creates the cron
- Cron (recurring): fires every 5h, just prints time — no self-scheduling needed
The skill sets up the bootstrap. Run it once per window cycle to re-align.
Step 1 — Get current time and reset time
Run in parallel (do not print the variables):
NOW_SGT=$(TZ='Asia/Singapore' date '+%Y-%m-%d %H:%M:%S SGT')
USAGE=$(claude /usage 2>&1 | grep "Current session")
Parse RESET_TIMESTR from usage: e.g. "Jul 2 at 12:00am"
Compute FIRE_UTC silently:
YEAR=$(date +%Y)
RESET_TS=$(TZ='Asia/Singapore' date -j -f "%b %d at %I:%M%p %Y" "${RESET_TIMESTR} ${YEAR}" +%s 2>/dev/null)
FIRE_TS=$((RESET_TS + 60))
[ "$FIRE_TS" -lt "$(date +%s)" ] && FIRE_TS=$((FIRE_TS + 86400))
FIRE_UTC=$(date -u -r $FIRE_TS +%Y-%m-%dT%H:%M:00Z)
FIRE_SGT=$(TZ='Asia/Singapore' date -r $FIRE_TS '+%b %d %H:%M SGT')
Step 2 — Check existing routines
RemoteTrigger action=list
Look for a routine named "Claude Pro Token Window Ping". Note its trigger_id.
Step 3 — Print summary
Print exactly:
SGT <NOW_SGT>
Bootstrap <trigger_id or "none"> → fires <FIRE_SGT>
Action <"update" | "create">
Step 4 — Create or update bootstrap
If exists — update run_once_at only:
RemoteTrigger action=update trigger_id=<id> body={"enabled": true, "run_once_at": "<FIRE_UTC>"}
If not — create it with the full body below.
Bootstrap body
{
"name": "Claude Pro Token Window Ping",
"run_once_at": "<FIRE_UTC>",
"enabled": true,
"job_config": {
"ccr": {
"environment_id": "env_013tHK5oryVJuXd9mWucJyCj",
"session_context": {
"model": "claude-haiku-4-5-20251001",
"sources": [],
"allowed_tools": ["Bash", "ToolSearch"]
},
"events": [{
"data": {
"uuid": "<fresh lowercase v4 UUID>",
"session_id"
Step 5 — Confirm
Print exactly:
Done https://claude.ai/code/routines/<trigger_id>
Notes
- Install:
npx skills add pdkproitf/skills@token-wake --global
- The bootstrap fires once at reset+1min, starts the window, then creates the cron
- The cron (
0 */5 * * * = SGT 8/13/18/23/4h) runs indefinitely with no dependencies
- Re-run
/token-loop each reset cycle to re-align the bootstrap
- To stop: https://claude.ai/code/routines