Tools
Tools allow Bub to read and write files, run commands, fetch web pages, and manage sessions.
Built-in tools
Section titled “Built-in tools”The Bub app ships with these built-in tools:
| Category | Tool | Purpose |
|---|---|---|
| Processes | bash |
Run Shell commands with working directory, timeout, and background options |
bash.output, bash.kill |
Read background process output incrementally or terminate a process | |
| Files | fs.read, fs.write, fs.edit |
Read files by line range (or images), write whole files, and replace exact text |
| Web | web.fetch |
Send HTTP GET requests to fetch web pages (prefers Markdown) |
| Discovery | skill |
List discovered skills or load a skill’s SKILL.md body |
tool.describe |
Load the full schema of deferred tools (deferred=True) on demand |
|
| Session & Tape | tape.info, tape.search |
Inspect session metrics and token usage, or search session history |
tape.handoff, tape.reset |
Advance the context start point, or archive and reset session history | |
spill.read |
Read large tool outputs in chunks | |
| Subagents | subagent |
Delegate a task to a background subagent |
subagent.wait, subagent.send, subagent.cancel |
Wait for subagent results, send follow-up instructions, or cancel a subagent | |
| Code mode | run_code |
Compose multiple tools in Python when code mode is enabled |
For full parameter tables and defaults, see the Built-in tools reference.
How tools are called
Section titled “How tools are called”In the Bub app, tools can be invoked in two ways:
- Called by the model: ask a question normally, and the model selects and calls tools based on their descriptions.
- Called directly from the terminal: prepend the command prefix (
,by default) to execute a tool without calling the model or spending tokens:Terminal window bub run ",fs.read path=README.md"
To guide how the model uses tools:
- Workspace rules: add project-wide rules to
AGENTS.mdin the workspace root. - Step-by-step workflows: package multi-step procedures as skills.
Code mode
Section titled “Code mode”For tasks involving loops, conditionals, or batch data processing, repeated tool round-trips consume extra context. With code mode enabled, the model writes Python code (executed via run_code) to compose multiple tool calls in a single step:
,code_mode enable=true- Takes effect on the next Turn and persists in the current session Tape.
- Run
,code_mode enable=falseto disable code mode. - See the
run_codereference for Python call syntax.
Execution environment and security
Section titled “Execution environment and security”Built-in tools (bash, fs.*, and run_code) run directly on the local host with the current user’s permissions:
- No default sandbox: commands executed by the model have real filesystem and process side effects on the host.
- Approval and interception: use tool interception hooks to require human approval or block dangerous arguments before execution.
- Isolated environments: provide a containerized or remote execution environment via a plugin when isolation is required.
Extend tools
Section titled “Extend tools”When the built-in tools are not enough, you can extend Bub in two ways:
- Install community plugins or MCP servers: browse community plugins or connect MCP servers.
- Write custom tool plugins: register Python functions with
provide_tools(see Plugins and Hooks: Provide tools).