Logging
Control logging verbosity for ccusage output. Higher values show more detailed logs.Available levels:
0- Silent (no output except results)1- Warn (warnings only)2- Log (standard logging)3- Info (informational messages)4- Debug (detailed debugging)5- Trace (very verbose tracing)
Silent mode (
LOG_LEVEL=0) is useful for scripting where you only want the output data.Data Directory
Specify custom Claude data directory path(s). Supports single or multiple comma-separated paths.Default behavior (when not set):Structure requirements:
- Searches
~/.config/claude/(new default, XDG config directory) - Falls back to
~/.claude/(legacy directory) - Uses first valid directory with
projects/subdirectory
Each path must contain a
projects/ subdirectory to be considered valid. Usage data from all valid directories is automatically aggregated.Output Formatting
Force colored output even when stdout is not a TTY (e.g., when piping output).
This has the same effect as the
--color CLI flag. Both are handled by picocolors.Disable colored output globally. Takes precedence over
FORCE_COLOR.This follows the NO_COLOR standard (https://no-color.org) and has the same effect as the
--no-color CLI flag.Examples
Development Environment
Typical development setup with debugging and custom paths:.env or shell profile
CI/CD Environment
Production environment with minimal output:GitHub Actions / CI config
Multiple Claude Installations
Aggregating data from multiple Claude Code installations:Script Usage
Using environment variables in scripts:Debugging Configuration
Use debug logging to verify environment variable configuration:Environment Variable Priority
When multiple configuration methods are used:- CLI flags - Highest priority
- Environment variables - Medium priority
- Config files - Lower priority
- Built-in defaults - Lowest priority
For example,
--no-color flag overrides NO_COLOR environment variable, which overrides noColor in config file.Related
- CLI Options - Command-line flags and options
- Config Files - JSON configuration files
- Custom Paths - Managing multiple Claude installations