background-usagelisted
Install: claude install-skill gulshankundnani/dev-companion
# Background usage
A waiting session still pays: every call re-reads the whole context. Idle waiting is pure waste.
## While work runs in the background
- Start long commands (builds, test suites, scans, installs, deploys) with `run_in_background`. Then end the turn or do other independent work; the completion notice wakes the session.
- Never poll: no `sleep`/`Start-Sleep` loops, no repeated reads of the output file or log, no "check status" calls. Read the result once, filtered to errors and the summary line.
- External state the harness can't see (CI, a deploy, a remote job): one check timed to how long it takes (a ~10 min CI run = one check at ~10 min), or `Monitor` with an until-condition. `/loop` and `ScheduleWakeup`: 20-30 min for idle checks, never under ~5 min.
- Subagents: only for wide searches; don't wait on them with status checks. Several sessions in parallel multiply cost; start them only when the user asked.
- Scripts that take minutes: run them once with output to a file, then read only the summary.
## Audit (what spent tokens recently)
```
powershell -NoProfile -File "<this skill>/scripts/background-usage.ps1" -Minutes 60
```
Lists every main session and subagent on this machine with calls, StartK (context of the first call in the window: the starting package for sessions that began in it), context size, Rebuilds (calls that re-wrote most of the context to cache: idle gap past the cache lifetime, or a changed prefix), weighted tokens (input 1, cache write