Skip to main content
skill CX Codex

lsp-cross-repo — Claude Code skill: what it does, how to install

Locates callers of a library symbol across consumer repositories via LSP. Useful when preparing to refactor or remove shared code without breaking dependents.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add blackwell-systems/agent-lsp --skill lsp-cross-repo -a claude-code
Open on GitHub

What lsp-cross-repo does

The skill performs read-only cross-repository symbol lookups across multiple codebases. It solves the blast-radius problem when editing a shared library consumed by multiple applications. Single-repo impact analysis is left to /lsp-impact, while this tool handles multi-root consumer setups.

First, the skill initializes the language server on the library root via mcp__lsp__start_lsp and pinpoints definition coordinates using mcp__lsp__find_symbol. It then invokes mcp__lsp__get_cross_repo_references with target consumer paths. This step registers each consumer as a workspace folder, waits for indexing to finish, and partitions detected references by repository. It can also inspect incoming call hierarchies and interface implementations.

Execution fails without a running agent-lsp MCP server. The underlying language server must support referencesProvider. If an indexer cannot process a consumer root, it records that path in the warnings list for manual verification.

What it helps with

  • Find all callers of a library symbol across consumer repositories
  • Verify zero dependents before deleting deprecated shared methods
  • List external implementations of a library interface
  • Audit package usage across multiple microservices

Example prompts for the agent

  • Find all callers of ParseConfig from /repos/config-lib in /repos/api-service and /repos/worker.
  • Check if any consumer repository still references LegacyClient before I delete it.
  • List all implementations of the Logger interface located in /repos/backend-service.

How to install lsp-cross-repo

1Skills CLI (Vercel)

npx skills add blackwell-systems/agent-lsp --skill lsp-cross-repo -a claude-code

2Manually: put the files in place

~/.claude/skills/lsp-cross-repo/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/lsp-cross-repo/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about lsp-cross-repo

How to install lsp-cross-repo in Claude Code?

Run npx skills add blackwell-systems/agent-lsp --skill lsp-cross-repo -a claude-code. This installs the definition to ~/.claude/skills/lsp-cross-repo/SKILL.md.

What does lsp-cross-repo do?

It indexes consumer roots as workspace folders and queries the language server for symbol references. Results are returned partitioned by repository alongside any indexing warnings.

What prerequisites does lsp-cross-repo require?

You need the agent-lsp MCP server configured and running. The underlying language server must declare the referencesProvider capability.

Source text

SKILL.md · MIT
---
name: lsp-cross-repo
description: Cross-repository analysis — find all callers of a library symbol in one or more consumer repos. Use when refactoring a shared library and need to understand how consumers use it.
argument-hint: "[symbol-name] in [library-file:line:col] used by [consumer-root ...]"
user-invocable: true
allowed-tools: mcp__lsp__start_lsp mcp__lsp__find_symbol mcp__lsp__get_cross_repo_references mcp__lsp__add_workspace_folder mcp__lsp__list_workspace_folders mcp__lsp__go_to_implementation mcp__lsp__find_callers mcp__lsp__inspect_symbol
license: MIT
compatibility: Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
metadata:
  required-capabilities: referencesProvider
  optional-capabilities: implementationProvider callHierarchyProvider workspaceSymbolProvider
---

> Requires the agent-lsp MCP server.

# lsp-cross-repo

Multi-root cross-repo caller analysis for library + consumer workflows. Finds all
usages of a library symbol across one or more consumer codebases in a single call.

Read-only — does not modify any files.

## When to use

- Before changing a library API: find all callers in every consumer
- Before deleting a symbol: verify it has no cross-repo dependents
- When a change in repo A might break repo B or C
- Auditing how internal packages are used across services

Use `/lsp-impact` instead for single-repo blast-radius analysis.

## Workflow

### Step 1 — Initialize the primary workspace

Start the language server on the library root if not already running:

```
mcp__lsp__start_lsp({ "root_dir": "/path/to/library" })
```

### Step 2 — Locate the library symbol

Find the symbol's definition to get `file_path`, `line`, and `column`:

```
mcp__lsp__find_symbol({ "query": "<symbol-name>" })
```

Pick the result in the library repo (not a test file).

### Step 3 — Find all cross-repo references (primary step)

Call `get_cross_repo_references` with the symbol location and all consumer repo
roots. This adds each consumer as a workspace folder, waits for indexing, runs
`find_references` across all roots, and returns results partitioned by repo:

```
mcp__lsp__get_cross_repo_references({
  "symbol_file": "/abs/path/to/library/file.go",
  "line": <line>,
  "column": <column>,
  "consumer_roots": [
    "/abs/path/to/consumer-a",
    "/abs/path/to/consumer-b"
  ]
})
```

Returns:
- `library_references` — usages within the library itself
- `consumer_references` — a map of `consumer-root → [file:line ...]`
- `warnings` — any roots that could not be indexed (check these manually)

**Decision after Step 3:**

| Result | Action |
|--------|--------|
| No consumer refs | Safe to change — verify `warnings` is empty first |
| Consumer refs found | Run `/lsp-impact` on each call site before editing |
| `warnings` non-empty | Re-add that root manually and retry Step 3 |

### Step 4 — Callers and implementations (optional)

For a deeper look at how consumers call the symbol:

```
mcp__lsp__find_callers({
  "file_path": "<library-file>",
  "line": <line>,
  "column": <column>,
  "direction": "incoming"
})
```

For interfaces — all consumer-side implementations:

```
mcp__lsp__go_to_implementation({
  "file_path": "<library-file>",
  "line": <line>,
  "column": <column>
})
```

## Output format

```
## Library-internal references
- file:line — brief context

## Consumer references

### /path/to/consumer-a
- file:line — brief context

### /path/to/consumer-b
- file:line — brief context
```

## Decision guide

| Situation | Action |
|-----------|--------|
| No consumer refs, warnings empty | Safe to change |
| Consumer refs found | Run `/lsp-impact` on each call site before editing |
| `warnings` lists a consumer root | That root failed indexing — check LSP logs |
| Consumer uses interface, not concrete type | Use `go_to_implementation` to find all implementors |

## Example

```
# Refactoring ParseConfig in a shared config library used by 3 services

start_lsp(root_dir="/repos/config-lib")
find_symbol(query="ParseConfig")        # find definition → file:42:6
get_cross_repo_references(
  symbol_file="/repos/config-lib/pkg/config/parser.go",
  line=42, column=6,
  consumer_roots=["/repos/api-service", "/repos/worker-service", "/repos/batch-job"]
)
# → library_references: 2
# → consumer_references: {api-service: [main.go:14, app.go:31], worker-service: [runner.go:8]}
# → warnings: []
```

© blackwell-systems · MIT · blackwell-systems/agent-lsp

Similar skills

All skills for Code review and refactoring →

From the same set25

lsp-explore Inspect a symbol’s definition, type details, implementations, callers, and references in one report. Useful when you’re finding your way around an unfamiliar codebase. CX Codex +1 ★ 165repo stars lsp-edit-symbol Changes a function, type or variable by name when you don't know the file or position. Runs on the agent-lsp MCP server. CX Codex +1 ★ 165repo stars lsp-edit-export A guided workflow for editing exported symbols and public APIs. It finds every caller via LSP, pauses for explicit confirmation, and verifies the build. CX Codex +1 ★ 165repo stars lsp-docs This skill looks up symbol details through LSP, local toolchain docs, then source code. Use it when hover has little to show or a dependency is not indexed. CX Codex +1 ★ 165repo stars lsp-dead-code The skill lists exported symbols in a file and checks each one for references across the workspace. Useful when you want to know which exports are safe to drop. CX Codex +1 ★ 165repo stars lsp-concurrency-audit This skill checks how a type’s or file’s fields are accessed across concurrent contexts and produces a safety report. Use it before refactoring or when investigating possible data races. CX Codex +1 ★ 165repo stars lsp-architecture Produces a structural overview of a repository: languages, packages, entry points, dependency flow and hotspot files. One call instead of a manual sweep. CX Codex +1 ★ 165repo stars agent-lsp Coordinates language servers into 65 agent tools across 32 languages, keeping project indexes warm and testing edits in memory. CX Codex +1 ★ 165repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor