Continuous Claude: Code While You Sleep
Continuous Claude runs Claude Code in a Ralph-style loop that opens PRs, waits for CI, merges, and repeats — turning overnight hours into shipped serial changes.
The most counterintuitive productivity unlock of 2026 is not a faster model — it is a loop that keeps running after you close the laptop. Continuous Claude, an open-source CLI by Anand Chowdhary, takes the Ralph technique and wires it to GitHub: it runs Claude Code in a loop where each iteration creates a pull request, waits for CI checks, merges if green, and starts the next change. The result is a system that grinds through many small serial tasks overnight while you do something else.
This is loop engineering applied to the most boring, highest-volume work a codebase generates: dependency bumps, coverage gaps, mechanical refactors, migration steps. None of them are hard. All of them are tedious. Continuous Claude exists to eat the tedium one verified PR at a time.
This piece reflects public discussion across X and engineering blogs as of June 2026; verify primary sources before relying on specifics.
Key Takeaways
- Continuous Claude wraps Claude Code in a Ralph-style loop with one critical addition: a PR-and-CI gate on every iteration, so changes are verified before they merge.
- It maintains persistent context across iterations, so the agent remembers what it tried last pass instead of starting cold every time.
- The ideal jobs are many small, independent, serial changes — coverage backfill, dependency upgrades, refactors, and migrations — not one large architectural rewrite.
- It is the externally-hosted cousin of Claude Code's built-in
/loopprimitive: same act-observe-decide-repeat shape, different runner and persistence model. - CI is the exit gate. A PR only merges when checks pass, which keeps the loop honest and stops it from shipping broken code while you sleep.
What does Continuous Claude actually automate?
Continuous Claude automates the full ship cycle, not just the code-writing step. Each iteration runs the same arc:
- Pick the next unit of work from the goal you defined (for example, "raise coverage in
src/one module at a time"). - Run Claude Code to make the change in a fresh working context, carrying forward a persistent memory of prior iterations.
- Open a pull request with the change.
- Wait for CI — the loop blocks on GitHub checks rather than assuming success.
- Merge if green, then loop back to step one for the next unit.
The repo lives at github.com/AnandChowdhary/continuous-claude. The design philosophy is deliberately small: it is a thin orchestration layer that turns Claude Code from a one-shot assistant into a serial worker that respects your CI as the source of truth.
How is it different from a plain while-loop?
The original Ralph technique is famously crude — a while true loop that re-invokes the agent with a fresh context each pass. It works, but it has two weaknesses Continuous Claude fixes.
| Dimension | Plain Ralph loop | Continuous Claude |
|---|---|---|
| Context between passes | Fresh each time (forgets) | Persistent context carried forward |
| Verification | Whatever you script | PR + CI checks gate every merge |
| Output unit | A diff on disk | A reviewed, merged PR |
| Recoverability | Manual | Failed CI leaves the PR open for you |
| Best for | Quick experiments | Overnight serial production work |
The persistent-context piece matters more than it sounds. A goldfish loop that forgets every pass will re-attempt the same dead ends. Continuous Claude remembers "I already tried upgrading lodash and it broke the build," so iteration N+1 starts smarter than iteration N.
What jobs is it ideal for?
The sweet spot is work that is high-volume, low-risk, and naturally serial — a long queue of independent changes where each one is verifiable on its own. Strong candidates:
- Dependency upgrades. Bump one package per PR, let CI catch breakage, merge the safe ones.
- Coverage backfill. Add tests module by module until you hit a coverage threshold.
- Mechanical refactors. Rename a pattern, migrate a deprecated API, or apply a codemod across hundreds of files in digestible chunks.
- Migrations. Move one route, table, or component per iteration with a green build as the gate.
What it is not for: a single sprawling feature, anything requiring product judgment, or work where the changes are tightly coupled and can't be verified in isolation. Those need a human in the loop, or at least a PR babysitter watching review feedback rather than just CI.
How does it relate to Claude Code's /loop?
Continuous Claude and Claude Code's native /loop, /goal, and /schedule primitives are two answers to the same question: how do you run an agent over and over until a goal is met? The shapes are identical — both follow the act-observe-decide-repeat cycle documented in the Agent SDK agent-loop guide.
The difference is where the loop lives and how it persists. /loop runs inside a Claude Code session on your machine. Continuous Claude is a standalone CLI that owns the runner, the persistence, and the GitHub integration, which makes it well-suited to detached, long-running jobs you kick off and walk away from. If you want a self-contained overnight worker, reach for Continuous Claude. If you want a loop tightly integrated with an interactive session, reach for /loop.
What guardrails keep it from shipping garbage overnight?
The CI gate is the primary guardrail, but a well-run setup adds more. Every good loop needs a verifiable exit condition and anti-gaming protection, and an unattended one needs them most:
- Branch protection so the loop can't merge without passing checks.
- A max-iterations or max-PR cap so a confused agent can't open 400 PRs by morning.
- Required green CI as the merge condition — the equivalent of a ship-PR-until-green loop running as the gate.
- Protected paths so the agent can't "fix" failing tests by deleting them.
Set those, point it at a queue of small changes, and you wake up to a stack of merged, CI-verified PRs instead of a stack of regret.
Frequently Asked Questions
Does Continuous Claude merge code without any human review?
By default it merges PRs that pass CI, so your CI quality determines how safe that is. Teams that want a human gate keep branch protection requiring a manual approval, which turns the loop into a PR-generator rather than an auto-merger.
What happens when a PR fails CI?
The loop does not merge it. The failing PR stays open for you to inspect, and because Continuous Claude carries persistent context, the next iteration can learn from the failure rather than blindly repeating it.
Do I need GitHub specifically?
The tool is built around the GitHub PR-and-checks workflow. The same loop pattern can be reproduced on other platforms, but the out-of-the-box integration targets GitHub Actions-style CI.
How is this different from just running Claude Code overnight?
A bare Claude Code session has no merge gate and no persistent serial-task loop. Continuous Claude adds the PR/CI verification step and the iteration memory, which is what makes unattended overnight runs trustworthy instead of reckless.
Can I use it alongside Claude Code's /schedule?
Yes. Some builders trigger Continuous Claude runs on a schedule — for example, a nightly coverage-backfill run — combining cron-style timing with the PR-and-CI loop.
Browse 150+ ready-to-run agent loops in the Loops channel, or explore the full skill catalog at aiskill.market.