facebook / facebook/pyrefly

Document (and optionally ship) Pyrefly as a Claude Code LSP for semantic navigation

Open
#3,611 6 comments 1 reaction 0 assignees View on GitHub
documentation language-server
Dominant language
Rust
Stars
7k
Forks
519
PR merge metrics
No merged PRs in 30d

Description

Is there interest in documenting Pyrefly as an LSP for Claude Code?

To be clear, this is not about the final type correctness checking, which I 100% agree should be via the CLI (e.g., via a pre-commit configuration), but about allowing the agent to find definitions and usages, and to retrieve type information. The typical fallback of Claude Code, `grep`, is slower, less precise, and consumes more context tokens.

I didn't look into the details too much, but there is the `pyright-lsp` plugin [already](https://code.claude.com/docs/en/plugins-reference). In principle, it should be possible to define a custom plugin that uses pyrefly's LSP here via an entry in [`.lsp.json`](https://code.claude.com/docs/en/plugins-reference#file-locations-reference).

I think this would be a nice addition to the [IDE docs](https://pyrefly.org/en/docs/IDE/) and would allow users to stay in the pyrefly ecosystem.

Optionally, you could submit a plugin to the Claude marketplace that sets exactly these values and just takes pyrefly from `PATH`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.