claude-eslint
ESLint diagnostics and auto-fix plugin for Claude Code.
Why
Running eslint as a one-off command on a large codebase is slow — it has to parse and analyze every file from scratch each time. By keeping a long-running ESLint LSP server warm for the entire session, this plugin can lint and auto-fix instantly after every agent edit, without the cold-start penalty.
Prerequisites
- Node.js >= 16
eslintinstalled in your project (flat configeslint.config.jsor legacy.eslintrc.*)
Usage
claude --plugin-dir /path/to/claude-eslintHow It Works
This plugin runs a single ESLint LSP server (from sublimelsp/LSP-eslint) via a proxy daemon:
- LSP Diagnostics: Claude Code sees ESLint issues natively through the LSP integration (
.lsp.json) - Auto-fix on Edit: A PostToolUse hook automatically applies ESLint fixes after every file edit/write
The proxy daemon (scripts/eslint-daemon.mjs) sits between Claude Code and the ESLint server:
- Forwards all LSP messages bidirectionally (transparent proxy)
- Caches
textDocument/publishDiagnosticsfor fast access - Exposes a Unix socket at
/tmp/claude-eslint-<hash>.sockfor the auto-fix hook
The hook (scripts/eslint-autofix.mjs) connects to the daemon's socket after each edit to request source.fixAll.eslint code actions, which are applied directly to disk. Remaining unfixable issues are reported back to Claude.
Debugging
claude --plugin-dir /path/to/claude-eslint --debugCheck for the daemon socket while a session is active:
ls /tmp/claude-eslint-*.sock