Enabling cost tracking
Pass--output-cost with any command to write a CSV file of usage details:
PDD_OUTPUT_COST_PATH is set, all commands write to that path by default. The --output-cost flag overrides it for individual runs.
CSV output format
Each row in the CSV corresponds to one command execution:| Column | Description |
|---|---|
timestamp | Date and time of the command execution |
model | LiteLLM model identifier used for the operation |
command | PDD command that was executed (e.g., generate, fix) |
cost | Estimated cost in USD (e.g., 0.05 for 5 cents). Zero for local models or operations with no LLM call. |
input_files | Comma-separated list of input files involved |
output_files | Comma-separated list of files generated or modified |
Cost calculation factors
PDD calculates costs using LiteLLM’s provider pricing tables, updated regularly. Three factors drive cost:- Model strength (
--strength) — Higher strength selects more capable (and more expensive) models by ELO rating - Input size — Longer prompts, larger code files, and more dependencies increase token usage
- Operation complexity — Commands with iterative loops (
fix,sync,crash) may invoke the LLM multiple times per run
Controlling cost with --strength
--strength is a 0.0–1.0 dial that selects the model tier for any command:
| Value | Model tier |
|---|---|
0.0 | Cheapest available model |
0.5 | Default base model (balanced cost and quality) |
1.0 | Most powerful model (highest ELO, highest cost) |
.pddrc:
Budget limits
Commands that run iterative loops accept a--budget flag to cap total spend:
| Command | Default budget |
|---|---|
sync | $20.00 |
fix (loop) | $5.00 |
crash (loop) | $5.00 |
verify | $5.00 |
change (manual) | $5.00 |
.pddrc per context:
Core dump for debugging
If a command produces unexpected results, capture a debug bundle that can be replayed and reported:--core-dump is set, PDD:
- Records the full CLI command and arguments
- Captures relevant logs and internal trace information
- Bundles prompts, generated code, and metadata needed to replay the issue
.pdd/core_dumps/pdd-core-....json).
Reporting a bug with report-core
Attach the bundle to a GitHub issue automatically:
--api, PDD collects all relevant files, creates a private GitHub Gist, and links it in the issue body. Authentication uses the GitHub CLI (gh auth token), GITHUB_TOKEN, or GH_TOKEN in that order.