Skip to content

Goose Data Source (Experimental) ​

Goose support is experimental. ccusage can read Goose session usage from its local SQLite database. Goose is a local AI agent, and ccusage only opens the database read-only.

Quick Start ​

bash
ccusage goose daily
ccusage goose monthly
ccusage goose session

Goose is also included in unified reports when a supported database is detected:

bash
ccusage daily

Data Locations ​

By default, ccusage checks these Goose database locations:

text
~/.local/share/goose/sessions/sessions.db
~/Library/Application Support/goose/sessions/sessions.db
~/.local/share/Block/goose/sessions/sessions.db

Set GOOSE_PATH_ROOT when Goose is stored somewhere else:

bash
GOOSE_PATH_ROOT="/path/to/goose" ccusage goose daily

With GOOSE_PATH_ROOT set, ccusage reads:

text
$GOOSE_PATH_ROOT/data/sessions/sessions.db

Token Mapping ​

ccusage reads Goose session rows with model configuration and token columns:

Goose columnccusage field
accumulated_input_tokens or input_tokensInput tokens
accumulated_output_tokens or output_tokensOutput tokens
accumulated_total_tokens or total_tokensTotal tokens
total - input - output, when positiveReasoning/extra use
model_config_json.model_nameModel
provider_name, when present, otherwise model hintProvider

Goose does not expose cache read/write token columns in this database, so cache columns are reported as zero.

Cost Calculation ​

Goose rows do not store recorded USD cost, so ccusage estimates cost from token counts and LiteLLM pricing. Any positive total-token remainder beyond input and output is treated as output-priced usage for cost estimation.

Use --offline to rely on cached pricing data:

bash
ccusage goose daily --offline

Troubleshooting ​

If no Goose data appears, check that the SQLite database exists at one of the default paths or set GOOSE_PATH_ROOT.

bash
GOOSE_PATH_ROOT="/path/to/goose" ccusage goose session --json

Released under the MIT License.