Original Reddit post

If you’re tired of having your limits being reset at 3am or whenever you won’t be available, you can use this script to autocontinue where you left off with Claude. Small Tip: Using remotedesktop via chrome is a really good way to control your computer through your phone when you’re away Additionally, I’ve seen a lot of videos of people walking with their MacBooks open so that Claude doesn’t stop when they have it in their bag. Just use Amphetamine & Amphetamine Enhancer on the Mac App Store to prevent this. You’ll have to toggle the “allow sleep when lid closed” feature if that wasn’t already apparent. Pretty simple: python3 autocontinue.py When you run the command, it’ll ask you 2 questions: sequence (e.g. ‘continue [enter]’): continue [enter] Anything typed in words will create the words, but if it’s put into brackets it’ll press a key (e.g [enter] , [command] , [ control] ) It’ll then promptly ask for the time in military time time (HH:MM or seconds): 22:11 it’ll give you the countdown (in seconds) to when the script will execute. I’ve made this primarily for macOS, but haven’t tested it in Windows. If anyone is interested in creating a more in-depth version, please share! import time import sys import subprocess from datetime import datetime, timedelta KEY_MAP = { “enter”: 36, “tab”: 48, “space”: 49, “delete”: 51, “backspace”: 51, “escape”: 53, “esc”: 53, “left”: 123, “right”: 124, “down”: 125, “up”: 126, “cmd”: 55, “command”: 55, “shift”: 56, “control”: 59, “ctrl”: 59, “option”: 58, “opt”: 58, “alt”: 58, } def build_script(seq): parts = [] i = 0 while i < len(seq): if seq[i] == “[”: end = seq.find(“]”, i) if end == -1: parts.append((“text”, seq[i:])) break key = seq[i+1:end].strip().lower() if key in KEY_MAP: parts.append((“key”, KEY_MAP[key])) else: parts.append((“text”, f"[{key}]“)) i = end + 1 else: j = i while j < len(seq) and seq[j] != “[”: j += 1 parts.append((“text”, seq[i:j])) i = j lines = [‘tell application “System Events”’] for kind, val in parts: if kind == “text”: escaped = val.replace(”\“, “\\”).replace('”‘, ‘\"’) lines.append(f’ keystroke “{escaped}”‘) elif kind == “key”: lines.append(f’ key code {val}‘) lines.append(“end tell”) return “\n”.join(lines) def parse_time(s): now = datetime.now() s = s.strip() if “:” in s: h, m = map(int, s.split(“:”)) t = now.replace(hour=h, minute=m, second=0, microsecond=0) if t <= now: t += timedelta(days=1) return t try: return now + timedelta(seconds=float(s)) except ValueError: return None def main(): print(“=== autocontinue ===”) seq = input(“sequence (e.g. ‘continue [enter]’): “).strip() if not seq: seq = “continue [enter]” print(f”(default: {seq})”) script = build_script(seq) raw = input("time (HH:MM or seconds): “).strip() target = parse_time(raw) if not target: print(f"invalid: ‘{raw}’”) sys.exit(1) rem = (target - datetime.now()).total_seconds() print(f"will run at {target.strftime(’%H:%M:%S’)} ({rem:.0f}s)“) while datetime.now() < target: r = (target - datetime.now()).total_seconds() if r > 0: if r > 60 and r % 30 < 1: print(f”\r{r:.0f}s “, end=”“, flush=True) elif r <= 10: print(f”\r{r:.0f}s “, end=”“, flush=True) time.sleep(0.1) subprocess.run([“osascript”, “-e”, script]) print(”\ndone.") if name == “main”: main() submitted by /u/12IsPro

Originally posted by u/12IsPro on r/ClaudeCode