opencode-tools
Use when working with OpenCode tools — built-in tools (bash, edit, read, grep, glob, lsp, etc.), custom tool creation, permission system (allow/deny/ask), or controlling what the LLM can do.
| Model | Source |
|---|---|
| sonnet | pack: opencode |
Full Reference
OpenCode Tools & Permissions
Section titled “OpenCode Tools & Permissions”Tools let the LLM perform actions in your codebase. OpenCode ships with 16 built-in tools, supports custom tools via TypeScript/JavaScript, and has a granular permission system. Current version: v1.2.10 (Feb 2026).
Quick Reference
Section titled “Quick Reference”| Tool | Permission Key | Function |
|---|---|---|
bash | bash | Execute shell commands |
edit | edit | Modify files (exact string replacement) |
write | edit | Create/overwrite files |
read | read | Read file contents and line ranges |
grep | grep | Regex search across codebase (ripgrep) |
glob | glob | Find files by pattern |
list | list | List directory contents |
lsp | lsp | Code intelligence (definitions, references, hover) |
patch | edit | Apply patch files |
skill | skill | Load SKILL.md content |
todowrite | todowrite | Create/update task lists |
todoread | todoread | Read current todo state |
webfetch | webfetch | Fetch and read web pages |
websearch | websearch | Web search via Exa AI (OPENCODE_ENABLE_EXA=1) |
question | none | Ask user for input |
Permission levels: "allow" (auto-execute) · "ask" (prompt user) · "deny" (blocked)
Custom tools: TypeScript/JavaScript files in .opencode/tools/ (project) or ~/.config/opencode/tools/ (global). Filename = tool name.
Reference Index
Section titled “Reference Index”| Topic | File |
|---|---|
| All 16 built-in tools — parameters, behavior, gotchas | reference/built-in-tools.md |
| Permission system — categories, syntax, patterns, defaults | reference/permissions.md |
| Enabling and disabling tools globally and per-agent | reference/enabling-disabling-tools.md |
| Custom tools — API, multi-export, cross-language, precedence | reference/custom-tools.md |
| Agent-level permission overrides and resolution order | reference/agent-overrides.md |
| Troubleshooting — blocked tools, missing search, glob misses | reference/troubleshooting.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.
Announcement
Section titled “Announcement”┏━ 🔧 opencode-tools ━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Built-in tools, custom tools, and the permission system for OpenCode ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛