Skip to content

--no-builtin-tools / -nbt: disable built-in tools but keep extension and custom tools #23

@quangdang46

Description

@quangdang46

--no-builtin-tools / -nbt: disable built-in tools but keep extension/custom tools

Summary

Add a separate --no-builtin-tools (-nbt) flag, distinct from a hypothetical --no-tools. The flag disables only the built-in tools (read, write, edit, bash, grep, find, ls, etc.) while leaving extension-provided tools, MCP tools, and custom tools enabled.

Reference: pi-mono Tool Options — distinguishes --no-builtin-tools from --no-tools.

Why

  • Running an extension-only or MCP-only session is currently awkward because there is no clean way to silence built-ins without also silencing what the user actually wants.
  • Combining --no-builtin-tools with --tools <list> (already a planned/existing flag) lets users build a deterministic minimum tool surface, useful for security demos and conformance testing.

Current state in jcode

Implementation checklist

1. CLI

  • Add no_builtin_tools: bool (short -nbt, global) to Args in src/cli/args.rs.

2. Registry

  • In whatever construction step builds the active tool list, skip built-ins when args.no_builtin_tools is true.
  • Built-ins set: read, write, edit, multiedit, apply_patch, bash, grep, find/glob, ls, agentgrep, webfetch, websearch, todo, memory, skill, task, communicate (mark which of these are user-facing built-ins vs internal — exclude task / communicate / todo from the gate since they are infrastructure tools).

3. Combine with explicit --tools

  • When both --no-builtin-tools and --tools are set, the explicit --tools list wins for the named built-ins (so users can re-enable individual ones without losing extensions).

Testing

  • Unit test in src/agent_tests.rs: starting a session with --no-builtin-tools exposes zero built-in tools to the model.
  • Combined with --tools read: only read is exposed.
  • MCP tools and extension tools (mocked) remain enabled.

Acceptance criteria

  • jcode --no-builtin-tools "..." runs and the model sees only extension/MCP/custom tools.
  • jcode --no-builtin-tools --tools read "..." runs and the model sees read plus non-built-ins.
  • --help and README document the precedence.

Cross-references

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions