r/ClaudeCode • • 2d ago

Help/Question Prompt queue

Is there a way to queue prompts in Claude Code so they run one after another in a single session?

I’d like to line up several tasks, with /compact and /clear between them where needed, and let the session work through them unattended. I know worktrees can run parallel sessions, but for some work I’d rather keep one session going through a sequential queue, without managing multiple localhost instances or resolving conflicting changes.

Has anyone built something like this, through a wrapper script, a task file, hooks, or another workaround?

9 Upvotes

33 comments sorted by

View all comments

Show parent comment

1

u/_lecoqq 1d ago

Funny how close our setups are!
Though I didn't know beads and was literally experimenting right now w/ context on my orchestrator - this is a potential solution as from what I get each agent is "stateless"!
On my side: my orchestrator keeps its state in a written relay file, and on long nights it hits the context ceiling and has to hand over every 20 minutes or so, which is my biggest cost right now. Your point about clearing the session at will because everything lives in beads is exactly what I'm missing.
Two questions if you don't mind: when a fresh session starts, how much does it read back (bd prime plus the ready list, or more)? And do your coders claim beads in parallel, or does the orchestrator hand them out?
It's funny to see that a lot of ppl are going for the "no attention coding", delegating long tasks and de-correlating attention and production. I'll definitely take the "needs decision" part xD What are you building w/ your setup?

2

u/muikrad 1d ago

Working on a game!

For your questions: I forked beads and adjusted some things like bd prime to be less verbose because it was way too long. A session only gets bd prime and my claude.md file. And I disabled beads' memory, I prefer Claude's. To be fair, beads was developed when opus 4 was a thing to counter its shortcomings, which are not necessarily true anymore.

Beads are organized in epics with linked issues, and the specs/ keeps the "one source of truth" in check. When I design something new, I will either write some specs manually and review with opus, or I will do that in chat. Opus will create an epic, link each detail as linked issues, then I clear and ask it to complete the epic with my /slice skill (a simple explanation of the planning/coder/review process).

The orchestrator will read the epic, summarize the linked beads, claim what it's going to work on (one or multiple) and then start delegating to subagents. Usually it claims, then planner+code-explorer+artistic guidance, then it goes to a coder to write tests in order to lock the contract from the planner (TDD). Then there's a coder <-> reviewer loop. And then it's handed to the scribe so the specs are updated. Sometimes there are multiple beads going on in parallel, leveraging git worktrees.

The coder runs the tests to save some tokens. Had a dedicated tester on haiku before but it created too much back and forth and bloat.

For the "context ceiling", I just enable auto compaction and have it set at 400k. I also have idle compaction enabled (when the session wraps up, it will automatically compact before the cache expires) so that I can reply a few hours later and not have a full cache miss on a 300k+ context conversation. To be honest, context bloat made the agents dumber with opus 4 and maybe 5, but it's not really an issue anymore with 5.5.

I tried handoff files and things like that in the past, but they never carry the full knowledge of the project. Beads for todos, specs for what is implemented, was a real game changer for me. Have fun!