Problem
When pi opens a terminal on Windows and the working directory is C:\Users\<username> (no .git found), pi-fff's FileFinder indexes the entire home directory as the project root.
resolveProjectRoot() walks up from cwd looking for .git. When none is found, it falls back to cwd:
https://github.com/ShpetimA/pi-fff/blob/main/src/runtime-paths.ts#L18-L27
Then FileFinder.create({ basePath: projectRoot }) starts scanning all files under C:\Users\<username>:
https://github.com/ShpetimA/pi-fff/blob/main/src/fff-runtime.ts#L838-L845
Why this is a problem
On Windows, OneDrive Files On-Demand keeps cloud-only files as lightweight placeholders (reparse points). When FFF's background scanner/watcher accesses these files (even just stat + content indexing), the Windows filesystem triggers OneDrive's hydration — downloading the actual file content from the cloud.
This causes:
- Unwanted bandwidth consumption
- Disk space bloat (cloud-only files become local)
- Slow scanning while OneDrive downloads large files
- Unnecessary OneDrive sync activity
The OneDrive folder typically lives at C:\Users\<username>\OneDrive (or OneDrive - <Org> for business accounts).
Proposed fix
pi-fff should exclude OneDrive from the scan scope. Options:
-
In pi-fff: Detect that cwd is the user home directory. If the OneDrive folder exists under it, either exclude it from indexing or refuse to index the home directory altogether (suggest cd into an actual project).
-
In @ff-labs/fff-node: Add an exclude/ignore option to InitOptions so pi-fff can pass ignore patterns to the native scanner. (This is the deeper fix — the native scanner is what actually triggers the file access.)
-
Quick mitigation: pi-fff could check if basePath === homedir() and refuse to initialize, prompting the user to navigate into a project directory first.
Steps to reproduce
- On Windows with OneDrive configured, open pi
- Ensure cwd is
C:\Users\<username> (not inside a git repo)
- pi-fff initializes, starts scanning
- Observe OneDrive sync activity — cloud-only files get downloaded
Problem
When pi opens a terminal on Windows and the working directory is
C:\Users\<username>(no.gitfound), pi-fff's FileFinder indexes the entire home directory as the project root.resolveProjectRoot()walks up from cwd looking for.git. When none is found, it falls back tocwd:https://github.com/ShpetimA/pi-fff/blob/main/src/runtime-paths.ts#L18-L27
Then
FileFinder.create({ basePath: projectRoot })starts scanning all files underC:\Users\<username>:https://github.com/ShpetimA/pi-fff/blob/main/src/fff-runtime.ts#L838-L845
Why this is a problem
On Windows, OneDrive Files On-Demand keeps cloud-only files as lightweight placeholders (reparse points). When FFF's background scanner/watcher accesses these files (even just
stat+ content indexing), the Windows filesystem triggers OneDrive's hydration — downloading the actual file content from the cloud.This causes:
The OneDrive folder typically lives at
C:\Users\<username>\OneDrive(orOneDrive - <Org>for business accounts).Proposed fix
pi-fff should exclude OneDrive from the scan scope. Options:
In pi-fff: Detect that cwd is the user home directory. If the OneDrive folder exists under it, either exclude it from indexing or refuse to index the home directory altogether (suggest
cdinto an actual project).In
@ff-labs/fff-node: Add anexclude/ignoreoption toInitOptionsso pi-fff can pass ignore patterns to the native scanner. (This is the deeper fix — the native scanner is what actually triggers the file access.)Quick mitigation: pi-fff could check if
basePath === homedir()and refuse to initialize, prompting the user to navigate into a project directory first.Steps to reproduce
C:\Users\<username>(not inside a git repo)