ccusage supports flexible data directory configuration to handle multiple Claude Code installations, custom paths, and different deployment scenarios.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ryoppippi/ccusage/llms.txt
Use this file to discover all available pages before exploring further.
Default Behavior
Without any configuration, ccusage automatically searches for Claude data in standard locations:- XDG config directory:
~/.config/claude/projects/(new default) - Legacy directory:
~/.claude/projects/(old default)
Both directories are checked automatically. Usage data from all valid directories is aggregated.
Single Custom Path
To use a custom Claude data directory, set theCLAUDE_CONFIG_DIR environment variable:
The custom path must contain a
projects/ subdirectory with JSONL files for ccusage to recognize it as valid.Multiple Claude Installations
ccusage can aggregate data from multiple Claude Code installations by specifying comma-separated paths:- Development and production environments
- Multiple user accounts
- Backup/archive directories
- Team-wide usage aggregation
Example: Dev + Prod Tracking
Directory Structure Requirements
Each Claude data directory must follow this structure:The
projects/ subdirectory is required. Directories without this subdirectory are ignored with a warning.Path Resolution
ccusage resolves paths in the following order:-
Environment variable set: Uses only
CLAUDE_CONFIG_DIRpaths- Validates each path has
projects/subdirectory - Errors if no valid paths found
- Ignores default paths entirely
- Validates each path has
-
No environment variable: Uses default paths
- Checks
~/.config/claude/projects/ - Checks
~/.claude/projects/ - Uses first valid directory found
- Errors if neither exists
- Checks
Priority Rules
Configuration File Discovery
When using custom paths, configuration files are searched in:- Local project:
.ccusage/ccusage.json(current directory) - Each custom path:
$CLAUDE_CONFIG_DIR/ccusage.json - Default paths:
~/.config/claude/ccusage.json,~/.claude/ccusage.json
Common Scenarios
Scenario 1: Docker Container
Mount Claude data directory into container:Dockerfile
Run container
Scenario 2: Network Storage
Access Claude data from network-mounted storage:Scenario 3: Multi-User System
Aggregate usage from multiple user accounts:Team usage script
Scenario 4: CI/CD Pipeline
Track usage in automated environments:GitHub Actions
Troubleshooting
Path Not Found Error
Multiple Paths Not Working
Permission Issues
Debugging Paths
Use debug mode to see which paths are detected:Related
- Environment Variables - Full environment variable reference
- Config Files - Configuration file locations and formats
- CLI Options - Command-line options