Repository navigation
afk-compact 0.1.9
afk-compact 0.1.9 keeps near-limit stops in force through long idle gaps, because a usage reading now counts until its limit resets instead of for only 10 minutes. It also supports installs that Claude Code reads in place from a local folder marketplace. The one-line install needs 2.1.292 or newer. Requires Claude Code 2.1.287 or newer; tested against 2.1.319.
Changed
- Near a usage limit, plugin idle compaction, keep-warm and the idle handoff turn count a reading until its limit resets, as the share only grows and an idle session's reading is never refreshed, even by keep-warm. Past the reset it counts for nothing; without one, 10 minutes.
- Readings of one limit with the same reset time (within a minute) form one period, its share being the latest. A limit stops these actions only when every period is at or over it, so behind a proxy that spreads requests over several accounts, an account with room lets them run.
- With an agent, a workflow or a working teammate open, these actions still run past 90% only on a reading from the last 10 minutes. An older one stops them at 90%, and the log row says
rule: stale. - A reading of unknown time, such as one dated more than a minute ahead of the clock or the session's own reading just after a plugin reload, before Claude Code refreshes it, becomes its period's latest only when its share is larger.
- When no limit is reported, for example in a session restarted during an idle gap before its first response, the session's own entries in the shared usage record stand for it, beside other sessions' entries. After a plugin reload they are also read beside the reported reading.
- The shared usage record keeps an entry until its limit resets, and one with no reset time for 10 minutes after it was last read or shown. A full record never drops a period's latest reading.
/afk-compact:statuslists each of the session's usage readings with its age and reset time, marking as "not counted" one past its reset or one with no reset time after 10 minutes. It also lists the other sessions' counted readings, the latest of each period.- Usage writes are throttled: one runs at a time, a refresh during a write is folded into one check after it, and shares are compared in whole points. Many parallel subagents now start one helper process instead of one each.
Fixed
- A copy Claude Code reads in place from a local folder marketplace now counts as installed: its first session writes the status line's fixed command path, and options and version scope resolve as for other installs. A
--plugin-dirload of that folder never changes the path. - After you uninstall such a copy, the status line's fixed command path keeps running that folder while it exists, because Claude Code never deletes it. Delete
~/.local/state/afk-compact/bin/afk-compact-storeyourself and remove its call from your status line. - A session whose marketplace was later pointed at another folder keeps its install by its data folder, and a
--plugin-dirdata folder underCLAUDE_CODE_PLUGIN_CACHE_DIRstays a--plugin-dirload. - The status line's next keep-warm time (
keep_warm.next_due_at) now follows the gap's own ping interval, which thekeep_warm_startlog row now records asping_s.