High-performance file discovery tool for OpenCode with AI-friendly output and rich filters.
smart_glob solves discovery issues in large codebases:
- ❌ Slow recursive search and noisy output
- ❌ Poor filtering by date/size/depth
- ❌ Hard-to-parse results for agents
- ❌ Inconsistent behavior across OS environments
✅ smart_glob provides:
- Fast recursive globbing with optional
fastMode - Depth, date, size, hidden-file, and directory-only filters
- Multiple output formats (
rich,compact,json) - Better diagnostics and suggestions for invalid paths
- Cross-platform behavior (Windows/macOS/Linux)
smart_glob.ts— production tool implementation
- Copy
smart_glob.tsto your OpenCode tools folder:
# Example
cp smart_glob.ts ~/.config/opencode/tools/- Enable it in
opencode.json:
- Restart OpenCode.
To disable default discovery/edit/search tools:
{
"tools": {
"smart_edit": true,
"smart_grep": true,
"smart_glob": true,
"edit": false,
"write": false,
"grep": false,
"glob": false
}
}- Fast project indexing
- Finding files by extension/pattern/date/size
- Agent-safe discovery in large monorepos
Smart file discovery for modern AI coding flows.
{ "tools": { "smart_glob": true } }