pdd bug takes a GitHub issue URL, walks through a 10-step agentic workflow to reproduce the bug and understand its root cause, then creates a failing unit test and a draft PR. Use pdd fix with the same issue URL afterward to resolve the failing tests.
Usage
Arguments
URL of the GitHub issue describing the bug (e.g.,
https://github.com/owner/repo/issues/42).Options
Where to save the generated unit test. Default:
test_<module>_bug.py. Also reads from PDD_BUG_OUTPUT_PATH.Programming language for the generated unit test. Used in manual mode only.
Additional seconds to add to each step’s timeout.
Disable GitHub issue comment-based state persistence and use local-only state. You can also set
PDD_NO_GITHUB_STATE=1.Use legacy manual mode with explicit file arguments instead of the agentic workflow.
The 10-step workflow
Duplicate check
Search for existing issues describing the same problem. If a duplicate is found, its content is merged and the duplicate is closed.
Documentation check
Review repository documentation to determine whether this is a genuine bug or a user error.
Triage
Assess whether enough information exists to proceed. If the issue already contains a detailed root cause analysis (file paths, line numbers, causal explanation), the workflow fast-tracks to root cause analysis, skipping reproduction.
Reproduce
Attempt to reproduce the issue locally. Posts a confirmation comment. Skipped when Step 3 fast-tracks.
Root cause analysis
Run experiments to identify the root cause. Performs a variable reference audit to find sibling bugs in parallel code paths, and a state symmetry check to detect save/restore asymmetries. Assesses whether the fix is localized or cross-cutting.
Prompt classification
Determine whether the bug is in the code implementation or in the prompt specification. If the prompt is defective, auto-fixes the prompt file and posts the changes as a comment.
Test plan
Design a plan for creating tests to detect the problem. Enumerates all affected output channels and all distinct code paths (first-run, resume, retry, error recovery). Prefers appending to existing test files over creating new ones.
Verify detection
Confirm the unit test successfully detects the bug. Classifies whether an end-to-end test is also needed.
Pairing with pdd fix
pdd bug is designed to be followed by pdd fix:
Branching behavior
pdd bug creates a new git worktree based on your current HEAD, the same as pdd change:
- From
main/master: Independent PR based on latestmain. - From a feature branch: Branch inherits commits, enabling stacked PRs.
Examples
Manual mode (legacy)
The prompt file that generated the code containing the bug.
The code file that contains the buggy implementation.
The program file that exercises the buggy code.
File containing the actual (incorrect) output from the program.
File containing the expected (correct) output.
Related commands
pdd fix— Resolves the failing tests created bypdd bug.pdd checkup— Full project health check that can surface bugs across the entire codebase.