{"id":48582526,"url":"https://github.com/zircote/lsp-tools","last_synced_at":"2026-04-08T17:34:12.577Z","repository":{"id":332273783,"uuid":"1126949325","full_name":"zircote/lsp-tools","owner":"zircote","description":"LSP-first code intelligence for Claude Code with strong enforcement patterns. Part of the zircote-lsp marketplace.","archived":false,"fork":false,"pushed_at":"2026-02-28T01:36:18.000Z","size":134,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-28T07:27:49.132Z","etag":null,"topics":["claude-code","claude-code-plugin","code-intelligence","developer-tools","golang","java","language-server","lsp","python","rust","terraform","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zircote.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"zircote"}},"created_at":"2026-01-02T21:52:39.000Z","updated_at":"2026-02-28T01:36:16.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zircote/lsp-tools","commit_stats":null,"previous_names":["zircote/lsp-tools"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zircote/lsp-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Flsp-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Flsp-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Flsp-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Flsp-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zircote","download_url":"https://codeload.github.com/zircote/lsp-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Flsp-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31567056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","claude-code-plugin","code-intelligence","developer-tools","golang","java","language-server","lsp","python","rust","terraform","typescript"],"created_at":"2026-04-08T17:34:11.850Z","updated_at":"2026-04-08T17:34:12.569Z","avatar_url":"https://github.com/zircote.png","language":"Shell","readme":"# LSP Tools Plugin\n\n\u003e LSP-first code intelligence for Claude Code with strong enforcement patterns\n\n[![Version](https://img.shields.io/badge/version-0.4.0-blue.svg)](CHANGELOG.md)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n[![Claude Plugin](https://img.shields.io/badge/claude-plugin-orange.svg)](https://docs.anthropic.com/en/docs/claude-code/plugins)\n[![Marketplace](https://img.shields.io/badge/marketplace-zircote--lsp-purple.svg)](https://github.com/zircote/lsp-marketplace)\n[![CI](https://github.com/zircote/lsp-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/zircote/lsp-tools/actions/workflows/ci.yml)\n\n## Overview\n\nLSP Tools enforces semantic code navigation using Language Server Protocol, providing IDE-like precision for code operations. The plugin ensures Claude uses LSP operations before modifying code, analyzes impact before refactoring, and verifies changes with diagnostics.\n\n**Part of the [zircote-lsp marketplace](https://github.com/zircote/lsp-marketplace)** - A collection of LSP-focused plugins for Claude Code.\n\n### Key Features\n\n- **Three Iron Laws** - Mandatory behavioral constraints for code operations\n- **14 Language Support** - TypeScript, Python, Go, Rust, Java, Kotlin, C/C++, C#, PHP, Ruby, HTML/CSS, LaTeX, Markdown, Terraform\n- **Setup Command** - Automatically configures hooks for your project\n- **Specialized Plugin Integration** - Defers to `zircote/*-lsp` plugins when installed\n- **Decision Trees** - Clear guidance on when to use LSP vs Grep vs Glob\n\n## Installation\n\n```bash\n# Install from zircote-lsp marketplace\n/plugin install lsp-tools@zircote-lsp\n```\n\n### Prerequisites\n\n1. **Enable LSP in Claude Code:**\n   ```bash\n   # Add to your shell profile (~/.bashrc, ~/.zshrc)\n   export ENABLE_LSP_TOOL=1\n   ```\n\n2. **Install language servers for your languages:**\n   ```bash\n   # TypeScript/JavaScript\n   npm install -g @vtsls/language-server typescript\n\n   # Python\n   npm install -g pyright\n\n   # Go\n   go install golang.org/x/tools/gopls@latest\n\n   # Rust\n   rustup component add rust-analyzer\n   ```\n\n   See [references/lsp-setup-verification.md](skills/lsp-enable/references/lsp-setup-verification.md) for all languages.\n\n## Usage\n\n### The Three Iron Laws\n\nThe skill enforces these mandatory behaviors:\n\n```\n1. NO MODIFYING UNFAMILIAR CODE WITHOUT goToDefinition FIRST\n2. NO REFACTORING WITHOUT findReferences IMPACT ANALYSIS FIRST\n3. NO CLAIMING CODE WORKS WITHOUT LSP DIAGNOSTICS VERIFICATION\n```\n\n### Trigger Phrases\n\nThe skill activates when you say:\n- \"find definition\", \"go to definition\", \"where is X defined\"\n- \"find references\", \"who uses this\", \"what calls this function\"\n- \"understand this code\", \"trace this function\", \"explore codebase\"\n- \"before I refactor\", \"impact of changing\", \"safe to rename\"\n- \"analyze dependencies\", \"call hierarchy\", \"incoming calls\"\n\n### Setup Command\n\nSet up LSP hooks for your project:\n\n```bash\n# Auto-detect languages in project\n/lsp-tools:lsp-setup\n\n# Specify languages explicitly\n/lsp-tools:lsp-setup typescript python\n\n# Single language\n/lsp-tools:lsp-setup go\n```\n\nThis command:\n1. Detects languages used in your project\n2. Copies appropriate hooks to `.claude/hooks.json`\n3. Optionally appends LSP guidance to `CLAUDE.md`\n\n### LSP Operations\n\n| Operation | Purpose | Use Before |\n|-----------|---------|------------|\n| `goToDefinition` | Jump to where symbol is defined | Modifying unfamiliar code |\n| `findReferences` | Find all usages of a symbol | Refactoring, renaming |\n| `goToImplementation` | Find interface implementations | Working with polymorphism |\n| `hover` | Get type info, docs, signatures | Understanding APIs |\n| `documentSymbol` | List all symbols in a file | Understanding large files |\n| `workspaceSymbol` | Search symbols across codebase | Finding related code |\n| `incomingCalls` | Find callers of a function | Impact analysis |\n| `outgoingCalls` | Find functions called by target | Dependency tracing |\n\n### Decision Tree\n\n```\nWHAT DO YOU NEED?\n│\n├─ Symbol definition or implementation\n│  └─ USE LSP: goToDefinition, goToImplementation\n│\n├─ All usages of a symbol\n│  └─ USE LSP: findReferences\n│\n├─ Type info, docs, or signatures\n│  └─ USE LSP: hover\n│\n├─ Call graph or dependencies\n│  └─ USE LSP: incomingCalls, outgoingCalls\n│\n├─ Literal text search (TODOs, strings, config)\n│  └─ USE: Grep\n│\n└─ File discovery by pattern\n   └─ USE: Glob\n```\n\n## Supported Languages\n\n| Language | LSP Server | Hooks File | Specialized Plugin |\n|----------|-----------|------------|-------------------|\n| TypeScript/JavaScript | vtsls | `typescript-hooks.json` | — |\n| Python | pyright | `python-hooks.json` | — |\n| Go | gopls | `go-hooks.json` | — |\n| Rust | rust-analyzer | `rust-hooks.json` | `zircote/rust-lsp` (16 hooks) |\n| Java | jdtls | `java-hooks.json` | — |\n| Kotlin | kotlin-language-server | `kotlin-hooks.json` | — |\n| C/C++ | clangd | `cpp-hooks.json` | — |\n| C# | OmniSharp | `csharp-hooks.json` | — |\n| PHP | phpactor | `php-hooks.json` | — |\n| Ruby | ruby-lsp | `ruby-hooks.json` | — |\n| HTML/CSS | vscode-langservers | `html-css-hooks.json` | — |\n| LaTeX | texlab | `latex-hooks.json` | — |\n| Markdown | marksman | `markdown-hooks.json` | `zircote/markdown-lsp` (4 hooks) |\n| Terraform | terraform-ls | `terraform-hooks.json` | `zircote/terraform-lsp` (17 hooks) |\n\n### Specialized Plugin Integration\n\nWhen a `zircote/*-lsp` plugin is installed, lsp-tools automatically defers to it:\n\n- **Hook installation is skipped** for languages covered by specialized plugins\n- **LSP server installation uses the specialized plugin's `/setup` command**\n- **The final report shows** which hooks come from which source\n\nThis prevents duplicate hooks and ensures you get the full benefits of the specialized plugins (which include additional tooling like security scanners, linters, and formatters beyond basic LSP).\n\n## Plugin Structure\n\n```\nlsp-tools/\n├── .claude-plugin/\n│   └── plugin.json           # Plugin manifest\n├── commands/\n│   └── lsp-setup.md          # Setup command\n├── skills/\n│   └── lsp-enable/\n│       ├── SKILL.md          # Main enforcement skill\n│       └── references/\n│           ├── lsp-operations-guide.md\n│           ├── lsp-enforcement-protocol.md\n│           ├── lsp-decision-matrix.md\n│           ├── lsp-setup-verification.md\n│           ├── SETUP-GUIDE-ALL-LANGUAGES.md\n│           ├── {language}-lsp-section.md  # Per-language guidance\n│           └── {language}-hooks.json      # Per-language hooks\n├── README.md\n├── CHANGELOG.md\n└── .bumpversion.toml\n```\n\n## How Hooks Work\n\nWhen you run `/lsp-tools:lsp-setup`, the command copies language-appropriate hooks to your project's `.claude/hooks.json`. These hooks automatically:\n\n- **Format on edit** - Run formatters (prettier, ruff, gofmt) after file changes\n- **Lint on edit** - Check for lint errors after edits\n- **Typecheck on edit** - Run type checkers (tsc, pyright) after changes\n- **Pre-commit gate** - Block commits if quality checks fail\n\nExample TypeScript hooks:\n```json\n{\n  \"hooks\": [\n    {\n      \"name\": \"format-on-edit\",\n      \"event\": \"PostToolUse\",\n      \"matcher\": \"Write|Edit\",\n      \"command\": \"npx prettier --write $CLAUDE_FILE_PATHS\"\n    },\n    {\n      \"name\": \"typecheck-on-edit\",\n      \"event\": \"PostToolUse\",\n      \"matcher\": \"Write|Edit\",\n      \"command\": \"npx tsc --noEmit\"\n    }\n  ]\n}\n```\n\n## Why LSP Over Grep?\n\n| Metric | LSP | Grep |\n|--------|-----|------|\n| **Speed (large codebase)** | ~50ms | 45+ seconds |\n| **Accuracy** | Exact semantic matches | Text patterns (false positives) |\n| **Token usage** | ~500 tokens | Burns tokens on irrelevant matches |\n| **Type resolution** | Follows aliases, re-exports | Text only |\n\n**Example:**\n```\nGrep \"getUserById\" → 500+ matches (comments, strings, similar names)\nLSP findReferences → 23 matches (exact function usages only)\n```\n\n## Related Plugins\n\nOther plugins in the [zircote-lsp marketplace](https://github.com/zircote/lsp-marketplace):\n\n| Plugin | Description |\n|--------|-------------|\n| `typescript-lsp` | TypeScript/JavaScript development environment |\n| `python-lsp` | Python development with pyright |\n| `go-lsp` | Go development with gopls |\n| `rust-lsp` | Rust development with rust-analyzer (16 hooks) |\n| `java-lsp` | Java development with jdtls |\n| `kotlin-lsp` | Kotlin development |\n| `terraform-lsp` | Terraform/OpenTofu IaC (17 hooks) |\n| `markdown-lsp` | Markdown documentation (4 hooks) |\n\n## Reference Documentation\n\n| Document | Purpose |\n|----------|---------|\n| [LSP Operations Guide](skills/lsp-enable/references/lsp-operations-guide.md) | Complete guide to all 9 LSP operations |\n| [Enforcement Protocol](skills/lsp-enable/references/lsp-enforcement-protocol.md) | Detailed enforcement patterns and scenarios |\n| [Decision Matrix](skills/lsp-enable/references/lsp-decision-matrix.md) | When to use LSP vs Grep vs Glob vs Read |\n| [Setup \u0026 Verification](skills/lsp-enable/references/lsp-setup-verification.md) | Installation and troubleshooting |\n| [All Languages Guide](skills/lsp-enable/references/SETUP-GUIDE-ALL-LANGUAGES.md) | Quick setup for all 14 languages |\n\n## Troubleshooting\n\n### LSP Not Working\n\n1. Verify environment variable:\n   ```bash\n   echo $ENABLE_LSP_TOOL  # Should output \"1\"\n   ```\n\n2. Check language server is installed:\n   ```bash\n   which pyright  # or gopls, rust-analyzer, etc.\n   ```\n\n3. Restart Claude Code session after setting environment variable\n\n### Hooks Not Activating\n\n1. Verify `.claude/hooks.json` exists in your project\n2. Check hook syntax is valid JSON\n3. Ensure file extensions match hook conditions\n\n## Contributing\n\nContributions welcome! Please:\n1. Follow existing code style\n2. Add tests for new functionality\n3. Update documentation\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for version history.\n","funding_links":["https://github.com/sponsors/zircote"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Flsp-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzircote%2Flsp-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Flsp-tools/lists"}