desktop

package
v0.154.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package desktop reads the plan-usage history the Claude desktop app keeps on disk, so the dashboard can say whether your plan limits were spent somewhere other than Claude Code.

What this can and cannot tell you is the whole design constraint. The file holds nothing but a timestamp and two percentages — the five-hour and seven-day plan windows. There are no tokens, no cost, and no conversation content, so this can never say what the desktop app *cost*; it can only say how much of a window it consumed. Presenting it as anything more would be an invented number (engineering rule 6).

It is also written only while the app is running: on a real machine that meant 27 samples in a day where a five-minute interval would give ~290. So the reading is reported with its age, and a stale one says so rather than implying the number is current.

Nothing is stored. This is read on request, from a file the user's own machine already has — no new outbound call, no new database table.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailable = errors.New("no Claude desktop usage history on this machine")

ErrUnavailable means there is no readable history — the app is not installed, has never run, or keeps its data somewhere this build does not know about. It is not a failure: most users do not use the desktop app at all.

View Source
var Now = time.Now

Now is indirected for tests.

Functions

This section is empty.

Types

type Reading

type Reading struct {
	// FiveHourPct and SevenDayPct are percentages of each plan window, 0-100.
	FiveHourPct int `json:"five_hour_pct"`
	SevenDayPct int `json:"seven_day_pct"`
	// At is when the app took the sample (unix ms).
	At int64 `json:"at"`
	// Stale is true when the sample is old enough that it likely predates the
	// app being closed, so the figure describes the past rather than now.
	Stale bool `json:"stale"`
}

Reading is the most recent plan-usage sample the desktop app recorded.

func Latest

func Latest() (Reading, error)

Latest returns the newest usable sample, or ErrUnavailable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL