{"slug": "claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume", "title": "Claude Supervisor: wait out Claude Code usage limits, then auto-resume", "summary": "A developer built Claude Supervisor, an open-source tool that automatically resumes Claude Code sessions after usage-limit resets. The tool waits for real rate-limit resets without bypassing authentication or subscriptions, and tracks hours saved. It is available on PyPI and GitHub under an MIT license.", "body_md": "If you use [Claude Code](https://claude.com/claude-code) for long, agentic tasks,\n\nyou know the moment: you're mid-refactor, the agent is cooking, and then — usage\n\nlimit. It stops. You come back an hour or two later, the reset has passed, and\n\nyou manually pick up where you left off.\n\nI wanted to just… walk away and have it resume itself. So I built\n\n** Claude Supervisor** — a\n\nImportant framing up front: it is **not a bypass**. It never touches\n\nauthentication, subscriptions, or rate limits. It *waits* for real resets and\n\nrespects every limit. That constraint shaped the entire design.\n\n```\npipx install claude-supervisor\nclaude-supervisor init\nclaude-supervisor start --task \"add type hints across the package\"\n```\n\nWalk away. It runs the task, and if you hit a limit it waits out the reset and\n\ncontinues. When you're back:\n\n``` bash\n$ claude-supervisor status\n total_sessions   5\n resumes          4\n hours_saved      20.0\n```\n\nIt even tracks \"hours saved\" — the unattended waiting it did on your behalf.\n\nClaude Supervisor launches the `claude`\n\nCLI inside a pseudo-terminal (PTY) and\n\nreads its output stream. A small set of regex rules — living in **external\nYAML**, not code — recognize four things: a usage limit, a permission prompt,\n\n```\nSTARTING → RUNNING ⇄ WAITING_FOR_PERMISSION\n              │\n              ├→ WAITING_FOR_RESET → RESUMING → RUNNING\n              │\n              └→ TASK_COMPLETED → STOPPED\n```\n\nTwo design choices I'm happy with:\n\n`TASK_COMPLETED`\n\nhas exactly one exit:\n`STOPPED`\n\n. There is no transition back to `RUNNING`\n\n, so the supervisor I built the whole thing test-first with a scripted fake terminal: 180+ tests,\n\nhigh coverage, all green. Feeling good, I ran it against a *real* Windows\n\npseudo-console for the first time. Two bugs surfaced within minutes that no unit\n\ntest had caught:\n\n**ANSI escape sequences.** A real PTY (and Claude's TUI) interleaves colour\n\nand cursor codes into the stream — `\\x1b[32m…\\x1b[0m`\n\n. My patterns matched raw\n\nlines, so coloured output could dodge detection. Fix: strip ANSI before\n\nmatching.\n\n**Carriage return vs. line feed.** To answer a prompt I sent `\"y\\n\"`\n\n. On a\n\nWindows ConPTY, `\\n`\n\nis *not* the Enter key — so the child process sat blocked\n\non input forever and the whole run hung. The Enter key is `\\r`\n\n. One character.\n\nThat was the lesson of the project: **a green test suite is necessary, not\nsufficient.** The real terminal is the source of truth. I turned that first real\n\nBecause the supervising runs from your shell, I surfaced its status *inside* the\n\nClaude Code UI two ways: a **status line** (`🛡 3 runs · 1 resume · 2.1h saved`\n\n)\n\nand a `/supervisor`\n\nslash command. Both read the same local SQLite history.\n\nIt's an early alpha — but a serious one: validated end-to-end against real Claude\n\nCode, CI on Windows + Linux across Python 3.12–3.14, MIT licensed, published on\n\nPyPI.\n\n```\npipx install claude-supervisor\n```\n\n`--capture run.txt`\n\nand open an issue.If you've ever lost momentum to a usage limit, I'd genuinely love your feedback.\n\nStars, issues, and \"here's what broke for me\" all welcome. ⭐", "url": "https://wpnews.pro/news/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume", "canonical_source": "https://dev.to/onamsharma/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume-4olf", "published_at": "2026-07-13 08:35:53+00:00", "updated_at": "2026-07-13 08:45:33.556608+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "large-language-models"], "entities": ["Claude Code", "Claude Supervisor", "PyPI", "GitHub", "MIT"], "alternates": {"html": "https://wpnews.pro/news/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume", "markdown": "https://wpnews.pro/news/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume.md", "text": "https://wpnews.pro/news/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume.txt", "jsonld": "https://wpnews.pro/news/claude-supervisor-wait-out-claude-code-usage-limits-then-auto-resume.jsonld"}}