Repository navigation
Lifetime token-counter receipts on the WSL authoring laptop, with what each counter actually counts - #270
Merged
seathatflowsinourveins merged 5 commits intoSep 25, 2026
Conversation
Four host receipts on wsl-authoring-20260923 for the token tools that keep an upstream savings counter, each read with the tool's own command: rtk gain (global and agent-lab project), context-mode's status line and persisted stats, jcodemunch-mcp get_session_stats over MCPorter, and headroom savings --json. Each receipt also checks what its counter means against the installed source: RTK counts uncapped bytes/4 and its ten largest commands hold most of the total; Context Mode's lifetime field is retained events x 256; Headroom's lifetime is a 30-day window. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…receipts A separate headless session re-ran every command and returned needs_changes on all four; the superseding generation follows. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Generation 2 of each receipt addresses the independent needs_changes findings: - RTK: count what Claude Code 2.1.282 actually shows (30,000 characters inline, otherwise a 2,000-character preview). This is 1.18% of the upstream total, not 2.1%, and is no longer called a bound. - Context Mode: add a sandboxed ctx_execute_file use, and check each formula statement exactly once in both builds. - jCodeMunch: assert the basis and a zero unattributed count, and show the resolved path and both registrations. - Headroom: show that the global ledger is absent rather than empty. Add an isolated MCP compress/retrieve positive control that increments an owned ledger, and check the 30-day clamp in code, not comments. Recorded at origin/main dcd6f0c. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Receipt counts change for rtk and headroom on linux-wsl2-x86_64; no platform_status changes (flip_rule_violations 0). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
seathatflowsinourveins
force-pushed
the
claude/token-lifetime-receipts-20260925
branch
from
September 25, 2026 19:09
1c6631d to
243b391
Compare
seathatflowsinourveins
marked this pull request as ready for review
September 25, 2026 19:12
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
seathatflowsinourveins
enabled auto-merge (squash)
September 25, 2026 19:12
seathatflowsinourveins
deleted the
claude/token-lifetime-receipts-20260925
branch
September 25, 2026 19:21
2 tasks done
seathatflowsinourveins
added a commit
that referenced
this pull request
Sep 25, 2026
- RTK: when rtk_database is configured, the global snapshot adds a client_visible view. It re-counts each retained row as a client first shows the output: whole up to 30,000 characters, otherwise a 2,000-character preview (Claude Code 2.1.282 defaults, overridable). It reports the top-10 share and the net, and the boundary text says so. The view is a model: it excludes later reads of saved files, and Codex has its own limits. - Headroom: record ledger_present from the path the report itself names. An absent ledger is labelled rather than read as a measured zero. - Coverage-matrix boundaries and the README say the same, including Context Mode's lifetime = retained events x 256. Evidence: the independently reviewed host receipts in #270. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
seathatflowsinourveins
added a commit
that referenced
this pull request
Sep 25, 2026
…client-visible RTK view, Headroom ledger presence) (#282) * Token report: state what the RTK and Headroom counters actually count - RTK: when rtk_database is configured, the global snapshot adds a client_visible view. It re-counts each retained row as a client first shows the output: whole up to 30,000 characters, otherwise a 2,000-character preview (Claude Code 2.1.282 defaults, overridable). It reports the top-10 share and the net, and the boundary text says so. The view is a model: it excludes later reads of saved files, and Codex has its own limits. - Headroom: record ledger_present from the path the report itself names. An absent ledger is labelled rather than read as a measured zero. - Coverage-matrix boundaries and the README say the same, including Context Mode's lifetime = retained events x 256. Evidence: the independently reviewed host receipts in #270. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Resolve the independent review of the token report semantics - RTK: state the floor at zero (max(0, raw - filtered)) and why the signed client view differs from it. - Name the Claude Code 2.1.282 defaults and list the model's assumptions: ASCII, preview at most, wrapper text and saved-file reads not counted, script rows included. - Validate the client limits (inline 4000-128000). - Report shares as n/a on a zero total. - Omit the view with an issue when the configured database holds fewer rows than rtk gain reported. - View problems (sqlite, value, type, OS) are the view's own issues and no longer fail the rtk gain counter. - Headroom: use only the path the report names, resolve a relative path from the configured project (Headroom's working directory), and label an absent ledger only when the reading is zero. - HTML: the RTK card shows the client-visible net and the reporter's boundary; the Headroom card marks an absent ledger and shows its boundary. - Tests pin the inline limit (<=), ceil, the top-ten ranking, zero totals, overrides, the mismatch and error paths, the Headroom path branches and connection closing. Seven targeted mutations are killed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Resolve the second review of the token report semantics - The component-table RTK boundary states max(0, raw - filtered). - The boundary says "by default" only when both client limits are the Claude Code 2.1.282 defaults, and the preview must stay below the inline limit. - The row cross-check allows 1% fewer rows than rtk gain counted, for retention pruning between the two reads. - Tests cover the configured-limits wording, the preview limit and the pruning tolerance. A real-host refresh with the revised code exited 0 with no issues and a client_visible block. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Pin the 1% row tolerance and state what it does not detect Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> * Re-register the token report hashes Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> --------- Co-authored-by: seathatflowsinourveins <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
wsl-authoring-20260923) for the four token tools that keep an upstream savings counter: RTK, Context Mode, jCodeMunch and Headroom.dcd6f0cf(origin/main). Generation 2 was recorded at this commit in a detached worktree.lane:foundationevidence/hosts/wsl-authoring-20260923/: 4 generation-1 receipts plus 4 generation-2 receipts that supersede themcatalogs/landscape/component-evidence-matrix.jsonanddocs/component-evidence-matrix.mdmanifests/evidence.json, in the last commit under the hot-file protocolWhat the counters mean (generation 2,
native_proven, independently reviewed: agree ×4)rtk gain --format json;--projectceil(bytes/4)of raw output minus that of filtered output, floored at zero, uncapped. The ten largest commands hold 74.4% and onegrep28.7%. Claude Code 2.1.282 shows up to 30,000 characters inline, otherwise a saved file with a preview of at most 2,000 characters. Modelled on what the client would show first, the net is 8.77M (1.18%). This is the receipt's own model, not a bound, and it excludes later reads of saved files.stats-*.jsontokens_saved_lifetime= retained session events × 256, both in the plugin bundle Claude runs and in the ecosystem build. It is not a byte measurement. A sandboxedctx_execute_fileuse returned the host-computed count and sha256 exactly.order→get_session_stats(MCPorter stdio)bytes/4counterfactual on one unmixed basis. All of it is fromget_symbol_sourcesince 2026-09-20, including acceptance reads. The Claude and Codex agent-lab registrations launch the same binary and index.headroom savings --jsonlifetimefield is clamped to 30 days in code.These are upstream estimates with different bases and scopes. They are not provider token measurements, and they must never be summed.
Independent review
68da9901…. It re-ran every command and recorded its verdicts withscripts/host_receipts.py review.Local commands run
The matrix changes only receipt counts for rtk and headroom on
linux-wsl2-x86_64: pass, independently reviewed pass, dissented and latest. Noplatform_statuschanges.Checklist
python3 scripts/host_receipts.py validatepasses.platform_statuschange is made from a host receipt alone.🤖 Generated with Claude Code