Health Check System
Relevant source files
The following files were used as context for generating this wiki page:
The Health Check System is a comprehensive verification suite integrated into the Claude Code CLI tool. Its primary purpose is to validate the local environment, verify the installation and authentication status of Claude Code, and ensure that project-specific configurations (such as custom slash commands and hooks) are correctly implemented.
The system serves as a diagnostic tool that provides users with a clear overview of their setup's health, offering a numerical score and actionable recommendations to resolve identified issues. It is positioned as the second option in the main CLI menu and can be triggered via various command-line aliases.
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:5-20
Architecture and Components
The system is built around the HealthChecker class, which encapsulates the logic for various verification modules. The implementation is modular, separating system-level checks from application-specific and project-specific validations.
Core Modules
The Health Check System is divided into five primary verification categories:
| Category | Description |
|---|---|
| System Requirements | Validates OS compatibility (macOS, Ubuntu, Windows), Node.js version (18+), memory (4GB+), and network connectivity to the Anthropic API. |
| Claude Code Setup | Detects local/global installations, checks authentication status, and verifies directory permissions. |
| Project Configuration | Validates the presence of package.json, .git, and the .claude/ directory. |
| Custom Slash Commands | Scans for .md command files in project and personal directories, and validates $ARGUMENTS usage. |
| Hooks Configuration | Validates JSON syntax and command executability in settings.json and settings.local.json. |
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:22-54, src/health-check.js
Workflow Execution
The following diagram illustrates the high-level flow of the health check process from invocation to result display:
CLI Integration and Commands
The Health Check System is deeply integrated into the CLI's entry points. It is handled as a primary operation alongside analytics and project setup.
Command Aliases
Users can trigger the system directly using several flags:
--health-check--health--check--verify
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:13-18, bin/create-claude-config.js
User Interface
The system utilizes color-coded indicators to communicate status:
- ✅ Pass: Feature is working correctly.
- ⚠️ Warning: Feature is present but requires attention or improvement.
- ❌ Fail: Feature is missing or broken.
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:84-88
Verification Logic
Slash Command Validation
The system scans two specific directories for custom commands:
- Project-specific:
.claude/commands/ - Personal:
~/.claude/commands/
Validation ensures that these commands are in .md format and properly utilize the $ARGUMENTS placeholder for parameter handling.
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:41-46, src/health-check.js
Hooks and Settings Validation
The system performs a sequence diagram-like check for configuration files, verifying both existence and internal integrity.
Health Score Calculation
The system aggregates results into a final "Health Score." This score is calculated as a ratio of passed checks to the total number of checks performed (e.g., "10/19 checks passed"). If the score falls below a certain threshold, the CLI proactively offers to run the Project Setup flow to remediate the environment.
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:90-94, src/index.js
Summary
The Health Check System is a vital diagnostic component that ensures the Claude Code environment is optimized for development. By validating system requirements, tool installation, and configuration integrity, it reduces troubleshooting overhead and maintains consistency across projects.
Sources: cli-tool/docs_to_claude/HEALTH_CHECK_IMPLEMENTATION.md:104-118, cli-tool/templates/common/CLAUDE.md