The sync command was closing the daemon connection without initializing the direct store, leaving store=nil. This caused errors in post-checkout hook when running bd sync --import-only. Fixed by using fallbackToDirectMode() which properly closes daemon and initializes the store. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>