r/AI_Loops • • 6h ago

60 replies on running 10 Claude Code agents 24/7. The orchestrator didn't matter, these 6 things did

1 Upvotes

A solo founder asked r/ClaudeCode how people run 10 Claude Code agents 24/7. His setup: role chats (chief of staff, CTO, officers), Codex and a local model on 3 Windows boxes, glued together with scheduled tasks, PowerShell, hooks and markdown handoff files. His pain list: one chat burning 94% of tokens, 150k+ context per call, state lost on compaction, background jobs finishing with nobody noticing, flaky crons, one shared inbox file that got too big.

About 60 replies later, the orchestrator name barely mattered. These did:

1. No long-lived chats. The top practical answer (u/tcanuck42): run every piece of work as its own short pipeline, spec -> plan -> code -> review, each step a fresh run with a clean context. No 150k chats to babysit, nothing for compaction to lose. Several people agreed that roles like "CTO" add human problems. One middle ground (u/DirusNarmo): roles help for reviews and audits, not for the build cycle.

2. A chat is not a job queue. u/KingYF1: run the schedule on the machine itself, something that stays up with no chat open, start a fresh short run only when a work item appears, and write completions to a small queue, one file or row per item. Most of the "jobs finish silently" and "timers die with the chat" problems come from making a chat do this job.

3. Make handoffs automatic. u/London-Boat: give each chat one status file it owns (current task, files it's touching, done, blocked), and have hooks on pre-compact and session start rewrite and read it. The write stops depending on the agent remembering.

4. Find the heavy agent before changing tools. u/SirRobinBlibs: Claude Code's OTel token metric can carry session id and a type (input, output, cacheRead, cacheCreation). Group by both, and a bloated chat shows up as a wall of cacheRead. u/red_hare: an agent that sits idle long enough loses its cache, and then the whole history bills again. u/Patient-Cattle-2397: compare the first call from the repo root against the same call from a small folder, to see how much of the 600k is loaded before the agent does anything.

5. Scope what each agent reads. A shared log every agent reads turns into the same oversized inbox file. Have each agent read only the entries for its task. Tightly scoped tasks also run fine on small models, and a few people use Haiku for most of them.

6. Add an agent whose job is to break it. A reviewer reads the diff looking for problems. An agent told to prove the release doesn't work finds a different class of bugs.

The dissent is worth keeping too. The highest scored reply was "It sounds like unmoderated token burn to evoke the feeling of productivity" (30 points). The setups that sounded calm in this thread all ran fewer, shorter, task-scoped runs. None of them ran more chats.

Update: what the follow-ups added (from replies to the r/ClaudeCode version)

  • Overwrite status files, don't append (u/mcmoonrays). Append-only notes grow back into the same context bloat. Add a short "rejected" line for what already failed, or fresh runs retry the same dead end. One git worktree per worker.
  • Cap the note to the next run (u/Ok-Distance-6388): one short section, pasted into the next prompt, the rest is reference. And start every run from the real source of truth (the inbox, the queue), never from where the note says to look.
  • Check exit codes and diffs, never the agent's summary (u/hieuphung97). Once the coordinator parses agent prose to decide the next step, you're babysitting again.
  • Lock the queue (u/Firm-Jellyfish-1227, u/Excellent-Issue-5956): two crons grabbing one item is how you get duplicate branches. If a run hands off to something that outlives the session, detach it and have the wrapper wait on its pid before releasing the lock.
  • Stateless runs are replayable (u/Independent-Sir3234): a bad step is one item to reset and rerun, not a drifted transcript.

What does your queue look like, a file, a database table, or something else?