Your Claude Code session hit its limit at 2 a.m. — and resumed itself by morning.
Auto-resume Claude Code when your usage limit resets, with a live web dashboard you can drive from your phone.
The problem
You give Claude Code a long task and walk away. Twenty minutes in, it stops:
You've hit your limit · resets 2:30am
The quota comes back at 2:30 — but you're asleep. The work just sits there until you come back, notice it stalled, and press continue. Hours wasted for nothing.
The fix
cc-autoresume watches your Claude Code transcripts on disk, catches that limit message, parses the reset time, and the moment quota returns it resumes the session for you:
claude -p "<your continue message>" --resume <session-id>
Set it once and walk away. It's a single static Rust binary — no Python, no venv, no runtime to install — plus a live web dashboard so you can see and steer everything (even from your phone on the same Wi-Fi).
Highlights
auto (just do it), ask (wait for your OK), off (notify only) — set globally, per-project, or per-session.Screenshots
Light themePhone
Pending resumes count down on animated rings; active sessions show a friendly title (their first prompt) instead of a raw UUID.
Install (macOS)
git clone [email protected]:cuongdev/cc-autoresume.git
cd cc-autoresume
./install.sh # builds the release binary, installs to ~/.local/bin, loads the LaunchAgent
install.sh builds, drops cc-autoresume into ~/.local/bin, and registers a LaunchAgent so the watcher + dashboard run at login. Then open the dashboard:
cc-autoresume dashboard # prints http://<lan-ip>:7317/?token=...
💤 Want it to wake a sleeping Mac exactly at reset time? install.sh prints an optional one-line sudoers entry for pmset. Skip it and the resume simply fires on the next wake.
CLI
Everything in the dashboard is also a command — use whichever you like.
CommandWhat it doescc-autoresume dashboardprint the tokenized dashboard URLcc-autoresume mode auto|ask|offset the global modecc-autoresume msg "<text>"set the global resume messagecc-autoresume list / statuslist pending resumescc-autoresume cancel [prefix]cancel one (by id prefix) or allcc-autoresume arm <prefix>confirm an ask-mode resumecc-autoresume fire <id>resume a session right nowcc-autoresume token [--rotate]print / rotate the dashboard tokencc-autoresume watchrun the daemon + dashboard (used by the LaunchAgent)
How it works
~/.claude/projects/**/*.jsonl (Claude Code transcripts)
│ tail (watcher, every 20s)
▼
detect "limit · resets <time>" → parse reset time → arm a pending resume
│ (per-session preset → per-project → global)
▼ at reset (best-effort pmset wake)
liveness check (lsof) → claude -p "<msg>" --resume <id> → backoff if still limited
The resume runs through a login shell so the revived session inherits your real PATH (Node-based hooks and friends keep working). State lives in ~/.claude/auto-resume/: config.json, pending/<id>.json, stats.json, sessions.json.
Configuration
~/.claude/auto-resume/config.json (camelCase):
KeyMeaningmodeauto / ask / offdefaultMessageglobal resume messageforceHeadlessresume in the background even if the old window is still openbackoff{ everySec, maxAttempts } retry policy when quota isn't fully backperProjectper-directory mode/message overridesportdashboard port (default 7317)tokendashboard access token (auto-generated)
Per-session presets live in sessions.json.
Security
The dashboard binds 0.0.0.0 (so your phone on the same Wi-Fi can reach it) and is guarded by a random bearer token over plain HTTP. Anyone with the token on your network can control resumes — which run claude — so use it on a trusted LAN and rotate the token from ⚙ Settings if it leaks. No TLS (out of scope). cc-autoresume never stores or transmits your Claude credentials; it only shells out to the claude CLI you already use.
Limitations
pmset + osascript notifications. Linux would need systemd + rtcwake + notify-send.sudoers entry; otherwise the resume fires on the next wake.Development
cargo test # unit + integration tests
cargo clippy --all-targets # lints
cargo build --release # static binary at target/release/cc-autoresume
The dashboard is a single src/web/index.html (vanilla JS, no build step) embedded into the binary at compile time via include_str!.
No talks yet. Create the first talk

Auto-resume Claude Code when your usage limit resets — single static R

One Key. Every LLMs. Ship Faster. Claude Code Ready.

Thiết kế chi tiết cơ khí 3D tham số và chuẩn bị in 3D, mã nguồn mở

Hệ sinh thái để khám phá, phát triển và thương mại hóa các extension

UI/Web Feedback for Claude Code, Codex, Cursor and any Coding Agents

Organize and export ChatGPT, Claude & Gemini chats
Biến mọi website thành file ZIP chỉ với 1 click 🔥
No reviews yet
Reviews & comments