What are Tools?
Tools are the primary mechanism through which Crush’s LLM agent interacts with your system. Each tool provides a specific capability, such as reading files, executing commands, or searching code. When you chat with Crush, the LLM decides which tools to use based on your request and the current context.Built-in Tools
Crush comes with a comprehensive set of built-in tools for common development tasks:File Operations
- View - Read file contents with line numbers
- Edit - Make precise text replacements in files
- Write - Create new files or overwrite existing ones
- MultiEdit - Apply multiple edits to a single file in one operation
File Discovery
- Grep - Search file contents using regex patterns
- Glob - Find files by name patterns
- LS - List directory contents in a tree structure
Command Execution
- Bash - Execute shell commands with automatic background job support
Code Intelligence (LSP-powered)
- Diagnostics - Get LSP diagnostics for files and projects
- References - Find all references to a symbol using LSP
Web & Network
- Fetch - Fetch raw content from URLs without AI processing
How the LLM Uses Tools
The LLM has been trained to use tools effectively through detailed system prompts. When you make a request:- Context Gathering - The LLM first uses View, Grep, or Glob to understand the codebase
- Planning - Based on the context, it plans which files to modify and how
- Execution - It uses Edit, Write, or Bash tools to make changes
- Verification - It may read files again or run tests to verify changes
Tool Selection Guidelines
The LLM follows these guidelines when selecting tools:- Prefer specialized tools over bash commands - Use View instead of
cat, Grep instead ofgrep, etc. - Read before writing - Always use View to read a file before editing it
- Use Edit for surgical changes - When making targeted replacements
- Use Write for new files or complete rewrites - When creating files from scratch
- Use MultiEdit for multiple changes - When making several edits to the same file
MCP Tools
In addition to built-in tools, Crush supports the Model Context Protocol (MCP), allowing you to extend Crush with custom tools from MCP servers.How MCP Tools Work
- Configure MCP servers in your
crush.jsonfile - Crush connects to configured MCP servers on startup
- Tools are registered with the prefix
mcp_<server>_<tool> - The LLM can use them just like built-in tools
Example MCP Configuration
Tool Permissions
Crush includes a permission system to protect your system from unintended changes:Auto-Approved Operations
Some operations are automatically approved without prompting:- Safe read-only commands like
git status,ls,pwd - File reads within the working directory
- Directory listings within the working directory
Permission Prompts
Crush will prompt for permission when:- Writing or modifying files (Edit, Write, MultiEdit)
- Executing potentially destructive commands (Bash)
- Accessing files outside the working directory
- Using MCP tools
Permission Responses
When prompted, you can:- Allow - Approve the operation once
- Allow all - Approve this operation and all future similar operations
- Deny - Reject the operation
Allow Lists
You can pre-approve tools for specific paths in yourcrush.json:
Disabling Tools
You can disable specific tools if you don’t want the LLM to use them:- You want to restrict Crush to read-only operations
- You’re working in a sensitive environment
- You want to control which tools are available for specific projects
Banned Commands
The Bash tool has a built-in list of banned commands to prevent dangerous operations:- Network tools -
curl,wget,ssh, etc. - System administration -
sudo,su, etc. - Package managers -
apt,brew install,npm install -g, etc. - System modification -
mount,fdisk, etc.
Best Practices
For Users
- Review permission prompts carefully before approving
- Use allow lists for trusted projects to reduce friction
- Disable unused tools to minimize attack surface
- Monitor Bash commands especially when working with unfamiliar code
For LLM (System Prompts)
- Always read before editing to understand current state
- Use parallel tool calls when operations are independent
- Provide context in descriptions for permission prompts
- Handle errors gracefully and retry with corrections
- Verify changes after making them
Tool Output Format
All tools return structured output that includes:- Content - The main result (file contents, command output, etc.)
- Metadata - Additional information (line counts, file paths, etc.)
- Diagnostics - LSP diagnostics for code files (errors, warnings)