Expand description
Best-effort, local-only Claude Code context-window discovery.
Claude Code transcripts are an undocumented JSONL surface, so this module deliberately treats every line as optional data. It reads only bounded tails, ignores unknown/corrupt records, never follows discovered symlinks, and reports unknown usage instead of fabricating zero. A compaction record after the latest usage invalidates that reading until another assistant response supplies the new context size.
Structs§
Enums§
Constants§
- MAX_
SESSIONS - The overlay is a recent-session monitor, not an unbounded history browser.
Functions§
- default_
projects_ path - Resolve Claude Code’s conventional local transcript directory without reading it. Kept separate so tests always inject their own root.
- sanitize_
display - Strip terminal control characters and cap untrusted transcript labels before they enter ratatui’s backing buffer.
- scan_
dir - Scan the most recently modified top-level session transcripts below
root. Subagent sidechains are excluded, and discovered symlinks are never followed. The caller should run this blocking filesystem work on Tokio’s blocking pool.