Cook: A simple CLI for orchestrating Claude Code (rjcorwin.github.io)

by staticvar 97 comments 307 points
Read article View on HN

97 comments

[−] maCDzP 58d ago
I dunno. I just let Claude build a python script that calls Claude code though subprocess.run().

I recently made a sort of Autoresearch with that approach. The script calls Claude Code to create a hyphotesis, then code based on that, evaluate- rinse and repeat. I am still trying to figure out if I am actually on to something or just burning tokens. Jury is still out.

[−] staticvar 58d ago
That's totally a valid approach! Especially for a very specific workflow you are looking for. For the cases I cover in cook, I had done those patterns enough times that I figured it was time to build a tool/skill for Claude so that I didn't have to explain it as much and also not have to wait for claude to code it up, and possibly interpret me wrong. Now ask claude to "/cook race 3 of foo plan with review, pick the best" and it knows what to do.
[−] dgb23 58d ago
I think you're onto something, but I would add that it's sort of like a live REPL that has an integrated agent but with extra steps.

I haven't used python much but I wouldn't be surprised if you can set up a sufficiently powerful REPL with it. I know Julia can do it very well and it's a very similar language. Obviously there are powerful Lisps that do this very well as well.

[−] scrappyjoe 58d ago
I went quite far down this approach last year; you're welcome to take what you want from my repo -

https://github.com/riazarbi/way

[−] staticvar 58d ago
Hey scrappyejoe, way looks pretty cool. The goal of cook is to be unopinionated, exposing primitives for the shape of workflows as opposed to defining what happens in those workflows. Cook is something that way could use under the hood.
[−] scrappyjoe 58d ago
Cool, I'm already digging into your stuff, thanks for posting it.
[−] danr4 58d ago
that's rlm
[−] jamiemallers 58d ago
[dead]
[−] smarx007 58d ago
A noob question: is there a tool that automatically instructs Claude Code to "continue" when the token quota is reset after 5h? I am interested in that more than some rather fancy loops.
[−] jemmyw 58d ago
Looks pretty nice. I think a lot of devs have been making similar tools, I've written my own thing that does a work review loop. I like the interface you've made. I'll probably give it a go, but I'm also reluctant to relinquish the control I have when it's my own code doing orchestration.
[−] cdaringe 58d ago
I wrote https://jsr.io/@cdaringe/ralphmania which has a lot of feature overlap. cook looks more polished.

1. How do you handle worktree merge conflicts and/or integration validation issues? 2. Can i work straight from a list of requirements? I think i saw you support it… 3. I have my variant write a minimal explainer for every satisfied spec, aka receipts. Its pretty great, because i often review the receipts, and if imperfect, mark as NEEDS_REWORK + notes, and it’ll eventually just pick that up on a future iter

[−] lazybean 58d ago
The composability here is really elegant — review v3 pick as a pipeline that "just works" is the kind of DX that makes agent orchestration feel tractable rather than overwhelming.
[−] yohamta 58d ago
AI agent orchestration is future. That's where workflow engine shines. I'm doing the same thing using Dagu.sh and I don't use terminal so much anymore.
[−] kasperstorgaard 58d ago
How heavy on tokens is this? I don't use these style workflows and am fairly new to claude code, so I assume it's better than 3x tokens when doing 3 passes?
[−] khazhoux 58d ago
How does this handle when Claude needs user input? To choose an option, grant tool permission, clarify questions…
[−] bivlked 58d ago
One thing i wish more CLI tools did: non-interactive mode. i build bash tools that have interactive prompts for first-time users, but everything the prompt asks also has a CLI flag. makes scripting and CI/CD so much simpler - you can test the exact same code path without mock stdin.
[−] nurettin 58d ago
claude> "We want to add a title section that shows what page we are currently on, use cook to manage the development process"

* coolers whirring, gpus on fire, tokens flying, investors happy, developer goes for 6th break of the day

[−] niobe 58d ago
Very nice. However, I do like to read every agent summary before letting them move on. I'm not sure I'd be able to apply this level of automation to many tasks.
[−] genthree 58d ago
Semi-on-topic: Anyone know a way to get a good alternative UI on top of Cursor?

My company’s tracking how much we use the damn thing (its autocomplete is literally less-useful than standard VSCode, only time it’s consistently good is when it sees me do one thing to a line, sees repeated similar lines after that, and suggests I do it on the next one too, one at a time, and that’s only useful to me because I’ve never actually bothered to learn how to properly use a text editor) so I can’t avoid it, but even on codebases in the hundreds of lines it’s OOM killing things on my 16GB laptop (it, plus goddamn Teams, were eating half the memory by themselves the other day… with Cursor sitting at almost 6GB alone. JFC. On the plus side if this is what software from a company that should be full of experts at using these things looks like, guess our jobs are safe from them… though not from recession and ZIRP unwinding)

[−] itsankur 57d ago
Is the form factor what makes this different amongst the 500 that exist? Like CLI vs UIs?
[−] NetOpWibby 58d ago
Dull colors and a display font used for copy makes this website incredibly unpleasant to read.
[−] bean469 57d ago
Surprised that there's no discussion about the prevalence of using TypeScript for developing these CLI agent harnesses. To me it seems concerning that such CLI programs are so chunky and commonly have to use over 1GB of RAM. Might be boomer-talk, but I am used to CLI apps being extremely lightweight and fast (think Total Commander, which has a UI, but is still very lightweight and responsive)

I understand that part of the reason is because many of these harnesses are vibe-coded, so plenty is lost in terms of optimization. And, well, because LLMs code best in TypeScript

[−] viditraj 58d ago
can we integrate it with Devin too? seems like it doable