Repository navigation
Replies: 1 comment
|
Hey I'm running into these extra costs too, and compacting after reset still takes that full cold replay cache hit which costs an extra ~150K to >1M tokens. I put up a proposal in #44039 to compact right before 100% while the cache is still warm, which would trade a bit of headroom early to mitigate that cost hit. Check it out if it sounds interesting and lmk what you think. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Auto-resume limited threads waits for the usage-limit reset and then sends
Continue where you left off.straight into the thread (UsageLimitRecoveryWorker.ts). Neither compaction mode covers that resume:failed, so the thread never qualifies.The reset is almost always past the prompt-cache lifetime: 1 hour for a main Claude thread on a subscription, and 5 minutes for child threads on the default subagent TTL (or for API-key/overage sessions). A 5-hour or weekly reset is well past both. So the first resumed turn reads the full history uncached and writes all of it back to the cache (1h writes bill at 2x base input). Every turn after that keeps paying for the bloated context. In practice, the threads that hit a limit are the long ones: 200K-900K tokens is common.
Unattended overnight runs are where auto-resume matters most, and they pay this cost on every wake-up. A tree of delegated children multiplies it, because each child resumes separately on a 5-minute TTL.
Proposal
When auto-resume fires on a Claude thread that is above the idle-compaction token threshold (200K today) and whose prompt cache has expired:
/compactfirst, as a visible T3 turn like the idle compactions (idleCompaction: "onReturn"or a new"onLimitResume"provenance).Gate it on the existing Compact idle threads setting (anything but Never), or on a separate toggle under Auto-resume limited threads if maintainers prefer explicit opt-in. The cache-expiry check makes it a no-op when the reset comes before the TTL runs out.
#18069's skip cache writes on cold compaction would combine well with this: a compaction run with caching disabled avoids writing a history that is about to be discarded.
Related
Version: T3 Code Nightly (2026-10-25), Claude Opus 5.5, macOS.
All reactions