Queued/scheduled sessions and auto-continue on usage reset#95
Merged
Conversation
Adds two related affordances around Claude usage limits: 1. Schedule a session for later — pick a time (the dialog pre-fills from your next 5h reset), enter a custom prompt, and it sits in a "Scheduled" sidebar panel until fire time. At fire time the worktree, branch, and agent are spun up automatically, with the prompt piped into claude via heredoc so it's bulletproof; claude's existing auto-restart then drops you back into `claude --resume` so you can keep chatting. Doesn't yank your view to the new session. 2. Auto-continue on usage reset — when an active session's 5h window crosses 95%, surface a toast (or, with a setting toggled on, queue silently) that lines up "continue" to fire ~1 minute after reset. The in-session chip shows the queued message + cancel. Tested with 39 unit tests + 5 Playwright e2e tests. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # src/renderer/components/layout/SessionSidebar.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related affordances around Claude usage limits:
claude --resumeso you can keep chatting. Doesn't yank your view to the new session.continueto fire ~1 minute after reset. The in-session chip shows the queued message + cancel.Both queue items persist via electron-store, so a closed app picks them up on next launch (with a 2.5 s renderer-ready buffer for past-due items).
Test plan
scheduleTime,schedulerStore,scheduler.service,useSchedulerBootstrap,writeWhenReadyNotes
>-detection-then-write injection path (used by manually-created sessions with a preset startup prompt) is unchanged — it's still the path startup prompts use. The queued-fire path uses a new IPCscheduler:spawn-agent-with-promptthat pipes the prompt via heredoc, which is more reliable in the queued context where the renderer subscribe-to-data timing is racy.🤖 Generated with Claude Code