Skip to main content

Overview

pdd crash fixes errors in a code module and its calling program that caused a program to crash at runtime. It modifies the code file, and optionally the program file, until the module runs without errors. How crash differs from fix and verify:
CommandTriggered byFixes
pdd crashRuntime errors (the program fails to run)Code and program files
pdd fixUnit test failuresCode and test files
pdd verifyOutput mismatch (LLM judgment)Code and program files

Usage

pdd [GLOBAL OPTIONS] crash [OPTIONS] PROMPT_FILE CODE_FILE PROGRAM_FILE ERROR_FILE
Arguments:
  • PROMPT_FILE — Prompt file that generated the code module.
  • CODE_FILE — Code module that caused the crash. This file is modified until it runs correctly.
  • PROGRAM_FILE — Program that was running the code module. This file is also modified if necessary to fix the crash.
  • ERROR_FILE — File containing the error output from the failed program run.

Options

--output
string
Where to save the fixed code file. Defaults to <basename>_fixed.<extension>, or to PDD_CRASH_OUTPUT_PATH if set.
--output-program
string
Where to save the fixed program file. Defaults to <program_basename>_fixed.<extension>.
--loop
flag
Enable iterative fixing. The command reruns the program after each fix attempt and continues until it succeeds, --max-attempts is reached, or --budget is exhausted.
--max-attempts
integer
default:"3"
Maximum number of fix attempts in --loop mode.
--budget
float
default:"5.0"
Maximum cost in USD allowed for the fixing process.

When sync calls crash

pdd sync runs crash as step 4 of its workflow, after example has been generated. It uses the example file as the PROGRAM_FILE and any runtime error output as the ERROR_FILE. If the example runs without errors, this step is skipped.

Examples

# Fix a crashed data processor
pdd crash \
  --output fixed_data_processor.py \
  --output-program fixed_main_pipeline.py \
  data_processing_module_python.prompt \
  crashed_data_processor.py \
  main_pipeline.py \
  crash_errors.log

# Iterative fix loop with increased attempts and budget
pdd crash \
  --loop \
  --max-attempts 5 \
  --budget 10.0 \
  --output fixed_data_processor.py \
  --output-program fixed_main_pipeline.py \
  data_processing_module_python.prompt \
  crashed_data_processor.py \
  main_pipeline.py \
  crash_errors.log

# Disable agentic fallback
pdd crash --no-agentic-fallback \
  my_module_python.prompt \
  src/my_module.py \
  examples/run_my_module.py \
  errors.log

# Capture a debug bundle for the crash run
pdd --core-dump crash \
  prompts/calc_python.prompt \
  src/calc.py \
  examples/run_calc.py \
  crash_errors.log
crash is intended for runtime errors — situations where the program fails to start or throws an unhandled exception. For logical errors where the program runs but produces wrong output, use pdd verify. For failing unit tests, use pdd fix.

Build docs developers (and LLMs) love