Skip to content

v0.21.0: check + session-summary — the advisor, wired into your world - #7

Closed
lroolle wants to merge 7 commits into
mainfrom
feat/check-session-summary
Closed

v0.21.0: check + session-summary — the advisor, wired into your world#7
lroolle wants to merge 7 commits into
mainfrom
feat/check-session-summary

Conversation

@lroolle

@lroolle lroolle commented Jul 29, 2026

Copy link
Copy Markdown
Member

Stacked on #6 (merge that first; this PR's base is feat/waste-ledger).

What

Two subcommands that take the advisor beyond the render loop — the statusline never runs when you're away, which is exactly when expiring capacity needs a voice. Still no daemon: we provide the judgment, the host provides the plumbing.

statusline.sh check — the advisor as an exit code:

$ statusline.sh check
+ 7d resets @00:00, 50% unused — ~49% expires even at full burn
$ echo $?
1    # 0 calm | 1 opportunity (+) | 2 pressure (!) | 3 unknown/stale

Wire it into tmux (status-right '#(statusline.sh check)'), cron notifiers, or CI. Staleness guard follows the state-dir contract (>1h = "unknown", not stale numbers presented as now). Model context for scoped clauses comes from the last logged snapshot — the first consumer of #6's widened model field.

statusline.sh session-summary — one-line session retrospectives, designed as a SessionEnd hook (hook JSON on stdin; bare runs summarize the last logged session):

session 8f3c02aa: 3h12m, 5h +34pts, 7d +4pts, claude-fable-5

Window deltas are positive-delta sums (the profile builder's rule), so sessions straddling a 5h reset report what they actually consumed.

Verification

  • 334/334 bats (7 new: 4 check exit paths, 2 session-summary, 1 end-to-end integration), shellcheck at baseline (0 new warnings)
  • README gains a "Scripting" section with cron/tmux/hook recipes

🤖 Generated with Claude Code

lroolle and others added 3 commits July 28, 2026 22:53
…input

jq's `catch .` binds the error MESSAGE as the value, not the original
input. Snapshots with an empty or unparseable five_hour.resets_at all
normalized to the same error string — one shared fake window identity —
so the pct_per_window pair walk could pair samples across real windows.
Observed on real data: phantom window transitions and a skewed ratio
(9.91 -> 10.06 after the fix on the same log).

Normalize via a named def that treats empty as empty and falls back to
the raw string on parse failure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
`statusline.sh report [--days N]` replays usage.jsonl and ledgers every
closed window: 7d closes as used%/expired% (converted to 5h-windows-worth
via the learned pct_per_window ratio), 5h closes as count/avg/capped,
plus the week in progress projected with the same learned walk the
advisor uses — the surfaces cannot disagree. A window closes when
consecutive samples disagree on resets_at, normalized to the minute
(the ratio learner's identity rule). The advisor prevents waste
prospectively; this proves it retroactively.

Every usage snapshot now also logs limits[] (scoped weekly caps,
verbatim), model (id active in the logging session), and predicted_end —
the learned walk's projection at sample time, the calibration seed that
lets closed windows score the forecast later. Learning lags logging by
weeks; a field absent today is a pattern that can't be learned next
month.

Subcommands dispatch after all function definitions, take no stdin, and
are read-only against the state dir.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CHANGELOG entry, README section with a real ledger example, state-dir
contract gains the widened usage.jsonl fields (limits, model,
predicted_end) and names report as the reference consumer, counts
synced to 327 tests across README / llms.txt / site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
lroolle and others added 3 commits July 28, 2026 23:04
Stacked PRs (base = a feature branch) got no checks under the
branches:[main] filter; judgment should not depend on where a PR
points. Push triggers stay main-only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The statusline never runs when you're away — exactly when expiring
capacity needs a voice. Instead of a daemon, `check` exposes the
advisor's judgment as an exit code (0 calm / 1 opportunity / 2 pressure
/ 3 unknown-or-stale) with the plain verdict on stdout, for tmux
segments, cron notifiers, and scripts. Model context for the scoped
clauses comes from the last logged snapshot — the first consumer of the
widened `model` field.

`session-summary` gives one-line session retrospectives from the usage
log, designed as a SessionEnd hook (hook JSON on stdin, only session_id
read; bare runs fall back to the last logged session). Window deltas
are positive-delta sums — the profile builder's rule — so a session
straddling a 5h reset still reports what it consumed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README scripting section (cron + tmux + SessionEnd hook recipes),
CHANGELOG entry, counts synced to 334 tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle force-pushed the feat/check-session-summary branch from cccc810 to 88dd3dd Compare July 29, 2026 06:05
Base automatically changed from feat/waste-ledger to main August 10, 2026 05:30
@lroolle
lroolle deleted the branch main August 10, 2026 05:30
@lroolle lroolle closed this Aug 10, 2026
Three layers, one source of truth: line 1 shows the numbers, the
advisor row says the one sentence, and this skill carries the full
conversation — should I start a heavy task, which account has headroom,
what did I waste this week. It encodes the state-dir contract, the
learned-forecast semantics, and the advisor's judgment rules
(feasibility before advice, facts only while unlearned, staleness said
out loud), and runs the same report/check subcommands instead of
re-mining — so the layers cannot disagree.

Install: cp -r skills/usage-insight ~/.claude/skills/

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@lroolle lroolle reopened this Aug 10, 2026
lroolle added a commit that referenced this pull request Aug 10, 2026
Squashed recovery of the stacked train after #8 landed on its parent
branch instead of main: check + session-summary advisor integration
(v0.21.0) and the usage-insight skill / agent surface (v0.22.0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle

lroolle commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Content landed on main via squash of feat/check-session-summary (which carried both #7 and #8 after the mis-based merge): see main history. Closing.

@lroolle lroolle closed this Aug 10, 2026
@lroolle
lroolle deleted the feat/check-session-summary branch August 10, 2026 05:34
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