I am not sure where the source of the bug is, but I will set out the details. It seems quite reproducible for me.
OS: Windows 11 Pro x64 25H2.
Sourcetree V3.4.31 (also first observed on 3.4.30)
Apple iCloud Drive for Windows installed from MS Store (version - hard to tell, last updated 2026-06-19), logged in with a normal Apple account.
Open the ICloud App from the system tray (I have only Photos, Drive and Passwords enabled); under Drive, click on "Open in File Explorer"
Expected result: Opens file explorer at the virtual drive, which in my case is actually on a RAID drive G:\path-to\iCloud\drive\iCloudDrive.
When Sourcetree option "Enable 'open in sourcetree' context menu in Explorer" off then the expected result is seen.
When that option is on, then the Sourcetree program is started, and opens up at my most recent repo. There is no file explorer eventually presented.
If I open file explorer first, and use the "iCloud Drive" shortcut under "Desktop" in the folder list then it works as expected, no matter what the Sourcetree settings are. Since this more typical method of operation does not have the problem then I consider it a low priority bug.
I also tried the same thing with Google drive, and it did not have the same problem. However the only "open with file explorer" link I could find in that user interface was for mapped drives rather than subfolders, so it is not exactly the same.
Each time the the bug happens, the Sourcetree log file gets a number of entries within 1 second:
LogHost: Initializing to normal mode
ReactiveList`1: Property change notifications are enabled and type SourceTree.Model.RepositoryRemoteProjectLink isn't INotifyPropertyChanged or IReactiveObject (This line is repeated 16 times:)
...
Could not obtain git dir, G:\path-to\iCloud\drive\iCloudDrive is not a git repo.
The same log entries occur if I manually right click and select Sourcetree->open as repository on that or similar folder (i.e. not a genuine repo)