Skip to content

v0.18.0: freeze-safe cache expiry, 7d hybrid reset, ≡ cache glyph - #3

Merged
lroolle merged 4 commits into
mainfrom
feat/v0.18.0-cache-expiry-deadline
Jul 27, 2026
Merged

v0.18.0: freeze-safe cache expiry, 7d hybrid reset, ≡ cache glyph#3
lroolle merged 4 commits into
mainfrom
feat/v0.18.0-cache-expiry-deadline

Conversation

@lroolle

@lroolle lroolle commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Prompt-cache expiry detection — "quiet until it bites": auto stays silent while healthy (the deadline is always ~1 TTL out during active work, pure noise), speaks only on actual rewrites: ≡!419k on resume after idle > TTL, bold red past 200k tokens (premium-band miss), ≡~ while rebuilding. --cache always adds the freeze-safe deadline ≡@15:20.
  • Anchor-slide fix — activity timestamp re-stamps only when cache usage numbers change, not on vim/permission/model renders that carry stale data.
  • 7d hybrid reset@Nd while >= 24h out (decays mildly, one day/day), wall-clock @04:00 inside the last day. Fixes the third decaying-countdown bug.
  • ≡ cache glyph (U+2261) — triple bar reads as stacked cache layers; one terminal column, slim, terminal-safe. Replaces the hourglass ⧗.
  • TTL defaults mirror the CLI's own rule (1h subscriber, 5m API-key).

Test plan

  • 266/266 bats tests pass (cache indicator suite rewritten + 7d hybrid tests)
  • shellcheck -S error clean
  • No sensitive content in staged files (commit privacy gate checked)
  • Manual: confirm renders correctly in target terminal fonts (iTerm2, kitty, Alacritty)
  • Manual: idle > 1h on a live session, confirm ≡!Nk fires on resume

🤖 Generated with Claude Code

Prompt-cache expiry warning that survives idle gaps. Claude Code
re-renders the statusline only on activity -- nothing can appear
during the idle gap where the cache actually dies, and while active
the cache is always ~1 TTL from expiry. So auto stays silent while
healthy and speaks only on actual rewrites:

- ≡!419k on resume after a gap > TTL (idle-expiry break detection)
- Bold red past 200k (premium-band miss)
- ≡~ while a large prefix rebuilds
- --cache always keeps freeze-safe deadline ≡@15:20

Anchor-slide fix: activity timestamp re-stamps only when usage
numbers actually change (vim/permission/model renders carry stale
usage). Break hold: 60s wall-clock so debounce can't erase the
one frame that caught the rewrite.

7d badge goes hybrid: @nd while >= 24h out, wall-clock @04:00
inside the last day. Fixes the third decaying-countdown bug
(after 5h in v0.6 and v0.11).

Cache glyph: ≡ (U+2261, triple bar / stacked cache layers) --
one terminal column, slim, terminal-safe, semantically clear.

docs/devlog/ gitignored -- working notes, not project content.

266 bats tests, shellcheck -S error clean.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lroolle
lroolle force-pushed the feat/v0.18.0-cache-expiry-deadline branch from 8c6cce2 to 0439bec Compare July 17, 2026 10:31
lroolle and others added 3 commits July 27, 2026 09:30
One ~/.claude used to imply one account; deva-style runners bind-mount
a different .credentials.json per container over the same shared config
home, and the account-scoped caches bled across accounts: B rendered
A's 5h/7d bars whenever A fetched last, profile.cache stuck to the
first account for 24h. Tokens rotate, so the credentials file cannot
identify itself — the runner says who the session is.

- STATUSLINE_ACCOUNT (explicit) or DEVA_AUTH_TAG (deva --auth-with)
  resolve to an account tag; sanitized before touching any path
- user segment renders @tag chip; tag beats profile display name
  (two accounts can carry the same human name)
- account state moves to accounts/<tag>/ under the shared statusline
  dir: same-account sessions share one fetch, different accounts stop
  clobbering each other; auth-default and explicit CLAUDE_DATA_DIR /
  CLAUDE_CACHE_DIR overrides change nothing
- chip also renders for api-key/custom-endpoint sessions that skip the
  OAuth quota block — the sessions only a tag can tell apart
- legacy-state migration never lands in a tagged account dir
- tests: 3 unit + 6 integration; helpers unset host DEVA_AUTH_TAG so
  suites running inside tagged deva containers stay hermetic

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An all-dim ≡ badge disappears next to the bright context bar (reported
in real use). building: yellow glyph, dim meta; ok under --cache always:
white glyph, dim deadline. Pages demo updated to match.
@lroolle
lroolle merged commit 07217bf into main Jul 27, 2026
1 check failed
@lroolle
lroolle deleted the feat/v0.18.0-cache-expiry-deadline branch July 27, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant