GeezerVison is showing github.com — [FEATURE]: Let built-in tools like shell and read be called from Code Mode execute · Issue #55087 · anomalyco/opencode
[FEATURE]: Let built-in tools like shell and read be called from Code Mode execute #55087DescriptionFeature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Built-in tools (shell, read, grep, glob, edit, write, ...) are registered with codemode: false, so tools.shell(...) inside execute fails with Unknown tool 'shell'. #39312 was closed as expected behavior, but the docs do not say why.
This blocks the main use of execute: combining calls in one step. For example, run a CLI that saves a screenshot, then read the image, in one call:
await tools.shell({ command: 'ghosthand screenshot /tmp/s.png' })
return await tools.readMediaIntoContext({ path: '/tmp/s.png' })
Today this is two tool calls, because shell is not in the catalog.
Proposal
- Let built-in tools opt in to the Code Mode catalog, with a config flag or a per-tool setting.
- Nested calls keep their normal permission checks, as other Code Mode tools already do.
- If there is a reason for the current default, document it on the Tools page.
Related: #54826 (direct MCP servers in Code Mode), #55072 (images from execute).
Reacted by Yaroslav Shumlyanskyi, Houssam Elbadissi, Tommy D. Rossi, BrettB, Dylan Barnett, Lê Hoàng Phương, Alvaro Sevilla and Iceflower Activityopencode-agent commented on Oct 13, 2026 Thanks for the detailed request! In short, you're asking for built-in tools like shell, read and grep to be callable as tools.<name>(...) inside Code Mode execute, opt-in through config or per tool, with nested calls still going through the normal permission checks. That way steps like "run a CLI, then read its output file" fit in one call. You'd also like the reason for the current default documented.
Right now each tool goes either in the top-level tool list or in the Code Mode catalog, never both, and every built-in is set to top-level (codemode: false). That's why tools.shell gives Unknown tool. Changing it needs a change in core, so maintainers will consider it.
Related issues:
skaldebane commented on Oct 15, 2026 YES, I see models trip up on this sometimes, when trying to chain built-in tools alongside MCP tools. The built-in tools should act as though they are codemode: true tools. Reacted by BrettB and Javier Ruere mattcrichards commented on Nov 16, 2026 I independently reproduced this limitation while preparing a controlled coding-agent benchmark using OpenCode 2.2.5 and a local Qwen model.
Using an isolated OpenCode session against a mock inference server, I captured the effective model-facing tool configuration.
Observed behavior:
- Enabling
execute successfully exposed Code Mode.
- Built-in
read, edit, shell, and write remained direct model-facing tools.
- Those built-in tools were unavailable through the Code Mode catalog.
- The catalog instead exposed an OpenCode worktree-management tool.
- Enabling Code Mode also introduced additional system-prompt instructions.
This prevents me from evaluating the primary benefit I wanted to measure: whether consolidating native coding tools behind execute reduces tool-schema overhead, context consumption, and time to first source edit for a local 27B model.
I stopped the experiment at preflight rather than testing a configuration that didn't satisfy the experimental requirements.
What would help: An option to expose OpenCode's native coding tools exclusively through Code Mode, while preserving their existing execution semantics and permission checks.
This would make Code Mode substantially more useful for smaller local models, where model-facing tool complexity and context consumption can have meaningful performance implications.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|