You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(core): skip file watcher on filesystem roots #45611
The file watcher attempts to watch filesystem roots (e.g., C:/ on Windows, / on Linux) which causes unnecessary resource usage and potential permission issues.
Reproduction Steps
Open a project at filesystem root
File watcher attempts to watch the entire root directory
Causes high resource usage / permission errors
Expected Behavior
File watcher should skip filesystem roots and system directories.
Actual Behavior
File watcher attempts to watch roots, wasting resources.
System Info
OS: Linux/macOS/Windows
opencode version: dev
Fix
Added isRootOrSystemDirectory check in packages/core/src/filesystem/watcher.ts to skip roots (C:/, /, etc.)
In v2, opening a project at a filesystem root no longer sets up a recursive watch on it: the old project-directory watcher is gone, and opencode now only watches the Git HEAD (or Mercurial branch) file to notice branch changes. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
github-actions commentedon Aug 27, 2026
This issue might be a duplicate of existing issues. Please check:
$HOME(a near-root path) causing ~1000% CPU usage — same class of problem.If your fix is distinct from what's described there, please clarify the difference in your issue.
neriousy commentedon Oct 19, 2026
In v2, opening a project at a filesystem root no longer sets up a recursive watch on it: the old project-directory watcher is gone, and opencode now only watches the Git HEAD (or Mercurial branch) file to notice branch changes. To get v2:
npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.