5 ms·
Show HN: Continuous Claude – run Claude Code in a loop
Continuous Claude is a CLI wrapper I made that runs Claude Code in an iterative loop with persistent context, automatically driving a PR-based workflow. Each iteration creates a branch, applies a focused code change, generates a commit, opens a PR via GitHub's CLI, waits for required checks and reviews, merges if green, and records state into a shared notes file.
This avoids the typical stateless one-shot pattern of current coding agents and enables multi-step changes without losing intermediate reasoning, test failures, or partial progress.
The tool is useful for tasks that require many small, serial modifications: increasing test coverage, large refactors, dependency upgrades guided by release notes, or framework migrations.
Blog post about this: https://anandchowdhary.com/blog/2025/running-claude-code-in-a-loop https://anandchowdhary.com/blog/2025/running-claude-code-in-...
- deleted 1y ago[deleted]
- mrwill84 1y ago[dead]
- leobg 1y agoMissed opportunity to call it Claude Incontinent (CLI).
- apapalns 1y ago> codebase with hundreds of thousands of lines of code and go from 0% to 80%+ coverage in the next few weeks I had a coworker do this with windsurf + manual driving awhile back and it was an absolute mess. Awful tests that were unmaintainable and next to useless (too much mocking, testing that the code “works the way it was written”, etc.). Writing a useful test suite is one of the most important parts of a codebase and requires careful deliberate thought. Without deep understanding of business logic (which takes time and is often lost after the initial devs move on) you’re not gonna get great tests. To be fair to AI, we hired a “consultant” that also got us this same level of testing so it’s not like there is a high bar out there. It’s just not the kind of problem you can solve in 2 weeks.
- id00 1y agoI agree. It is very easy to fall in the trap: "I let AI write all the tests" and then find yourself in a situation where you have an unmaintainable mess with the only way to fix broken test within a reasonable time is to blindly accept AI to do that. Which exposes you to the similar level of risk as running any unchecked AI code - you just can't trust that it works correctly
- piker 1y ago"My code isn't working. I know, I'll have an AI write my unit tests." Now you have two problems.
- simonw 1y agoI find coding agents can produce very high quality tests if and only if you give them detailed guidance and good starting examples. Ask a coding agent to build tests for a project that has none and you're likely to get all sorts of messy mocks and tests that exercise internals when really you want them to exercise the top level public API of the project. Give them just a few starting examples that demonstrate how to create a good testable environment without mocking and test the higher level APIs and they are much less likely to make a catastrophic mess. You're still going to have to keep an eye on what they're doing and carefully review their work though!
- throwup238 1y agoI've think they're also much better at creating useful end to end UI tests than unit or integration tests, but unfortunately those are hard to create self contained environments for without bringing a lot of baggage and docker containers, which not all agent VMs might support yet. Getting headless QT running was a pain too, but now ChatGPT Codex can see screenshots and show them in chat (Claude Code can't show them in the chat for some reason) and it's been generating much better end to end tests than I've seen for unit/integration.
- cortesoft 1y ago> I find coding agents can produce very high quality tests if and only if you give them detailed guidance and good starting examples. I find this to be true for all AI coding, period. When I have the problem fully solved in my head, and I write the instructions to explicitly and fully describe my solution, the code that is generated works remarkably well. If I am not sure how it should work and give more vague instructions, things don't work so well.
- janaagaard 1y agoKudos on making Bash readable. (https://github.com/AnandChowdhary/continuous-claude/blob/main/continuous_claude.sh https://github.com/AnandChowdhary/continuous-claude/blob/mai...)
- jdc0589 1y agoim not saying OP did this, but I've actually had AI spit out some pretty stellar bash scripts, surprisingly
- anandchowdhary 1y agoNo, you're right. It was a pretty collaborative effort with me and Claude!
- svieira 1y agoFYI, you're missing two patterns that allow the `--key=value` admirers and the `-alltheshortopsinasinglestring` spacebar savers among us to be happy (for the otherwise excellent options parsing code). shopt -s extglob case "$1" # Flag support - allow -xyz z-takes-params -@(a|b|c)*) _flag=${1:1:1}; _rest=${1:2}; shift; set -- "-$_flag" "-$_rest" "$@";; # Param=Value support -?(-)*=*) _key=${1%%=*}; _value=${1#*=}; shift; set -- "${_key}" "$_value" "$@";; esac
- anandchowdhary 1y agoFor letting me know! Would you like to create a PR? Otherwise I'll add you as a Co-Authored-By!
- svieira 1y agoCo-authored is fine, thanks for asking!
- insin 1y agoGesundheit
- decide1000 1y agoHow does it handle questions asked by Claude?
- anandchowdhary 1y agoIt sends a flag that dangerously allows Claude to just do whatever it wants and only give us the final answer. It doesn't do the back-and-forth or ask questions.
- CharlesW 1y agoThe `--dangerously-skip-permissions` flag (a.k.a. "YOLO mode") does do the back-and-forth and asks questions, so this is a bit more than that.
- brumar 1y agoYes. I did not look but most probably the non interactive mode flag is used (-p)
- anandchowdhary 1y agoIt does `claude -p "This is the prompt" --dangerously-skip-permissions --output-format json`
- CharlesW 1y agoOh! TIL, thank you.
- stpedgwdgfhgdd 1y agoIteratively working is a MUST for more than trivial fixes. This continuous loop could work for trivial refactorings / maintenance tasks.
- namanyayg 1y agoExactly what I needed! I might use it for test coverage on an ancient project I need to improve...
- RonanSoleste 1y ago[flagged]
- dang 1y agoPlease don't use quotation marks to make it look like you're quoting something when you're not. Especially not for snark purposes - https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html.
- _dark_matter_ 1y agoFyi
- cog-flex 1y agoDoes this exist for Codex?
- tinodb 1y agoYou can do this with a single while loop in bash. No need for this project. Search for “ralph wiggum ai coding” and find a couple of guys that share plenty of examples and nerd out about it
- kami23 1y agoI've dubbed my loop of this as 'sicko mode' at work as I've become a bit obsessed with automating everything little thing in my flow, so I can focus on just features and bugs. It feels like a game to me and I enjoy it a lot.
- lizardking 1y agoIt's oddly satisfying to watch your tooling improve itself.
- jes5199 1y agocan it read code review comments? I've been finding that having claude write code but letting codex review PRs is a productive workflow, claude code is capable of reading the feedback left in comments and is pretty good at following the advice.
- jerezzprime 1y agoHave you tried GitHub Copilot? I've been trying it out directly in my PRs like you suggest. Works pretty well sometimes.
- jes5199 1y agoI find that ChatGPT’s Codex reviews - which can also be set up to happen automatically on all PRs - seem smarter than Copilot’s, and make fewer mistakes. But these things change fast, maybe Copilot caught up and I didn’t notice
- tinodb 1y agoNo codex catches genuine bugs here that multiple reviewers would have overlooked, whilst copilot only comes with nitpicks. And codex does none of those, which is also great.
- stpedgwdgfhgdd 1y agoI’m letting Claude Code review the code as part of a gitlab CI job. It adds inline comments (using curl and the http API, nightmare to get right as glab does not support this) CC can also read the inline comments and creates fixes. Now thinking of adding an extra CI job that will address the review comments in a separate MR.
- DeathArrow 1y ago>run Claude code in a loop And watch your bank account go brrr!
- lizardking 1y agoIf you have a max plan you just watch your usage get throttled
- i4k 1y agoI was expecting to see links to a bunch of opensource successful examples, projects self-managed and continuously adding code and getting better. 99.9999% of AI software is vaporware.