Pickle-Pixel

Claude Session Keepalive — Development skill for Claude Code

Development community

Self-scheduling keepalive for Claude Code's 5h rate-limit window.

How to install Claude Session Keepalive

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Pickle-Pixel/claude-session-keepalive and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Session Keepalive does

Self-scheduling keepalive for Claude Code's 5h rate-limit window. Reads the exact reset timestamp from the API and chains itself to the real timer.

Alternatives in Development

  • Claude Swap — Switch between multiple Claude Code accounts, with automatic rate-limit rotation, usage dashboard, and paralle 2k ★
  • 10 — Create a full-screen hero section with the following exact specifications 152 ★
  • 03 Scheduled Publishing — Add scheduled publishing: a third post status, 'scheduled', with a publish_at timestamp that turns 143 ★

README

Claude Session Keepalive

Automatically keeps the Claude Code 5-hour rate-limit window cycling so you never start a fresh window right when you sit down to work.

The Problem

Claude Code's rate limit works on a 5-hour window that starts counting from your first message. When the window expires, your usage resets to 0% — but the clock only starts again when you send the next message. If you sit down for a heavy session and trigger a fresh 5-hour window at that moment, you risk hitting 100% usage before the window resets.

The Solution

A self-scheduling keepalive that sends a single-character prompt, reads the exact window reset timestamp from the API response, and schedules its next run for that precise moment. No fixed cron interval — the script chains itself to the real timer.

Each ping costs a fraction of a percent in usage. By the time you sit down to work, the window is already partway through with near-zero usage consumed. You get full throughput, and the window resets sooner during your actual work session.

How It Works

  1. The script sends a minimal prompt via claude -p with --output-format stream-json
  2. The API response includes a rate_limit_event with a resetsAt Unix timestamp — the exact second the 5-hour window expires
  3. The script parses that timestamp and reschedules the Windows Task Scheduler task for that exact moment (plus a 10-second buffer)
  4. When the task fires, it repeats the cycle: send prompt, read new resetsAt, reschedule

The prompt itself:

claude -p "." --no-session-persistence --tools "" \
  --system-prompt "Reply with only a period." \
  --output-format stream-json --verbose
Flag Purpose
-p "." Non-interactive one-shot mode, single period as prompt
--no-session-persistence Don't save the throwaway session to disk
--tools "" Disable all tools
--system-prompt "Reply with only a period." Force minimal output (one token)
`--output-format stream