Skip to content

afk-compact 0.1.13

Choose a tag to compare

@RuslanTar RuslanTar released this 15 Nov 06:24
· 91 commits to main since this release

afk-compact 0.1.13 adds a prompt cache meter for your status line, with a /afk-compact:settings step that prints its snippet, keeps a status line quiet once the plugin's folder is gone, and stops a false copy-mismatch warning for Claude Code's trailer. The one-line install needs 2.1.292 or newer. Requires Claude Code 2.1.287 or newer; tested against 2.1.325.

Added

  • A cache meter for your status line: cache --stdin --bar prints ██████░░░░░░ 30m, 12 cells filling as the cache nears expiry (blue, yellow from half its lifetime, red from 90%) and the cache's age. Before the first response, or with an unknown lifetime, it prints nothing.
  • The meter reads ↻3/7 in cyan while keep-warm runs, cold 1h02m or cold miss in magenta for a cold cache, and compacted after a compaction. Its flags are stable but its text may change, so use --json if you parse the output.
  • Meter options: --left shows time left instead of age, --short drops the cells, --ascii draws # and -, and --color auto|always|never follows NO_COLOR and TERM=dumb. A locale that is not UTF-8 turns on --ascii, and a COLUMNS below 60 turns on --short.
  • Where the plugin's helper cannot run, --bar prints nothing and exits 0 instead of REFUSED: helper-runtime. A plugin copy older than 0.1.13 does not know --bar and shows nothing until you update.
  • /afk-compact:settings has a "Status line meter" step that reads which status line your user, project and local settings run (only the name of what it runs, never the full command), previews the meter and prints a snippet for your case to paste. It changes no file.
  • The snippet is a settings entry, a script adding the meter as a second line under your own, or values for a ccstatusline Custom Command widget. It runs the meter only once the plugin's fixed path exists, so before the plugin's first session the line stays empty, not an error.

Fixed

  • A status line that calls ~/.local/state/afk-compact/bin/afk-compact-store no longer prints sh errors after an uninstall, a prune or a failed update: with the installed copy gone it now prints nothing and exits 0.
  • The file at that path is rewritten at the next session start if an earlier version wrote it, and is now also written when the plugin folder's path contains a '.
  • After a downgrade to 0.1.12 or earlier, that file keeps running the 0.1.13 copy while it exists, as older versions leave it alone; once that copy is gone the segment stays blank. Delete the file and the older version writes its own at its next session start (without --bar).
  • When the installed summary differed from the saved copy only by lines Claude Code added after the end marker, a complete copy got a false copy-mismatch toast and an escalations: count in /afk-compact:status. Not any more; a real difference is still shown and counted.