Skip to content

Add session token efficiency scanner#55

Merged
cbusillo merged 1 commit into
local/cbusillo-overlayfrom
token-efficiency-scanner
May 12, 2026
Merged

Add session token efficiency scanner#55
cbusillo merged 1 commit into
local/cbusillo-overlayfrom
token-efficiency-scanner

Conversation

@cbusillo
Copy link
Copy Markdown
Owner

Summary

  • add a deterministic read-only scanner for Every Code rollout/session token-efficiency suspects
  • report peak cumulative tokens, largest turns, cache ratio, token resets, image payloads, large persisted records, duplicated instruction blocks, and optional usage correlation
  • document the no-LLM-by-default policy and add a focused synthetic rollout test

Evidence

Running against recent May 11 sessions identified:

  • 152.7 MB of persisted data:image payloads in a 165 MB rollout
  • duplicated project-doc/skill injection blocks across multiple sessions
  • several 200k+ token single-turn events

Validation

  • python3 -m unittest tools/session-token-scan/test_scan.py
  • python3 -m py_compile tools/session-token-scan/scan.py tools/session-token-scan/test_scan.py
  • python3 tools/session-token-scan/scan.py ~/.code/sessions/2026/05/11 --limit 20 --top 5
  • python3 tools/session-token-scan/scan.py ~/.code/sessions/2026/05/11/rollout-2026-05-11T18-37-18-3f238f4d-f245-4f65-aa53-4dee95ba7758.jsonl --json --top 2
  • ./build-fast.sh

Closes #44

@cbusillo cbusillo merged commit ce9983c into local/cbusillo-overlay May 12, 2026
1 check passed
@cbusillo cbusillo deleted the token-efficiency-scanner branch May 12, 2026 13:09
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.

Build rollout/session token-efficiency scanner

1 participant