pub struct FileUsageSummary {
pub mtime: SystemTime,
pub size: u64,
pub folded_project: String,
pub project_resolved: bool,
pub by_model_day: BTreeMap<String, BTreeMap<String, TokenCounts>>,
}Expand description
One session file’s deduped usage, keyed model -> day -> counts.
mtime + size drive the incremental cache: an unchanged file is
reused rather than re-parsed. folded_project is the repo the file
belongs to, folded from its ~/.claude/projects/<slug> dir name.
Fields§
§mtime: SystemTime§size: u64§folded_project: String§project_resolved: boolWhether folded_project is final. False only for the guess made
when the repo is not checked out: that guess is re-derived on
cache reuse, since a session file’s mtime never changes to force
a re-parse once the checkout comes back. Rows written before this
field existed default to false and so heal on the next scan.
by_model_day: BTreeMap<String, BTreeMap<String, TokenCounts>>Implementations§
Source§impl FileUsageSummary
impl FileUsageSummary
Sourcepub fn refresh_unresolved_project(&mut self, path: &Path)
pub fn refresh_unresolved_project(&mut self, path: &Path)
Re-derive folded_project when it was only a guess, folding the
slug dir of path (the session file this summary was cached
for) afresh. Costs one fold and never a re-parse, so reusing a
cached summary still picks up a repo checked out since.