Automating Claude Session Restarts with tmux and at

Running out of Claude usage at inconvenient times, like 1am, wastes hours of potential work. One user on r/ClaudeAI shared a practical solution using tmux and at to automatically restart the session at a specific time.
Basic Setup
Install both tools if you haven't already:
# macOS
brew install at
# Debian/Ubuntu
sudo apt install at
Key Commands
The approach uses at to schedule a command that sends Ctrl+C to stop the current Claude process, then a continue (or claude) command to restart it.
Simple one-session version (no named tmux session):
echo "tmux send-keys C-c; tmux send-keys continue ENTER" | at now + 290 minutes
Named session version (session named 'claude'):
echo "tmux send-keys -t claude C-c; tmux send-keys -t claude 'claude' Enter" | at 23:30
echo "tmux send-keys -t claude C-c; tmux send-keys -t claude 'claude' Enter" | at now+239 minutes
Notes
- Adjust the time offset to match when your usage resets.
- If you only have one tmux session, you can omit
-t claude. - The commands assume your tmux session is named
claude.
This technique eliminates the need to manually restart at odd hours, giving you a full night of productive Claude time.
📖 Read the full source: r/ClaudeAI
👀 See Also

Claude User Shares 'Don't Manage My Feelings' Prompt for Direct Technical Feedback
A Claude user recommends setting a specific prompt in user preferences to reduce validation preamble and get more direct technical feedback. The prompt tells Claude to skip diplomatic phrasing and provide straightforward criticism on technical and creative work.

How to Cut OpenClaw Agent Costs by 80% with Model Switching
A user tracked token usage for 14 days and found 67% of spend was on tasks where cheap Flash models matched Opus quality. Switching to Flash by default and using /model mid-session cut costs from ~$170 to ~$35/month.

Model Routing Cut API Costs by 85% vs Claude Max Subscription – A Developer's Analysis
A Claude Max subscriber tracked token usage and found only 15% of tasks needed Opus. Switching to API routing (Sonnet for routine tasks, Opus for hard reasoning) dropped monthly cost from $200 to ~$30 with identical output quality.
![[Update] You Asked for a Secure, 'Always-On' Way to Run OpenClaw Without the VPS Headache. We Built It. Waitlist is Open.](/covers/article-139.jpg?v=3)
[Update] You Asked for a Secure, 'Always-On' Way to Run OpenClaw Without the VPS Headache. We Built It. Waitlist is Open.
OpenClaw announces a new feature that allows users to run their platform securely and continuously without the complexities of VPS. The waitlist is now open for early access.