Tool Reference
Complete reference for Claude Code tools, MCP servers, and integrations.
Built-in Tools
Core File Operations
Read Tool
Purpose: Read file contents with optional line ranges.
# Basic file reading
claude-code "Read the main.py file"
# Read specific lines
claude-code "Read lines 10-20 of config.py"
# Read multiple files
claude-code "Read all Python files in the src/ directory"Parameters:
file_path: Path to file (absolute or relative)start_line: Optional starting line numberend_line: Optional ending line number
Write Tool
Purpose: Create new files or overwrite existing files.
# Create new file
claude-code "Write a README.md file for this project"
# Overwrite existing file
claude-code "Rewrite the config file with new settings"Safety Features:
- Requires confirmation for existing files
- Backup created automatically
- Can be undone with git
Edit Tool
Purpose: Make targeted edits to files using find/replace.
# Replace specific text
claude-code "Change all instances of 'old_function' to 'new_function' in main.py"
# Edit specific lines
claude-code "Update the database URL in line 15 of config.py"Advanced Usage:
# Pattern-based editing
claude-code "Replace all TODO comments with actual implementations"
# Multi-file editing
claude-code "Update the import statements across all Python files"Search & Discovery Tools
Grep Tool
Purpose: Search for text patterns in files.
# Basic text search
claude-code "Find all files containing 'database'"
# Regex search
claude-code "Find all email addresses in the codebase"
# File type specific search
claude-code "Search for 'API_KEY' in all .env files"Search Patterns:
- Literal text matching
- Regular expressions
- Case-sensitive/insensitive
- File type filtering
Glob Tool
Purpose: Find files matching patterns.
# Find files by extension
claude-code "List all TypeScript files"
# Complex patterns
claude-code "Find all test files in nested directories"
# Multiple patterns
claude-code "Show all config files (json, yaml, toml)"Pattern Examples:
*.py # All Python files
**/*.test.js # All test files recursively
src/**/components/*.tsx # React components
config.{json,yaml} # Config files in multiple formatsTerminal Integration
Bash Tool
Purpose: Execute shell commands and scripts.
# Run tests
claude-code "Run the test suite"
# Build commands
claude-code "Build the project for production"
# System operations
claude-code "Check disk space and memory usage"Common Commands:
# Package management
npm install
pip install requirements.txt
yarn build
# Git operations
git status
git add .
git commit -m "message"
git push origin main
# System monitoring
df -h # Disk usage
top # Process monitor
ps aux # Running processesSafety Features:
- Dangerous commands require confirmation
- Command history tracking
- Output capture and analysis
Git Integration
Git Tool
Purpose: Version control operations.
# Status and changes
claude-code "Show git status and recent changes"
# Branch operations
claude-code "Create a new feature branch"
# Commit operations
claude-code "Commit these changes with an appropriate message"Git Workflow Commands:
# Check repository status
git status
git diff
git log --oneline -10
# Branch management
git branch -a
git checkout -b feature/new-feature
git merge main
# Remote operations
git fetch
git pull
git push origin feature/branchMCP Servers
Filesystem Server
Purpose: Enhanced file system operations.
Installation:
npm install -g @anthropic/mcp-server-filesystemConfiguration:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-filesystem", "/path/to/directory"]
}
}
}Capabilities:
- Recursive directory traversal
- File metadata access
- Advanced search operations
- Batch file operations
GitHub Server
Purpose: GitHub API integration.
Installation:
npm install -g @anthropic/mcp-server-githubConfiguration:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-github"],
"env": {
"GITHUB_TOKEN": "your-github-token"
}
}
}
}Features:
# Repository operations
claude-code "List all repositories in my GitHub account"
# Issue management
claude-code "Create an issue for this bug"
# Pull request operations
claude-code "Create a PR for the current branch"
# Release management
claude-code "Create a release with these changes"Database Servers
PostgreSQL Server
Installation:
npm install -g @anthropic/mcp-server-postgresConfiguration:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:password@host:port/database"
}
}
}
}Database Operations:
# Schema operations
claude-code "Show the database schema"
# Query execution
claude-code "Find all users created in the last week"
# Data analysis
claude-code "Analyze the most active users"SQLite Server
Installation:
npm install -g @anthropic/mcp-server-sqliteConfiguration:
{
"mcpServers": {
"sqlite": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-server-sqlite", "--db-path", "./database.db"]
}
}
}Web Server
Purpose: Web scraping and HTTP operations.
Installation:
npm install -g @anthropic/mcp-server-webWeb Operations:
# Fetch web pages
claude-code "Get the content from https://example.com"
# API calls
claude-code "Call the /users API endpoint and analyze the response"
# Web scraping
claude-code "Extract all links from this webpage"Slack Server
Purpose: Slack workspace integration.
Installation:
npm install -g @anthropic/mcp-server-slackSlack Operations:
# Channel management
claude-code "List all channels in our workspace"
# Message operations
claude-code "Send a deployment notification to the team channel"
# User management
claude-code "Find all active users in the engineering channel"IDE Integrations
VS Code Extension
Features:
- Inline Claude Code access
- File context awareness
- Terminal integration
- Command palette integration
Commands:
# Open Claude Code in current file context
Cmd+Shift+P → "Claude Code: Start in Current File"
# Quick commands
Cmd+Shift+P → "Claude Code: Explain Selection"
Cmd+Shift+P → "Claude Code: Generate Tests"
Cmd+Shift+P → "Claude Code: Review Code"Keyboard Shortcuts:
| Action | Shortcut | Description |
|---|---|---|
| Start Claude Code | Ctrl+Shift+C | Open in current context |
| Explain Code | Ctrl+Shift+E | Explain selection |
| Generate Tests | Ctrl+Shift+T | Create tests |
| Review Code | Ctrl+Shift+R | Code review |
JetBrains Plugin
Supported IDEs:
- IntelliJ IDEA
- PyCharm
- WebStorm
- PhpStorm
- CLion
Features:
- Project context integration
- Smart code suggestions
- Refactoring assistance
- Testing support
Command Line Tools
GitHub CLI (gh)
Integration: Works seamlessly with Claude Code.
Setup:
# Install GitHub CLI
brew install gh # macOS
winget install GitHub.cli # Windows
# Authenticate
gh auth login
# Configure Claude Code to use gh
# Add to CLAUDE.md:
## GitHub Operations
Use `gh` commands for all GitHub operations:
- `gh repo list` - List repositories
- `gh issue create` - Create issues
- `gh pr create` - Create pull requestsCommon Operations:
# Repository management
gh repo create my-new-repo
gh repo clone owner/repo
# Issue management
gh issue list
gh issue create --title "Bug report" --body "Description"
# Pull request workflow
gh pr create --title "Feature" --body "Description"
gh pr merge 123Docker Integration
Setup:
# Ensure Docker is installed and running
docker --version
# Add Docker commands to allowlist
claude-code config tools.allowlist add dockerContainer Operations:
# Build and run
claude-code "Build a Docker image for this application"
claude-code "Run the application in a container"
# Development workflows
claude-code "Create a development Docker Compose setup"
claude-code "Set up container for testing"Kubernetes Integration
Setup:
# Install kubectl
brew install kubectl # macOS
# Configure access to cluster
kubectl config current-contextKubernetes Operations:
# Deployment management
claude-code "Deploy this application to Kubernetes"
claude-code "Check the status of all pods"
# Debugging
claude-code "Debug why this pod is failing"
claude-code "Analyze the logs from the failed deployment"Custom Tool Development
Creating MCP Servers
Basic Structure:
// my-custom-server.ts
import { Server } from '@anthropic/mcp-sdk/server/index.js';
const server = new Server(
{
name: "my-custom-server",
version: "0.1.0",
},
{
capabilities: {
tools: {},
},
}
);
// Register tools
server.setRequestHandler('tools/list', async () => {
return {
tools: [
{
name: "my_custom_tool",
description: "Does something useful",
inputSchema: {
type: "object",
properties: {
input: {
type: "string",
description: "Input parameter"
}
},
required: ["input"]
}
}
]
};
});
server.setRequestHandler('tools/call', async (request) => {
if (request.params.name === "my_custom_tool") {
// Implement tool logic here
return {
content: [
{
type: "text",
text: "Tool executed successfully"
}
]
};
}
});Tool Configuration
Project Configuration (.mcp.json):
{
"mcpServers": {
"my-custom-server": {
"command": "node",
"args": ["./my-custom-server.js"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}Global Configuration (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"global-tool": {
"command": "npx",
"args": ["-y", "@my-company/mcp-server"],
"env": {
"CONFIG_PATH": "/path/to/config"
}
}
}
}Tool Performance & Monitoring
Performance Metrics
# Monitor tool usage
claude-code --tool-stats
# Check MCP server status
claude-code --mcp-status
# Performance profiling
claude-code --profile-toolsTroubleshooting Tools
Debug Mode:
# Enable debug logging
claude-code --debug
# Test specific tools
claude-code --test-tool bash
claude-code --test-mcp filesystemCommon Issues:
| Issue | Solution |
|---|---|
| Tool not found | Check installation and PATH |
| Permission denied | Update tool allowlist |
| MCP server failed | Check server logs and config |
| Slow tool response | Optimize tool implementation |
Tool Optimization
Best Practices:
- Minimize tool calls - Combine operations when possible
- Cache results - Store frequently accessed data
- Parallel execution - Run independent tools concurrently
- Error handling - Implement robust error recovery
- Resource limits - Set appropriate timeouts and limits
Configuration Optimization:
{
"tools": {
"timeout": 30000,
"max_concurrent": 5,
"cache_ttl": 300,
"retry_attempts": 3
}
}Quick Reference: Use /tools command in Claude Code to see all available tools and their current status.