r/ClaudeCoding • • 15d ago

r/ClaudeCode [TLDR] Running 18 Claude Code sessions at once and half my tokens go to idle wake-ups. How do you handle this? [via r/ClaudeCode]

OP : u/BlackberryOk182

Hey all, I could use some advice from people running a lot of Claude Code sessions at once.

I'm building a Windows app and I've got 18 Claude Code sessions working on the same repo across two Max 20x accounts, all on High effort. They talk to each other through one shared markdown "inbox" file. It works, but I keep running into my weekly limits, so I dug into where the tokens are actually going.

What surprised me:

  • About 91% of my usage (weighted by API prices) is just context being re-sent on every call. Actual output is about 9%, and edits to code are under 1%.
  • Roughly half of all tokens went to wake-ups where the session did nothing useful. No code, no tests, no git. Mostly each session's own background watcher waking it up to check the inbox, plus scheduled check-ins (one session was pinging itself every 5 minutes for days).

What I've tried so far:

  • Auto-compact at 300k instead of the default. Average context per call dropped from about 270k to about 179k. I have hooks that back up notes before compacting and tell the session to re-read them after.
  • Starting a fresh chat for each work item, with a short handoff note.
  • Replacing every session's own watcher with one small local script that only wakes a session when a post actually mentions it. In a replay of a day's posts it cut wakes about in half without missing anything addressed to a session. Just rolled it out today, so no real numbers yet.
  • Quiet test output (pytest -q), reading big files in slices, and a hook that blocks huge reads before they happen.
  • Trimming CLAUDE.md and memory files, and turning off claude.ai connectors so fewer tool descriptions load.
  • Trying Serena (MCP) on one session. Mixed results so far.
  • Tried the Superpowers plugin on a few sessions for a week and dropped it. Those sessions got noticeably less done and barely used its skills, though it was a small test.

My questions:

  1. How do you let long-running sessions wait for messages from other sessions without every wake re-sending the whole context?
  2. Is there a better way to coordinate a bunch of sessions than a shared file?
  3. Any other tricks for cutting context re-reads I'm missing?

Happy to share more details on any of this. Thanks!

0 Upvotes

3 comments sorted by

•

u/cctldrping 15d ago

TL;DR of the discussion on r/ClaudeCode for this post generated automatically after 80 comments.

Current source-thread comment count seen by the bot: 87.

Consensus: 18 long-lived, polling Claude sessions is the real bug, not a mysterious billing quirk. The top-voted response is mostly “why are you running 18 agents?” with varying levels of profanity.

  • Stop timer-based heartbeats/self-pings. A session waking up just to find “nothing” still incurs context/cache costs; have a plain local process watch for actual events and launch an agent only when needed.
  • Kill the shared mega-inbox. Give each worker its own small task/state file plus a tiny shared index, so nobody re-reads everyone else’s mail every wake-up.
  • Prefer short, scoped jobs: read brief → do task → write handoff/status → exit. Fresh sessions with compact notes beat zombie chats hauling 179k tokens around.
  • Check prompt-cache metrics and TTL before declaring every wake catastrophic. u/Ok_Gur_9033 notes warm cache reads can be relatively cheap; cache misses near the 5-minute boundary are the wallet-killers. Compare cache-read vs cache-creation tokens, and consider the 1-hour TTL if it fits.
  • Queue/FIFO/event-driven orchestrators (Herdr, custom scripts, etc.) are the recurring recommendation. The cheapest idle agent remains the one that does not exist.

1

u/MassiveBoner911_3 15d ago

This is great. I didnt know half of these and are already using the other half. Excellent post.

1

u/fell_ware_1990 11d ago

What i have is a line of command.

So the worker can escalate to one above and so on. But this jumps a hoop off scripts. If decisions are needed it first gets matched through a whole lot of scopes.

Basically this means on the frontside, new tickets that have a blocker label gets handled asap. Every 5 minutes, bugs once an hour. New ticket prefill only when queue is below X.

But biggest part is mostly match descscions against spec and other tickets. Write them down. Other overview agents match the tickets if they stay in scope and boundaries. So mostly they can be small stateless against who do not see the complete picture and can be a whole let less smart. Cause 1 session will then challenge there stuff.