anomalyco / anomalyco/opencode
fix(core): skip file watcher on filesystem roots
Open
@jlongster is already working on this.
Since Aug 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
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.)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.