Skip to content

[FEATURE]: Let built-in tools like shell and read be called from Code Mode execute #55087

Open

Description

@remorses

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

Activity

  1. opencode-agent commented on Oct 13, 2026

    @opencode-agent
    Contributor

    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:

  2. skaldebane commented on Oct 15, 2026

    @skaldebane

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions