Skip to content
Back to skills

Principle Manage Idle Resumption

ASecurity

Apply when a session may idle for a multi-hour or multi-day gap: polling loops, human-in-the-loop waits, overnight runs, babysit/watch/retry work. Compact or restart deliberately before resuming instead of letting the prompt cache lapse.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 19, 2026
ai-agents

Works with

  • claude code

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add EdbertChan/catstack --skill principle-manage-idle-resumption --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Principle Manage Idle Resumption?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Principle Manage Idle Resumption
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edbertchan-principle-manage-idle-resumption/badge)](https://www.skillsdirectory.com/skills/edbertchan-principle-manage-idle-resumption)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: principle-manage-idle-resumption
description: "Apply when a session may idle for a multi-hour or multi-day gap: polling loops, human-in-the-loop waits, overnight runs, babysit/watch/retry work. Compact or restart deliberately before resuming instead of letting the prompt cache lapse."
disable-model-invocation: true
---

# Manage Idle Resumption

A session that idles past its prompt-cache TTL (5 minutes by default, up to 1 hour with an explicit TTL) pays a full-price cache rebuild on the next turn instead of a cheap cache read — roughly 10x the per-token cost for however much context has accumulated.

**Why:** Long-running work — CI-repair loops, human-in-the-loop approval waits, overnight runs, polling for a merge or deploy to finish — naturally idles between turns. Each idle-then-resume silently re-bills the entire accumulated context at full price. Across a long session this recurs every time it idles, not once.

**Pattern:**
- Before letting a session sit idle for a multi-hour or multi-day gap, decide deliberately: compact now (summarize and trim), or accept the coming rebuild cost.
- For polling/watch loops specifically, batch checks rather than waiting synchronously turn-by-turn inside one growing thread — a detached poller that reports back once, instead of resuming the same context every N minutes, avoids paying the tax on every check.
- If a session naturally spans days (a long-running babysit task), schedule at least one compaction per idle gap, not one per context-window-full — the trigger is time, not size.
- Read the numbers, don't guess: `cache_read_input_tokens` near zero on a resumed turn, right after a gap, confirms the cache lapsed — that's the signal you should have compacted first.

**Battle-tested, across two different harnesses:** a corpus retrospective across this machine's worst-offender sessions found the same mechanism independently four times. A Claude Code CI-repair session paid three separate 200K–780K-token cache rebuilds, each immediately after a 2–4 hour idle gap. A second Claude Code session resumed after 6.5 hours and rebuilt 500K+ tokens of context across the next two turns. An OMP-harness session (a different tool entirely, same underlying mechanism) accumulated 29 cache-miss turns after idle gaps, costing $13.69 — 6.8% of that session's entire bill — versus neighboring turns with the same context size costing 10x less via cache hits. A fifth, 5-day-long session that never compacted paid the tax on every single resume; one instance alone cost 1.7M tokens to rebuild. In every case the trigger was elapsed wall-clock time since the last turn, not context size — a session well under its context-window limit can still be bleeding money on every idle-then-resume cycle.

Files in this skill

  • SKILL.md2.7 KB
  • tests/fires_example.md893 B
  • tests/stays_silent_example.md591 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.