Prune Codebase
Goal
Reduce a repo to only what is required for the application flow, without destructive deletion.
Workflow
- Build an execution schematic of the current app flow.
- Save the schematic artifact to
codex_docs/app_execution_schematics.md. - Identify required files from that schematic.
- Ignore
docs/andcodex_docs/during pruning decisions. - For each prune candidate:
- Move it to
pruned_objects/<original-path>(never delete). - Run a validation pass immediately after the move.
- If validation fails, restore the object and mark it as required.
- Move it to
- Repeat until all candidates are processed.
- Reassess
requirements.txtandREADME.mdagainst the final pruned structure. - Move old
requirements.txtandREADME.mdintopruned_objects/before writing updated versions.
Guardrails
- Prefer one-object-at-a-time pruning for traceability.
- Always keep path structure under
pruned_objects/. - Treat unclear dependencies as required unless validation proves otherwise.
- Do not skip validation between moves.
Example command patterns
mkdir -p pruned_objects
mkdir -p "pruned_objects/$(dirname path/to/object)"
mv "path/to/object" "pruned_objects/path/to/object"
# restore if needed
mkdir -p "$(dirname path/to/object)"
mv "pruned_objects/path/to/object" "path/to/object"