A Claude Code plugin that gives Claude real-time PHP code intelligence via PHPantom, a fast PHP language server written in Rust with Laravel and PHPStan-aware type inference.
With the plugin installed, Claude sees diagnostics as it edits, and can use go-to-definition, find-references, hover types, and completion while working in your PHP project, the same code intelligence the PHPantom editor extensions provide.
- Instant diagnostics after every edit (unknown classes/members, argument count mismatches, unused imports, deprecations, and more).
- Code navigation: go to definition, find references, hover types.
- Framework awareness: Laravel Eloquent relationships, scopes, casts, and PHPStan generics and conditional return types.
- Project-wide CLI operations. While the plugin is enabled,
phpantom_lspis on Claude's PATH, and a bundled skill tells Claude when to use it: whole project type-coverage reports (phpantom_lsp analyze) and automated fixes across many files (phpantom_lsp fix), all from static analysis. - A
php -lsyntax check run automatically after Claude edits a.phpfile, so a syntax error is caught and surfaced immediately (skipped whenphporjqis not installed).
- Claude Code v2.1.0 or later (for LSP plugin support).
curlorwgeton your PATH, only if you want the plugin to download the language server for you. Ifphpantom_lspis already installed you need neither.
You do not need Docker, PHP, or a Rust toolchain. The language server is a single static binary that the plugin downloads for your platform on first use.
Add this marketplace and install the plugin:
/plugin marketplace add PHPantom-dev/phpantom_claude
/plugin install phpantom@phpantom
Then restart Claude Code. Open a PHP file and the language server starts
automatically; on first run it downloads the correct phpantom_lsp binary for
your platform (macOS, Linux, or Windows; x86-64 or ARM64) from GitHub Releases
and caches it under ~/.cache/phpantom-lsp.
The launcher resolves a phpantom_lsp binary in this order:
$PHPANTOM_SERVER_PATHif it points at an executable.phpantom_lspon yourPATH.- A previously downloaded, cached binary.
- A fresh download from GitHub Releases.
So if you already build or install PHPantom yourself, put it on your PATH (or
set PHPANTOM_SERVER_PATH) and nothing is downloaded.
The launcher reads these environment variables:
| Variable | Purpose |
|---|---|
PHPANTOM_SERVER_PATH |
Absolute path to a phpantom_lsp binary to use as-is. |
PHPANTOM_RELEASE_TAG |
Pin a release tag to download (e.g. 0.9.0). Defaults to the latest. |
PHPANTOM_CACHE_DIR |
Where downloads are cached. Default: ${XDG_CACHE_HOME:-~/.cache}/phpantom-lsp. |
PHPANTOM_NO_DOWNLOAD |
Set to 1 to disable auto-download (the launcher then requires a binary on PATH or via PHPANTOM_SERVER_PATH). |
Claude Code launches phpantom/bin/phpantom_lsp as the language server and
speaks LSP over its stdin/stdout. The wrapper locates or downloads a real
phpantom_lsp, then execs it so the protocol stream passes straight through.
The same wrapper is on the Bash tool's PATH, so Claude can also invoke
phpantom_lsp analyze and phpantom_lsp fix for whole-project work. The server
performs static analysis only; it never runs your PHP application.
If you also use an editor, PHPantom ships first-party extensions for VS Code / Cursor and Zed that provide the same analysis.
This plugin runs entirely on your machine, with no analytics or telemetry. See PRIVACY.md for the one network request it does make (downloading the language server binary).
MIT. See LICENSE.