anomalyco / anomalyco/opencode
Docs: custom-tools says `tools/` but the loader globs `{tool,tools}` — name one canonical directory
@nexxeln is already working on this.
Since Aug 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The custom-tools docs name one directory, but the loader accepts two, and the docs name the one that is arguably the less likely to be typed.
https://opencode.ai/docs/custom-tools documents ~/.config/opencode/tools/ (plural). The loader globs {tool,tools}, so a file in either tool/ or tools/ is picked up. In the 1.18.3 binary:
scanSync("{tool,tools}/*.{js,ts}", { cwd: <dir>, absolute: true, dot: true, symlink: true })
Both spellings work today, so this is not a broken feature — it is that the documented contract is narrower than the implemented one. That costs two ways:
- someone who guesses
tool/(singular) gets working behaviour that no page promises, so they cannot tell whether they are relying on something supported; - anyone documenting, linting or scaffolding against the docs will treat
tool/as wrong, when the loader is happy with it.
Either resolution is fine and both are cheap — document that both are accepted, or narrow the glob to the documented spelling. What would help most is simply naming one as canonical.
Plugins
Not relevant to this report — reproduced with no plugins configured.
OpenCode version
1.18.3
Steps to reproduce
- Read https://opencode.ai/docs/custom-tools — it specifies
~/.config/opencode/tools/. - Place a tool file at
~/.config/opencode/tool/my-tool.ts(singular). - Run
opencode debug agent build— the tool is registered, despite the directory not matching the documented path.
Screenshot and/or share link
None. The relevant evidence is the glob string in the shipped 1.18.3 binary, quoted above.
Operating System
macOS 26
Terminal
iTerm2
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.