File Discovery
ccusage automatically searches for configuration files in the following locations (highest priority first):- Local project config:
.ccusage/ccusage.jsonin current directory - User config directories:
ccusage.jsonin Claude data directories~/.config/claude/ccusage.json(XDG config directory)~/.claude/ccusage.json(legacy directory)- Custom paths from
CLAUDE_CONFIG_DIRenvironment variable
The first valid configuration file found is used. Lower priority locations are ignored.
File Format
Configuration files use JSON format with optional schema validation:Schema
Optional JSON schema URL for IDE validation and autocomplete.
Default options applied to all commands. Any CLI option can be set here.
Command-specific options that override defaults. Keys are command names (daily, monthly, session, blocks, statusline).
Priority Order
Options are merged with the following priority (highest to lowest):- CLI arguments - Explicitly provided flags
- Command config - Command-specific settings in config file
- Defaults config - Default settings in config file
- Built-in defaults - Framework defaults
Only explicitly provided CLI arguments override config settings. Default values from argument definitions do not override config.
Examples
Development Configuration
For local development with offline mode and debugging:.ccusage/ccusage.json
Production Configuration
For production environments with JSON output:~/.config/claude/ccusage.json
Timezone-Specific Configuration
For users in different timezones:~/.claude/ccusage.json
Minimal Configuration
Simple config with just a few common options:.ccusage/ccusage.json
Using Custom Config Path
You can specify a custom configuration file location:Validation
ccusage validates configuration files during loading:- Valid structure: Must be valid JSON with correct schema
- Type checking: Options must have correct types (boolean, string, number)
- Graceful errors: Invalid files are skipped with warnings
Available Options
All CLI options can be used in config files. Common options include:json(boolean) - JSON output formatmode(string) - Cost calculation mode: auto, calculate, displayoffline(boolean) - Use cached pricing databreakdown(boolean) - Show per-model breakdownorder(string) - Sort order: asc, desctimezone(string) - Timezone for date groupinglocale(string) - Locale for formattingdebug(boolean) - Enable debug outputdebugSamples(number) - Number of debug samplescolor(boolean) - Enable colored outputnoColor(boolean) - Disable colored outputcompact(boolean) - Compact display mode