Skip to content

Claude Code 2.1.x catch-up + honest accounting

Latest

Choose a tag to compare

@Abinesh-L Abinesh-L released this 31 Aug 09:00

Correct totals. One API response split across several JSONL lines is now counted once (it was over-counted 2.4x to 3.4x, with Tools and Retrieved inflated most). Resume replays are deduplicated by uuid, and phantom system records no longer count as messages.

Correct window size. fable-5 and opus-5 sessions, the [1m] model in settings.json, the statusline payload's context_window_size, and pasted /context output all feed context-limit detection. A fresh 1M session no longer reads as 81% hot.

Correct compaction math. Auto-compaction is modelled as a 33K-token headroom buffer (83.5% of a 200K window, 96.7% of 1M) instead of a flat 80%; the window total includes the last response; compaction events use Claude Code's own postTokens and trigger (auto/manual).

System bucket restored. The fixed Claude Code context (system prompt, core tool schemas, memory, skills, hooks) is derived again instead of being discarded above 15K.

New record types. Attachment records (hook output, skill and tool listings, task reminders, nested CLAUDE.md, memory files) are classified; non-human user records (task notifications, slash-command wrappers, skill bodies) no longer masquerade as your prompt.

Tool catalogue rebuilt. Placeholder tool names removed; PowerShell, Workflow, ScheduleWakeup and ToolSearch-loaded deferred tools recognised; MCP servers discovered from ~/.claude.json, plugins, and the session itself.

Plus:

  • calibrate parses the current /context table format.
  • Buckets now reconcile to the API window total and expose raw contentTokens; trend records carry bucketBasis.
  • Auto-inject advisory: same prefix, headroom-based default gate, corrected explanation of when Claude Code compacts.

Fully offline, zero API calls, as always.

Upgrade notes

  • JSON consumers: bucket tokens now sum to total_tokens exactly; the raw classifier estimates moved to contentTokens per bucket. reconciliation.basis says which basis a view is on.
  • COMPACTION_THRESHOLD is gone; the trigger is context_limit - 33,000 (override via autocompactBufferTokens in ~/.claude-crusts/config.json).
  • Auto-inject without an explicit threshold in config now fires near the real auto-compaction trigger instead of at 70% usage. Set threshold explicitly to keep the old behaviour.