# Prepare dependencies at worktree creation

Pi Deps installs through an explicitly enabled repository's shared Git `post-checkout` hook rather than Pi session startup. Git runs that hook when a worktree is created with a checkout, regardless of creator; `git worktree add --no-checkout` does not run it. The hook acts only on that initial checkout. Pi sessions pay no repeated startup cost. Global Git hooks and creator-specific integrations were rejected because they either override unrelated hooks or miss non-Pi creators.

The hook validates lockfiles synchronously, so conflicting lockfiles and malformed `packageManager` declarations still fail worktree creation fast. It then spawns a detached installer child and exits immediately. The installer records its outcome in `<worktree>/.context/pi-harness/pi-deps/status.json` and appends output to `install.log` in the same directory. Install failures therefore do not fail worktree creation. A Pi TUI session opened in the worktree watches the status file and reports progress through a dim footer spinner with elapsed time. Success clears silently; failures remain visible with the installer log path. Keeping normal background work in the footer avoids distracting from the conversation while ensuring failures still demand attention. Blocking creation on installs was rejected because multi-minute frozen installs delayed every `git worktree add`.
