Skip to content

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.

bash
# 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 number
  • end_line: Optional ending line number

Write Tool

Purpose: Create new files or overwrite existing files.

bash
# 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.

bash
# 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:

python
# 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.

bash
# 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.

bash
# 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:

bash
*.py                    # All Python files
**/*.test.js           # All test files recursively
src/**/components/*.tsx # React components
config.{json,yaml}     # Config files in multiple formats

Terminal Integration

Bash Tool

Purpose: Execute shell commands and scripts.

bash
# 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:

bash
# 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 processes

Safety Features:

  • Dangerous commands require confirmation
  • Command history tracking
  • Output capture and analysis

Git Integration

Git Tool

Purpose: Version control operations.

bash
# 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:

bash
# 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/branch

MCP Servers

Filesystem Server

Purpose: Enhanced file system operations.

Installation:

bash
npm install -g @anthropic/mcp-server-filesystem

Configuration:

json
{
  "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:

bash
npm install -g @anthropic/mcp-server-github

Configuration:

json
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-github"],
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}

Features:

bash
# 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:

bash
npm install -g @anthropic/mcp-server-postgres

Configuration:

json
{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-postgres"],
      "env": {
        "DATABASE_URL": "postgresql://user:password@host:port/database"
      }
    }
  }
}

Database Operations:

bash
# 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:

bash
npm install -g @anthropic/mcp-server-sqlite

Configuration:

json
{
  "mcpServers": {
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-sqlite", "--db-path", "./database.db"]
    }
  }
}

Web Server

Purpose: Web scraping and HTTP operations.

Installation:

bash
npm install -g @anthropic/mcp-server-web

Web Operations:

bash
# 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:

bash
npm install -g @anthropic/mcp-server-slack

Slack Operations:

bash
# 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:

bash
# 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:

ActionShortcutDescription
Start Claude CodeCtrl+Shift+COpen in current context
Explain CodeCtrl+Shift+EExplain selection
Generate TestsCtrl+Shift+TCreate tests
Review CodeCtrl+Shift+RCode 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:

bash
# 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 requests

Common Operations:

bash
# 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 123

Docker Integration

Setup:

bash
# Ensure Docker is installed and running
docker --version

# Add Docker commands to allowlist
claude-code config tools.allowlist add docker

Container Operations:

bash
# 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:

bash
# Install kubectl
brew install kubectl  # macOS

# Configure access to cluster
kubectl config current-context

Kubernetes Operations:

bash
# 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:

typescript
// 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):

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):

json
{
  "mcpServers": {
    "global-tool": {
      "command": "npx",
      "args": ["-y", "@my-company/mcp-server"],
      "env": {
        "CONFIG_PATH": "/path/to/config"
      }
    }
  }
}

Tool Performance & Monitoring

Performance Metrics

bash
# Monitor tool usage
claude-code --tool-stats

# Check MCP server status
claude-code --mcp-status

# Performance profiling
claude-code --profile-tools

Troubleshooting Tools

Debug Mode:

bash
# Enable debug logging
claude-code --debug

# Test specific tools
claude-code --test-tool bash
claude-code --test-mcp filesystem

Common Issues:

IssueSolution
Tool not foundCheck installation and PATH
Permission deniedUpdate tool allowlist
MCP server failedCheck server logs and config
Slow tool responseOptimize tool implementation

Tool Optimization

Best Practices:

  1. Minimize tool calls - Combine operations when possible
  2. Cache results - Store frequently accessed data
  3. Parallel execution - Run independent tools concurrently
  4. Error handling - Implement robust error recovery
  5. Resource limits - Set appropriate timeouts and limits

Configuration Optimization:

json
{
  "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.

Claude Code Documentation Hub