What is the point of watcher.ignore #4124

Open
opened 2026-02-16 17:42:42 -05:00 by yindo · 4 comments
Owner

Originally created by @Bazmundi on GitHub (Jan 3, 2026).

Originally assigned to: @rekram1-node on GitHub.

Question

So in my project directory I have .opencode/opencode.json with the following contents:

{
  "$schema": "https://opencode.ai/config.json",
  "watcher": {
    "ignore": [
      ".git/**",
      "crcdb/**",
      "dist/**",
      "in-memoria-vectors.db/**",
      "in-memoria.db",
      "node_modules/**",
      "src/**",
      "scripts/**"
    ]
  }
}

And yet I have the console output:

 General Task "Design practical ID system improvements"
├ Read crc-schema.json
├ Read crcdb/crcdb.py  << should have ignored
├ Read scripts/class_editor_app.py   << should have ignored
├ Read scripts/class_editor_app.py   << should have ignored
├ Read scripts/validate_crc.py   << should have ignored
├ Read samples/crc/valid/valid01.json
├ Read samples/crc/valid/valid05.json
├ Read samples/crc/valid/valid12_interfaces.json
├ Read tests/test_crc_schema.py
├ Glob 
├ Read samples/crc/invalid/invalid01.json
├ Read samples/crc/invalid/invalid02.json
├ Read samples/crc/invalid/invalid12_interface_missing_kind.json
├ Read scripts/class_editor_app.py   << should have ignored
├ Edit scripts/class_editor_app.py   << should have certainly have ignored as we're in Plan mode
├ Edit scripts/class_editor_app.py   << should have certainly have ignored as we're in Plan mode
├ Edit scripts/class_editor_app.py   << should have certainly have ignored as we're in Plan mode
├ Read scripts/class_editor_app.py    << should have ignored
├ Edit scripts/class_editor_app.py    << should have certainly have ignored as we're in Plan mode
├ Read scripts/class_editor_app.py   << should have ignored
├ Read scripts/class_editor_app.py   << should have ignored
├ Grep slug\(
├ Grep resp.*id
├ Read scripts/class_editor_app.py   << should have ignored
├ Read scripts/class_editor_app.py   << should have ignored
├ Read scripts/class_editor_app.py   << should have ignored
├ Grep def ensure_package_facade_responsibility
├ Read scripts/class_editor_app.py   << should have ignored
├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode
├ Read scripts/class_editor_app.py  << should have ignored
├ Read scripts/class_editor_app.py  << should have ignored
├ Read scripts/class_editor_app.py  << should have ignored
├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode
├ Read scripts/class_editor_app.py << et cetera Yul B
├ Read scripts/class_editor_app.py
├ Edit scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Edit scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Edit scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Edit scripts/class_editor_app.py
├ Read scripts/class_editor_app.py
├ Bash Run all tests to verify our changes
├ Bash Run validation to see detailed errors
├ Read samples/crc/valid/valid12_interfaces.json
└ Edit samples/crc/valid/valid12_interfaces.json

So what on earth is the point of watcher.ignore if it isn't to have opencode skip these files? Have I just put the ignore in the wrong place?

Originally created by @Bazmundi on GitHub (Jan 3, 2026). Originally assigned to: @rekram1-node on GitHub. ### Question So in my project directory I have .opencode/opencode.json with the following contents: ``` { "$schema": "https://opencode.ai/config.json", "watcher": { "ignore": [ ".git/**", "crcdb/**", "dist/**", "in-memoria-vectors.db/**", "in-memoria.db", "node_modules/**", "src/**", "scripts/**" ] } } ``` And yet I have the console output: ``` General Task "Design practical ID system improvements" ├ Read crc-schema.json ├ Read crcdb/crcdb.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/validate_crc.py << should have ignored ├ Read samples/crc/valid/valid01.json ├ Read samples/crc/valid/valid05.json ├ Read samples/crc/valid/valid12_interfaces.json ├ Read tests/test_crc_schema.py ├ Glob ├ Read samples/crc/invalid/invalid01.json ├ Read samples/crc/invalid/invalid02.json ├ Read samples/crc/invalid/invalid12_interface_missing_kind.json ├ Read scripts/class_editor_app.py << should have ignored ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Read scripts/class_editor_app.py << should have ignored ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Grep slug\( ├ Grep resp.*id ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Grep def ensure_package_facade_responsibility ├ Read scripts/class_editor_app.py << should have ignored ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Read scripts/class_editor_app.py << should have ignored ├ Edit scripts/class_editor_app.py << should have certainly have ignored as we're in Plan mode ├ Read scripts/class_editor_app.py << et cetera Yul B ├ Read scripts/class_editor_app.py ├ Edit scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Edit scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Edit scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Edit scripts/class_editor_app.py ├ Read scripts/class_editor_app.py ├ Bash Run all tests to verify our changes ├ Bash Run validation to see detailed errors ├ Read samples/crc/valid/valid12_interfaces.json └ Edit samples/crc/valid/valid12_interfaces.json ``` So what on earth is the point of watcher.ignore if it isn't to have opencode skip these files? Have I just put the ignore in the wrong place?
Author
Owner

@github-actions[bot] commented on GitHub (Jan 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #3164: Exclude files from being used - asks about excluding password/secret files from being read
  • #4633: It should be possible to instruct opencode which files to ignore - suggests an ignore mechanism similar to Gemini CLI
  • #4035: [FEATURE]: Ability to ignore AGENTS.md - discusses the need to ignore specific files in opencode.json configuration

These issues discuss similar concerns about file exclusion and the ignore functionality in opencode configuration. Feel free to ignore if your specific case differs from these.

@github-actions[bot] commented on GitHub (Jan 3, 2026): This issue might be a duplicate of existing issues. Please check: - #3164: Exclude files from being used - asks about excluding password/secret files from being read - #4633: It should be possible to instruct opencode which files to ignore - suggests an ignore mechanism similar to Gemini CLI - #4035: [FEATURE]: Ability to ignore AGENTS.md - discusses the need to ignore specific files in opencode.json configuration These issues discuss similar concerns about file exclusion and the ignore functionality in opencode configuration. Feel free to ignore if your specific case differs from these.
Author
Owner

@rekram1-node commented on GitHub (Jan 3, 2026):

it’s for the experimental filewatcher, has nothig to do with what agent can see, tho where did u see this option im surprised it is documented

@rekram1-node commented on GitHub (Jan 3, 2026): it’s for the experimental filewatcher, has nothig to do with what agent can see, tho where did u see this option im surprised it is documented
Author
Owner

@Bazmundi commented on GitHub (Jan 3, 2026):

it’s for the experimental filewatcher, has nothig to do with what agent can see, tho where did u see this option im surprised it is documented

https://opencode.ai/docs/config/#watcher so probably shouldn't read the docs right?

So now that you hinted it's experimental, that means:

OPENCODE_EXPERIMENTAL_FILEWATCHER boolean Enable file watcher for entire dir?

What does that mean "for entire dir" when the config file hints you can down select?

What does it mean to "watch a file"?

@Bazmundi commented on GitHub (Jan 3, 2026): > it’s for the experimental filewatcher, has nothig to do with what agent can see, tho where did u see this option im surprised it is documented https://opencode.ai/docs/config/#watcher so probably shouldn't read the docs right? So now that you hinted it's experimental, that means: OPENCODE_EXPERIMENTAL_FILEWATCHER boolean Enable file watcher for entire dir? What does that mean "for entire dir" when the config file hints you can down select? What does it mean to "watch a file"?
Author
Owner

@rekram1-node commented on GitHub (Jan 3, 2026):

It basically does nothing rn it will just watch for file changes and emit events, we had some plans on how we would utilize it but it currently is disabled by default and the events it fires aren’t subscribed to so it doesnt do anything, we do have a single file watch subscription to a git file to track when the current branch changes but thats it

@rekram1-node commented on GitHub (Jan 3, 2026): It basically does nothing rn it will just watch for file changes and emit events, we had some plans on how we would utilize it but it currently is disabled by default and the events it fires aren’t subscribed to so it doesnt do anything, we do have a single file watch subscription to a git file to track when the current branch changes but thats it
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4124