Repository navigation
Count Claude Cowork sessions in cost history - #960
Merged
Merged
Conversation
added 3 commits
October 21, 2026 12:29
Cost discovery admits Cowork audit.jsonl files and the Desktop project stores under %APPDATA%\Claude and the MSIX package stores, for the default Claude history only. A mapped token account or a set CLAUDE_CONFIG_DIR leaves them out. An incomplete discovery walk counts as an unreadable root.
Cover audit file dedupe, ignored result rows, chart and daily consistency, the mapped-account and CLAUDE_CONFIG_DIR exclusions, live discovery staying project-only, and incomplete discovery when the clock or the entry cap runs out.
Describe Cowork inclusion, the default-history-only rule, the Desktop discovery budget and the unavailable state after an incomplete walk.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 25 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
added 2 commits
October 21, 2026 12:50
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.
Summary
Ports upstream CodexBar steipete#3209 (Cowork audit transcripts in Claude cost history) to Windows. Upstream steipete#4598, its 0.79 follow-up steipete#4667, and steipete#4617 are reviewed and not ported: they change a persisted Claude cost cache that Windows does not have.
local-agent-mode-sessions/**/audit.jsonlregular files, beside the Desktop project stores. Symbolic links are never followed. Live-session discovery output is unchanged.%APPDATA%\Claudeand each Microsoft Store (MSIX) package store, reusing the existingmsix_store_dirshelper from the browser module.CLAUDE_CONFIG_DIRis unset or blank and no token account is mapped. This mirrors upstreamcostProjectsRoots.resultrows, which hold session totals, are never counted..jsonlroot is read directly. Any other file root counts as unreadable.docs/PROVIDERS.mdgains a Claude local cost history section.Windows differences and not ported
~/.claude/projectsgives a ~650 MB floor, ~1.2 GB bursts every 15–20 min, and daily disk-write reports (0.74–0.76) steipete/CodexBar#4598 / perf(claude): lower peak memory during incremental cache refreshes steipete/CodexBar#4667 (incremental shard persistence and memory): not ported. Windows has no persisted Claude cost cache.cost_scanner.rsdocuments that Claude has no persisted cost-report cache on Windows, andtoken_activity.rskeeps results only in an in-memory timed memo. Adding one would be new cache infrastructure, not a port, so no cache version or atomic cache write was added.Commands run
cargo fmt --all -- --check: cleancargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: cleancargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings: cleancargo test --manifest-path rust/Cargo.toml: 5093 passed, 0 failed, 2 ignoredcost_scanner::243 passed;agent_sessions::64 passed;claude_cowork1 passed (child-process fixtures, default andCLAUDE_CONFIG_DIRcases)cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml: 755 passed, 0 failedTest coverage for the change:
claude_cowork: Cowork dedupe against CLI transcripts,resultrows ignored, chart and daily totals match the summary, a mapped token account excludes Cowork, and a setCLAUDE_CONFIG_DIRexcludes Cowork.agent_sessions::tests: cost discovery admits audit files, live discovery stays project-only, and an expired clock or an exhausted entry cap reports incomplete.cost_scanner::claude_roots: merging Desktop roots de-duplicates by resolved path, an incomplete walk is a read failure, and only an unset or blank config dir takes Desktop roots.No UI proof: no frontend file changed, and the change is backend-only. Discovery of real Desktop folders was not exercised on a machine with a live Cowork install; the tests use temp directories through injected application-data roots.