Skip to main content
Claw Code separates its agent surface into two inventories: commands (slash-style directives that control agent behaviour) and tools (execution primitives that perform real work). Both are loaded from static JSON snapshots and represented as PortingModule entries.

What are commands?

Commands are built-in slash commands mirrored from the original Claude Code TypeScript implementation. They direct the agent — for example, triggering a compact, switching context, or listing available actions. They do not execute shell operations directly. The full inventory is loaded from src/reference_data/commands_snapshot.json at import time:
SNAPSHOT_PATH = Path(__file__).resolve().parent / 'reference_data' / 'commands_snapshot.json'

PORTED_COMMANDS = load_command_snapshot()  # tuple[PortingModule, ...]
Each entry is a PortingModule dataclass with status='mirrored'.

What are tools?

Tools are execution primitives that act on the file system, run shell commands, or call external services. The core tools in the simple-mode set are:
  • BashTool — shell command execution (gated by default; see Permissions)
  • FileReadTool — read file contents
  • FileEditTool — apply edits to files
The full inventory is loaded from src/reference_data/tools_snapshot.json:
SNAPSHOT_PATH = Path(__file__).resolve().parent / 'reference_data' / 'tools_snapshot.json'

PORTED_TOOLS = load_tool_snapshot()  # tuple[PortingModule, ...]

The PortingModule dataclass

Both inventories are composed of PortingModule entries defined in models.py:
@dataclass(frozen=True)
class PortingModule:
    name: str           # canonical tool/command name, e.g. "BashTool"
    responsibility: str # human description of what this entry does
    source_hint: str    # origin path in the TypeScript source tree
    status: str = 'planned'
Entries loaded from snapshots always carry status='mirrored'.

PortingBacklog

A PortingBacklog groups modules under a title and provides summary output:
@dataclass
class PortingBacklog:
    title: str
    modules: list[PortingModule]

    def summary_lines(self) -> list[str]:
        return [
            f'- {module.name} [{module.status}] — {module.responsibility} (from {module.source_hint})'
            for module in self.modules
        ]
QueryEnginePort.render_summary() uses build_command_backlog() and build_tool_backlog() to display both backlogs as part of the workspace summary.

Command categories

The CommandGraph (built by command_graph.py) splits the command inventory into three buckets based on source_hint content:

Built-in commands

No plugin or skills keyword in source_hint. These are the core slash commands ported directly from Claude Code’s built-in surface.

Plugin commands

source_hint contains plugin. These mirror commands that Claude Code loads from user-installed plugin extensions.

Skill commands

source_hint contains skills. These mirror commands sourced from the skills subsystem.
Filter commands by category using the CLI:
# Exclude plugin commands
python3 -m src.main commands --no-plugin-commands

# Exclude skill commands
python3 -m src.main commands --no-skill-commands

# Both filters combined
python3 -m src.main commands --no-plugin-commands --no-skill-commands
Or call get_commands() directly in Python:
from src.commands import get_commands

builtins_only = get_commands(include_plugin_commands=False, include_skill_commands=False)

Tool pool and simple mode

The ToolPool (assembled in tool_pool.py) is the filtered set of tools the runtime actually works with. It is built by assemble_tool_pool():
@dataclass(frozen=True)
class ToolPool:
    tools: tuple[PortingModule, ...]
    simple_mode: bool
    include_mcp: bool
When simple_mode=True, the pool is reduced to exactly three tools:
{'BashTool', 'FileReadTool', 'FileEditTool'}
Use this for lightweight tasks where the full tool surface is not needed.
    python3 -m src.main tools --simple-mode
The default pool includes every entry in PORTED_TOOLS, subject to MCP and permission filtering. Inspect the current pool:
    python3 -m src.main tool-pool

MCP tools

Model Context Protocol tools appear in the snapshot when their name or source_hint contains mcp. They are included in the full pool by default. Exclude all MCP tools with the --no-mcp flag:
python3 -m src.main tools --no-mcp
Or in Python:
from src.tools import get_tools

tools = get_tools(include_mcp=False)
Combine --no-mcp with --deny-tool and --deny-prefix for fine-grained control over which tools are active in a session. See Permissions for details.

Snapshot format

Both commands_snapshot.json and tools_snapshot.json follow the same schema:
[
  {
    "name": "BashTool",
    "responsibility": "Execute shell commands in the user workspace",
    "source_hint": "src/tools/BashTool.ts"
  }
]
The status field is not stored in the snapshot; it defaults to 'planned' in the dataclass and is overridden to 'mirrored' by the loader functions.

Build docs developers (and LLMs) love