Skip to main content
The Health Check tool performs a comprehensive validation of your Claude Code installation, system requirements, project configuration, and component setup. It identifies issues and provides actionable recommendations.

Run Health Check

Execute full system health check:
Example Output:

Check Categories

The health check validates seven categories:

1. System Requirements:lines/health-check.js:70

Operating System:lines/health-check.js:295
  • Validates platform (macOS, Linux, Windows)
  • Checks OS version compatibility
  • Supported: macOS 10.15+, Linux 20.04+, Windows 10+
Node.js Version:lines/health-check.js:319
  • Requires Node.js 18 or higher
  • Displays current version
  • Warns if outdated
Memory Available:lines/health-check.js:343
  • Checks total and free memory
  • Recommends 4GB+ RAM
  • Shows current usage
Network Connection:lines/health-check.js:362
  • Tests connection to api.anthropic.com
  • 5-second timeout
  • Detects slow connections
Shell Environment:lines/health-check.js:395
  • Identifies current shell (bash, zsh, fish)
  • Recommends zsh for autocompletion
  • Checks $SHELL environment variable

2. Claude Code Setup:lines/health-check.js:109

Installation:lines/health-check.js:421
  • Checks local node_modules/@anthropic-ai/claude-code
  • Checks global claude command
  • Displays version
Authentication:lines/health-check.js:454
  • Reads ~/.claude.json
  • Checks OAuth account (email)
  • Checks API key
  • Validates ANTHROPIC_API_KEY env var
Auto-updates:lines/health-check.js:531
  • Placeholder check
  • Assumes enabled by default
Permissions:lines/health-check.js:539
  • Validates ~/.claude directory access
  • Checks write permissions
  • Ensures directory exists

3. Project Setup:lines/health-check.js:142

Project Structure:lines/health-check.js:565
  • Looks for project indicators:
    • package.json (Node.js)
    • requirements.txt (Python)
    • Cargo.toml (Rust)
    • go.mod (Go)
    • .git (Git repository)
    • README.md
Configuration Files:lines/health-check.js:595
  • Checks .claude/ directory exists
  • Counts files in directory
  • Lists configuration files
User Settings:lines/health-check.js:1110
  • Reads ~/.claude/settings.json
  • Validates JSON syntax
  • Analyzes structure:lines/health-check.js:1197
    • Permissions (allow/deny rules)
    • Hooks configuration
    • Environment variables
    • Model settings
    • MCP auto-approval
Project Settings:lines/health-check.js:1139
  • Reads .claude/settings.json
  • Validates JSON syntax
  • Same structure analysis as user settings
Local Settings:lines/health-check.js:1168
  • Reads .claude/settings.local.json
  • Optional file for machine-specific config
  • Validates JSON syntax

4. Agents:lines/health-check.js:181

Project Agents:lines/health-check.js:803
  • Scans .claude/agents/ directory
  • Recursively counts .md files
  • Reports total agent count
Personal Agents:lines/health-check.js:821
  • Scans ~/.claude/agents/ directory
  • Recursively counts .md files
  • Reports total agent count
Agent Syntax:lines/health-check.js:858
  • Validates frontmatter presence
  • Checks for name: field
  • Checks for description: field
  • Reports malformed agents

5. Custom Commands:lines/health-check.js:229

Project Commands:lines/health-check.js:730
  • Scans .claude/commands/ directory
  • Counts .md files
  • Reports total command count
Personal Commands:lines/health-check.js:748
  • Scans ~/.claude/commands/ directory
  • Counts .md files
  • Reports total command count
Command Syntax:lines/health-check.js:766
  • Checks for $ARGUMENTS placeholder
  • Reports commands missing placeholder
  • Essential for parameter handling

6. MCP Servers:lines/health-check.js:208

Project MCP Config:lines/health-check.js:613
  • Reads .mcp.json in project
  • Counts configured servers
  • Validates mcpServers object
MCP Config Syntax:lines/health-check.js:647
  • Validates each server configuration
  • Required fields:
    • command: Executable path
  • Optional fields:
    • args: Array of arguments
    • env: Object of environment variables
  • Reports invalid configurations

7. Hooks:lines/health-check.js:256

User Hooks:lines/health-check.js:926
  • Reads ~/.claude/settings.json
  • Extracts hooks array
  • Counts configured hooks
Project Hooks:lines/health-check.js:952
  • Reads .claude/settings.json
  • Extracts hooks array
  • Counts configured hooks
Local Hooks:lines/health-check.js:978
  • Reads .claude/settings.local.json
  • Extracts hooks array
  • Counts configured hooks
Hook Commands:lines/health-check.js:1004
  • Validates each hook command exists
  • Checks if command is executable
  • Validates shell builtins:lines/health-check.js:1080
    • echo, cd, pwd, test, etc.
  • Uses command -v to check existence:lines/health-check.js:1089
MCP Hooks:lines/health-check.js:1102
  • Placeholder for future validation
  • Currently returns warning

Status Indicators

Each check returns one of three statuses:
  • βœ… Pass: Check completed successfully
  • ⚠️ Warn: Non-critical issue found
  • ❌ Fail: Critical issue requiring attention

Health Score

Calculated as:lines/health-check.js:1310
Score ranges:
  • 90-100%: Excellent
  • 80-89%: Good
  • 70-79%: Fair
  • Below 70%: Needs attention

Recommendations

Automatically generated based on findings:lines/health-check.js:1333 Example recommendations:
  • β€œConsider switching to Zsh for better autocompletion”
  • β€œAdd $ARGUMENTS placeholder to command files”
  • β€œAdd proper frontmatter to agent files”
  • β€œCreate .claude/agents/ directory”
  • β€œCreate .mcp.json for MCP servers”
  • β€œFix JSON syntax errors in configuration”

Post-Check Setup

After the health check, you’re prompted to run project setup:lines/health-check.js:1383
Setup runs automatically if score is below 80%.

Usage Patterns

New Project Setup

Pre-deployment Check

Troubleshooting

API Usage

Import and use programmatically:

Configuration Validation

Settings structure analysis:lines/health-check.js:1197 Permissions checked:
  • allow rules (array)
  • deny rules (array)
  • additionalDirectories (array)
Hooks checked:
  • Valid hook types: PreToolUse, PostToolUse, Stop, Notification
  • Hook structure validation
Environment variables:
  • Lists env vars
  • Warns on sensitive vars in project settings:
    • ANTHROPIC_API_KEY
    • ANTHROPIC_AUTH_TOKEN
MCP configuration:
  • enableAllProjectMcpServers setting
  • enabledMcpjsonServers array
  • disabledMcpjsonServers array
Other settings:
  • model: Model selection
  • cleanupPeriodDays: Conversation cleanup (must be β‰₯ 1)
  • apiKeyHelper: API key management

Example: Automated CI Check

Troubleshooting

Authentication Fails

Error: Claude CLI not available or not authenticated Solutions:
  1. Run claude login to authenticate
  2. Set ANTHROPIC_API_KEY environment variable
  3. Create ~/.claude.json with OAuth credentials

Permission Denied

Error: Permission check failed Fix permissions:

Invalid JSON Syntax

Error: Invalid JSON in .claude/settings.json Validate JSON:

Hook Command Not Found

Error: Command not found: my-script Ensure script is:
  1. Executable: chmod +x my-script
  2. In PATH or use absolute path
  3. Shell builtin or installed command

See Also