Skip to content

Tools

SWUST Code currently has two tool registration paths: the core v2 runner uses packages/core/src/tool/, while the TUI/legacy session path uses packages/opencode/src/tool/. The tool list visible in a session depends on the active runtime.

Core v2 Built-ins

ToolDescription
bashExecute a shell command with safety analysis
readRead files or images
writeWrite files
editPrecise file editing
apply_patchApply patches
globFile pattern search
grepContent search via ripgrep
webfetchFetch web content
websearchSearch the web
memorySearch persistent memory with FTS5 + BM25
memory_writeWrite persistent memory
todowriteManage task state
questionAsk the user a question
skillLoad SKILL.md content
historySearch historical sessions through History FTS

TUI/Legacy Tools

ToolDescription
shell / bashShell execution, depending on ShellID
read, write, edit, apply_patchFile read/write and patching
glob, grepFile and content search
taskSpawn a subagent, optionally in background mode
actorMiMo-style Actor API: run, spawn, status, wait, cancel, send
subagentDedicated subagent dispatch tool
workflowInvoke scripted workflows
memorySearch or write memory
historyQuery historical sessions and snippets
webfetch, websearchWeb fetch and search
skillLoad a skill
lspExperimental LSP tool
plan_exitExperimental Plan-mode exit tool

Safety Attributes

Core v2 tools declare:

  • isReadOnly
  • isConcurrencySafe
  • isDestructive, defaulting to true

Bash commands are classified as safe, caution, or dangerous before execution.

Actor Tool

v0.4 exposes the MiMo-style Actor API:

OperationDescription
runRun a subagent in the foreground and wait for the result
spawnStart a background subagent and return an actor id
statusRead actor status from the registry
waitWait for a background actor
cancelCancel an actor
sendSend an Inbox message to an actor

Background actors expose waitable outcomes. Task-bound actors update Task Registry based on return headers and runtime completion checks.