Repository navigation
[Bug]: "Error: Usage refresh failed." #82
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Preflight checklist
- I searched existing issues and didn't find a duplicate.
- I'm on the latest version of the extension, or I've written my version below.
- I read the README's Troubleshooting section (proxies, history retention, the AI advice feature).
What happened?
I am unable to access the Settings panel or view the Usage screen.
It opens with the "Usage refresh failed. Retry or check diagnostic logs." error on the latest version of Claude Code Usage plugin in VS Code.
The Diagnostic Logs don't show any errors but the Developer Tools do:
The Usage bar itself DOES work, fetches and displays the right values:
[11:05:11] fetch: 200 https://api.anthropic.com/api/oauth/usage
[11:05:11] usage: ok — 5h=28%, wk=3%
It's just the main Usage panel that is completely unavailable for me.
console.ts:139 [Extension Host] Error loading usage records: TimestampProbeLimitError: invalid timestamp prefix limit exceeded
at readEarliestTimestamp (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\claudeUsageFiles.js:143:35)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\claudeUsageFiles.js:173:13
at async run (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\claudeUsageFiles.js:99:29)
at async Promise.all (index 2)
at async mapWithConcurrency (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\claudeUsageFiles.js:102:5)
at async sortUsageFilesByEarliestTimestamp (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\claudeUsageFiles.js:170:21)
at async ClaudeDataLoader.loadUsageRecords (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\dataLoader.js:472:28)
at async ClaudeCodeUsageExtension.runRefresh (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\extension.js:1003:28)
at async ClaudeCodeUsageExtension.refreshData (c:\Users\archo\.vscode\extensions\growthjack.claude-code-usage-2.2.1\out\extension.js:892:9)
What did you expect instead?
Usage element doesn't work at all since installation. I expected it to open.
Steps to reproduce
- Open the Dashboard. It doesn't open. :(
Extension version
2.2.1
Claude Code version
No response
VS Code version
1.130.0
Operating system
Windows
Model / proxy setup
native Anthropic
Diagnostic logs
[11:06:47] fetch: 200 https://api.anthropic.com/api/oauth/usage
[11:06:47] usage: ok — 5h=28%, wk=3%
refresh: trigger=focus files(discovered=937 changed=937 reused=0 removed=0 failed=1) io(bytes=0 lines=0) events(watcher=0 coalesced=0) ms(manifest=68.8 read-parse=88.1 aggregate-render=0.0 total=158.5)
refresh: trigger=poll files(discovered=937 changed=937 reused=0 removed=0 failed=1) io(bytes=0 lines=0) events(watcher=0 coalesced=0) ms(manifest=53.1 read-parse=99.0 aggregate-render=0.0 total=153.5)
refresh: trigger=focus files(discovered=937 changed=937 reused=0 removed=0 failed=1) io(bytes=0 lines=0) events(watcher=0 coalesced=0) ms(manifest=54.6 read-parse=119.1 aggregate-render=0.0 total=175.3)
refresh: trigger=focus files(discovered=937 changed=937 reused=0 removed=0 failed=1) io(bytes=0 lines=0) events(watcher=0 coalesced=0) ms(manifest=54.1 read-parse=107.5 aggregate-render=0.0 total=163.1)
refresh: trigger=focus files(discovered=937 changed=937 reused=0 removed=0 failed=1) io(bytes=0 lines=0) events(watcher=0 coalesced=0) ms(manifest=66.3 read-parse=100.1 aggregate-render=0.0 total=167.8)
Anything else?

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Jul 29, 2026
🤖 Automated first-pass reply
TL;DR
A specific JSONL file in
~/.claude/projectshas more than 1 MB of initial lines that lack a parsable"timestamp"string. ThereadEarliestTimestampprobe gives up withTimestampProbeLimitError, which crashes the entire usage-load pipeline. The status-bar usage bar works because it uses the separate OAuth API path.Analysis
src/claudeUsageFiles.ts:readEarliestTimestamp. It opens each JSONL file, reads line by line looking for the first line with a valid JSONtimestamp. If it doesn’t find one withinMAX_COMPLETED_INVALID_PREFIX_BYTES(1 MiB) of initial lines, it throwsTimestampProbeLimitError.sortUsageFilesByEarliestTimestamp→ClaudeDataLoader.loadUsageRecords→refreshData. One bad file poisons the whole load, so the dashboard never renders.failed=1among 937 files, matching a single problematic file.Suggested next step(s)
Immediate workaround
Find the offending JSONL file — likely a corrupted or unusually large session log — and move it out of
~/.claude/projects/**. A quick way to spot it:Look at the first few lines of any large candidate. If the opening lines aren’t valid JSON objects with a
timestampfield, that’s likely the culprit. Moving it aside should let the dashboard open.Proper fix
sortUsageFilesByEarliestTimestampshould catchTimestampProbeLimitError, log the skipped path (redacted for privacy), and fall back to the file’smtimeMs(already available in theUsageFileFingerprint) as a surrogate timestamp. That way a single corrupt file cannot block the whole panel.If you’re comfortable with a code change, the catch would go in
src/claudeUsageFiles.ts≈ line 171:and then use
result.timestampMs || entry.mtimeMswhen sorting.If you’d prefer a pre-built fix, please confirm your VS Code and OS versions (already listed) and we can prepare a patch release.
🤖 Generated by DeepSeek as an automated first pass — not a maintainer decision.
Carl723000 commentedon Aug 1, 2026
The reported
TimestampProbeLimitErroris fixed by the merged contributor PR #79 and is scheduled for v2.2.2.The fix makes timestamp probing fail soft for one problematic JSONL file instead of aborting the entire dashboard load, while preserving the established file ordering for the remaining records. Thank you for providing the exact Extension Host stack and anonymous refresh diagnostics; they made the failure reproducible.
We will keep this issue open until v2.2.2 is published and you have had a chance to confirm that the Usage and Settings panels open normally.
🤖 Generated with OpenAI Codex
Carl723000 commentedon Aug 7, 2026
v2.2.2 has now been released with the merged contributor fix from #79. A single unusual or unprobeable JSONL file now fails soft instead of aborting the entire Usage and Settings dashboard load.
I’m closing this as fixed in v2.2.2. If you can still reproduce
TimestampProbeLimitErroron v2.2.2, please reopen the issue and add the latest anonymousrefresh:lines.🤖 Generated with OpenAI Codex