pdd auto-deps scans a directory for candidate dependency files, determines which ones are relevant to a given prompt, and inserts <include> directives for them. It also removes redundant inline content in the prompt that duplicates what the newly included files already provide. The pdd sync command calls auto-deps automatically as its first step.
Usage
Arguments
The prompt file to analyze and update with dependency references.
Directory or glob pattern to search for dependency and example files. Supports wildcards such as
*.py and **/*.py.- A plain directory (e.g.,
examples/) is scanned recursively by default, equivalent toexamples/**/*. - A glob (e.g.,
examples/**/*.py) limits the search to matching files.
Options
Where to save the modified prompt file. Default:
<basename>_with_deps.prompt. Also reads from PDD_AUTO_DEPS_OUTPUT_PATH.Path to the CSV file that stores or will store dependency metadata. Also reads from
PDD_AUTO_DEPS_CSV_PATH.Force rescanning of all candidate files even if they are already recorded in the CSV cache.
Include documentation files (
.md, .txt, .rst) in dependency discovery. Disabled by default.Skip the redundant inline content removal pass. The deduplication pass is enabled by default.
Maximum number of parallel LLM calls for dependency analysis. Also reads from
PDD_AUTO_DEPS_CONCURRENCY.How it works
auto-deps uses a two-stage retrieval pipeline when the number of candidate files exceeds 50:
- Embedding search — Embeds the prompt and all candidate files, then retrieves the top 50 candidates by cosine similarity. Controlled by
PDD_EMBEDDING_MODEL(default:text-embedding-3-small). - LLM reranking — Uses an LLM-as-judge to select the most relevant dependencies from those 50 candidates.
<include> directives, the command performs a deduplication pass that identifies and removes inline content in the prompt that semantically duplicates what an included document already provides. Use --no-dedup to skip this step.
Dependency metadata CSV
auto-deps maintains a CSV file with the following columns:
| Column | Description |
|---|---|
full_path | Full path to the dependency file |
file_summary | One-sentence summary of the file’s content and purpose |
key_exports | Key exports (functions, classes, constants) from the file |
dependencies | Modules or packages the file depends on |
date | Timestamp of when the file was last analyzed |
Existing CSV files using the old 3-column format (without
key_exports and dependencies) are automatically re-summarized on the next run.Examples
Integration with pdd sync
pdd sync calls auto-deps as its first step automatically. You do not need to run auto-deps manually when using sync. Run it directly when you want to update a single prompt’s dependencies without running the full sync cycle.
Related commands
pdd sync— Callsauto-depsautomatically as step 1 of the full workflow.pdd preprocess— Expands<include>directives inserted byauto-depsto preview the final prompt.