Skip to content

feat: add :checkhealth claudecode health check#275

Merged
ThomasK33 merged 1 commit into
mainfrom
health-check-7pqb
Jun 12, 2026
Merged

feat: add :checkhealth claudecode health check#275
ThomasK33 merged 1 commit into
mainfrom
health-check-7pqb

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

Adds :checkhealth claudecode support so users can diagnose their integration with Neovim's built-in health framework ("doctor").

New module lua/claudecode/health.lua checks, in order:

Check Severity on failure
Neovim ≥ 0.8.0 error
setup() was called (+ plugin version) error
Claude CLI resolves (terminal_cmd or claude on PATH), + CLI version error
Terminal provider sanity (snacks installed, external cmd valid, auto fallback) error / info
WebSocket server running + port warn
Lock file present in ~/.claude/ide/ (or $CLAUDE_CONFIG_DIR/ide/) error
Claude client connected (handshake-aware via is_claude_connected()) info

Following checkhealth conventions the check is synchronous and side-effect free: it does not launch a Claude instance, but verifies every prerequisite for launching and reports live connection state, with actionable advice on each failure. Includes a vim.health/require("health") compat shim for Neovim < 0.10.

No changes to existing modules — all required state was already exposed.

Testing

  • 8 new unit tests in tests/unit/health_spec.lua; full suite green (648/648)
  • luacheck + StyLua clean
  • Dogfooded in headless Neovim against a live server:
claudecode.nvim ~
- ✅ OK Neovim >= 0.8.0
- ✅ OK claudecode.nvim 0.2.0 is set up
- ✅ OK Claude CLI found: claude (/tmp/coder-script-data/bin/claude)
- CLI version: 2.1.173 (Claude Code)
- ✅ OK Terminal provider 'auto': snacks.nvim not installed, will fall back to native terminal
- ✅ OK WebSocket server running on port 17480
- ✅ OK Lock file present: /home/coder/.claude/ide/17480.lock
- No Claude Code client connected yet (launch one with :ClaudeCode)

Also verified failure paths: setup() not called (error + advice), missing CLI (error + advice), server not running (warning + advice).


Generated with mux • Model: anthropic:claude-fable-5 • Thinking: high

Adds lua/claudecode/health.lua so users can run :checkhealth claudecode
to verify Neovim version, setup() state, Claude CLI availability,
terminal provider, WebSocket server status, lock file presence, and
live Claude connection state.
@ThomasK33 ThomasK33 merged commit d42fe45 into main Jun 12, 2026
2 checks passed
@ThomasK33 ThomasK33 deleted the health-check-7pqb branch June 12, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant