Skip to content

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.

ModelSource
sonnetpack: opencode
Full Reference

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).

ToolPermission KeyFunction
bashbashExecute shell commands
editeditModify files (exact string replacement)
writeeditCreate/overwrite files
readreadRead file contents and line ranges
grepgrepRegex search across codebase (ripgrep)
globglobFind files by pattern
listlistList directory contents
lsplspCode intelligence (definitions, references, hover)
patcheditApply patch files
skillskillLoad SKILL.md content
todowritetodowriteCreate/update task lists
todoreadtodoreadRead current todo state
webfetchwebfetchFetch and read web pages
websearchwebsearchWeb search via Exa AI (OPENCODE_ENABLE_EXA=1)
questionnoneAsk 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.

TopicFile
All 16 built-in tools — parameters, behavior, gotchasreference/built-in-tools.md
Permission system — categories, syntax, patterns, defaultsreference/permissions.md
Enabling and disabling tools globally and per-agentreference/enabling-disabling-tools.md
Custom tools — API, multi-export, cross-language, precedencereference/custom-tools.md
Agent-level permission overrides and resolution orderreference/agent-overrides.md
Troubleshooting — blocked tools, missing search, glob missesreference/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.


┏━ 🔧 opencode-tools ━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Built-in tools, custom tools, and the permission system for OpenCode ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛