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

How Claude Project Instructions Are Injected — And Why Changing Them Mid-Conversation Breaks History
Project Instructions and User Preferences are loaded into the system prompt at conversation start, not re-injected every turn. Changing them mid-conversation causes Claude to overwrite its memory of past instructions, leading to false recollections.

Getting Claude to Adversarially Debate Without Caving: 5 Prompt Tweaks That Work
Five concrete prompt engineering techniques to prevent Claude from hedging, sycophancy, and fabrication when acting as a debate opponent, based on building sparwithai.com.

OpenClaw Agents Become Unresponsive After Week 1: Telegram Integration Issues?
User reports OpenClaw agents going silent after the first week, suspecting Telegram integration or long-term runtime issues. Restarts help temporarily.

Annotation-Driven UI: How to Design Templates in Figma and Let Claude Extract Coordinates
Skip building a custom layout engine: design flat PNGs in Figma, draw colored rectangles for slots, feed both to Claude, and get editable area definitions with tap targets. One afternoon instead of weeks.