Two-phase safe rename across the entire workspace. An agent skill from blackwell-systems/agent-lsp.

MITAuto-check passedAgent Workflows

Install Lsp Rename

skills CLI
$ npx skills add blackwell-systems/agent-lsp --skill lsp-rename -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install blackwell-systems/agent-lsp lsp-rename --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/blackwell-systems/agent-lsp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/lsp-rename .claude/skills/lsp-rename && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
lsp-rename
GitHub stars
160
Token cost
~1.9k tokens
SKILL.md length
603 words
Files
2 (incl. references)
Skills in repo
24
Repo updated
First seen
Licence
MIT

At a glance

Two-phase safe rename across the entire workspace. An agent skill from blackwell-systems/agent-lsp.

  • Works in 2 steps: Preview → Execute
  • Renaming any symbol
  • SKILL.md covers Prerequisites, Phase 1: Preview, Edge Case: 0 References and Phase 2: Execute, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Lsp Rename is an agent skill from blackwell-systems/agent-lsp. Two-phase safe rename across the entire workspace. Use when renaming any symbol, function, method, variable, type, or identifier — shows all affected sites before executing atomically via LSP. Never renames without confirmation.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/patterns.md`). Compatibility notes: Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)

It sits in Agent Workflows. It works with Model Context Protocol. The repository describes itself as: MCP server that orchestrates language servers into agent-native workflows. 65 tools, 30 CI-verified languages. The licence is MIT.

When your agent uses it

  • Renaming any symbol
  • Identifier — shows all affected sites before executing atomically via LSP

Example prompts

  • “/lsp-rename”

Requirements

  • Compatibility (from SKILL.md): Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
  • Pre-approved tools (allowed-tools): mcp__lsp__go_to_symbol, mcp__lsp__prepare_rename, mcp__lsp__find_references, mcp__lsp__rename_symbol, mcp__lsp__apply_edit, mcp__lsp__get_diagnostics

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. Preview
  2. Execute

What it can do on your machine

Read from SKILL.md and the folder at commit 38ca488. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • mcp__lsp__go_to_symbol
    • mcp__lsp__prepare_rename
    • mcp__lsp__find_references
    • mcp__lsp__rename_symbol
    • mcp__lsp__apply_edit
    • mcp__lsp__get_diagnostics

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)

    From compatibility in the SKILL.md frontmatter.

Context cost

Lsp Rename loads about 1.9k tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 60 tokens; SKILL.md has 603 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from blackwell-systems/agent-lsp at commit 38ca488, republished under its MIT licence (© blackwell-systems). 603 words, ~1,913 tokens.

Download SKILL.mdSave it as .claude/skills/lsp-rename/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
lsp-rename
description
Two-phase safe rename across the entire workspace. Use when renaming any symbol, function, method, variable, type, or identifier — shows all affected sites before executing atomically via LSP. Never renames without confirmation.
allowed-tools
mcp__lsp__go_to_symbol, mcp__lsp__prepare_rename, mcp__lsp__find_references, mcp__lsp__rename_symbol, mcp__lsp__apply_edit, mcp__lsp__get_diagnostics
compatibility
Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp)
argument-hint
[old-name] [new-name]
user-invocable
true
license
MIT
metadata.required-capabilities
referencesProvider renameProvider workspaceSymbolProvider

Requires the agent-lsp MCP server.

lsp-rename: Safe Symbol Rename

Renames a symbol across the workspace in two phases: preview first, then execute only after explicit confirmation. Never renames without showing impact.

Invocation: User provides old_name (the symbol to rename) and new_name (the replacement). Optionally provide workspace_root to scope the search.


Prerequisites

If LSP is not yet initialized, call mcp__lsp__start_lsp with the workspace root first. Auto-inference applies when file paths are provided, but an explicit start is required when switching workspaces.


Phase 1: Preview

Find the symbol, enumerate all references, and produce a dry-run preview. Do not apply any edits in this phase.

Step 1 — Locate the symbol

Call mcp__lsp__go_to_symbol with symbol_path set to old_name:

mcp__lsp__go_to_symbol
  symbol_path: "old_name"        # or "Package.OldName" for qualified paths
  workspace_root: "<root>"       # optional; omit to search entire workspace

This returns the definition location (file, line, column). If not found, report the error and stop.

Step 2 — Validate rename is possible

Call mcp__lsp__prepare_rename at the definition location from Step 1:

mcp__lsp__prepare_rename
  file_path: "<file from Step 1>"
  line: <line from Step 1>
  column: <column from Step 1>

prepare_rename asks the language server whether a rename is valid at this position. If it returns an error (e.g. the symbol is a keyword, a built-in, or in a location the server cannot rename), stop immediately and report:

Cannot rename OldName: <server error message> Common causes: built-in or keyword, imported external package, or position is not on the symbol name. Try locating the declaration site directly.

Only proceed to Step 3 if prepare_rename succeeds.

Step 3 — Enumerate references

Call mcp__lsp__find_references at the definition location from Step 1:

mcp__lsp__find_references
  file_path: "<file from Step 1>"
  position_pattern: "<symbol>@@"   # @@ immediately after the symbol name
  # fallback: use line/column from Step 1 if position_pattern is unavailable

Collect all returned locations. Note the total count and the distinct files.

Step 4 — Dry-run preview

Call mcp__lsp__rename_symbol with dry_run=true. Do not call apply_edit.

mcp__lsp__rename_symbol
  file_path: "<file from Step 1>"
  line: <line from Step 1>
  column: <column from Step 1>
  new_name: "<new_name>"
  dry_run: true

The response includes a workspace_edit with all proposed changes and a preview.note describing the scope.

Step 5 — Report impact and hard stop

Display the preview summary to the user:

Rename preview: OldName -> NewName
  Locations to update: N (from find_references count)
  Files affected:      M (distinct files in workspace_edit)
  Language server:     <gopls | typescript-language-server | rust-analyzer | ...>

Changes:
  path/to/file1.go  lines 12, 45, 78
  path/to/file2.go  line 3
  ...

REQUIRED hard stop — do not proceed without explicit user confirmation:

Proceed with rename? [y/n]

Wait for user input. Do not apply any edit until the user answers "y" or "yes".


Edge Case: 0 References

If find_references returns an empty list (the symbol exists but has no external usages), warn the user before stopping:

Warning: no references found for OldName. The symbol may be unexported, dead code, or the LSP index may be stale. Renaming will update only the declaration site. Proceed anyway? [y/n]

If user answers "n", stop. If "y", continue to Phase 2.


Show full SKILL.md (224 more words)Show less

Phase 2: Execute

Only enter this phase after the user answers "y" or "yes" to the confirmation prompt in Phase 1.

Step 1 — Capture pre-rename diagnostics

Before applying changes, capture the current diagnostic state:

mcp__lsp__get_diagnostics
  file_path: "<one or more files in the workspace_edit>"

Store the result as before_diagnostics.

Step 2 — Execute rename (applies directly)

Call mcp__lsp__rename_symbol without dry_run (or with dry_run=false):

mcp__lsp__rename_symbol
  file_path: "<file from Phase 1 Step 1>"
  line: <line from Phase 1 Step 1>
  column: <column from Phase 1 Step 1>
  new_name: "<new_name>"

Without dry_run, rename_symbol applies the edit to disk itself and returns a summary (Renamed to "NewName" across N location(s) in M file(s): ...). Do not call apply_edit afterward and do not reconstruct the edit by hand: the edit never leaves the server as data you copy back, which is what previously corrupted files (transposed range offsets, truncated newText). apply_edit remains for its text-match mode (file_path + old_text + new_text), not for committing a rename.

Step 3 — Check diagnostics

Call mcp__lsp__get_diagnostics on the affected files and compare against before_diagnostics:

mcp__lsp__get_diagnostics
  file_path: "<affected files>"

Compute introduced vs. resolved errors and display the Diagnostic Summary (see references/patterns.md).


Output Format

After Phase 2 completes, display:

## Rename Summary
- Old name: OldName
- New name: NewName
- Files changed: M
- Locations updated: N
- Post-rename errors: 0

Follow with the Diagnostic Summary if any errors changed (format in references/patterns.md).

Only show Diagnostic Summary sections where N > 0. A net change of 0 means the rename is safe.


Language Support

Tested with gopls, typescript-language-server, and rust-analyzer. Most LSP-compliant servers support textDocument/rename — agent-lsp works with any of the 30+ supported language servers that advertise rename capability. Check your server's capability list via mcp__lsp__get_server_capabilities if you are unsure.

© blackwell-systems, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/lsp-rename of blackwell-systems/agent-lsp.

  • SKILL.md
  • references/patterns.md

Open the folder on GitHubat commit 38ca488

Compare with similar skills

Lsp Rename next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Lsp Rename compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Lsp Rename this skillblackwell-systems/agent-lsp160—~1.9kAutomated safety check: PassMIT
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0
MCP Server BuildershareAI-lab/learn-claude-code78k4 repos~1.2kAutomated safety check: PassMIT
MCP Integration for Pluginsanthropics/claude-plugins-official38k11 repos~3.1kAutomated safety check: PassApache-2.0
MemPalace Memory SearchMemPalace/mempalace60k—~1.4kAutomated safety check: PassMIT
Crush Configurationcharmbracelet/crush29k—~3.7kAutomated safety check: PassCustom licence

Similar skills

  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 4 repos~1.2k tokens
    Agent WorkflowsAuto-check passed
  • MCP Integration for Plugins

    anthropics/claude-plugins-official

    Official

    Explains how to bundle Model Context Protocol servers in a Claude Code plugin, covering config files, stdio, SSE, HTTP and WebSocket server types, and authentication.

    38k GitHub starsUsed in 11 repos~3.1k tokens
    Agent WorkflowsAuto-check passed
  • MemPalace Memory Search

    MemPalace/mempalace

    Mines project files and conversation exports into a local, searchable memory palace and recalls past work by semantic search through the mempalace CLI.

    60k GitHub stars~1.4k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Crush Configuration

    charmbracelet/crush

    Explains how to configure the Crush coding agent with crushrc or crush.json, covering providers, models, LSPs, MCP servers, hooks, permissions and config precedence.

    29k GitHub stars~3.7k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from blackwell-systems/agent-lsp

All 24 skills in this repo
  • Lsp Dead Code

    blackwell-systems/agent-lsp

    Enumerate exported symbols in a file and surface those with zero references across the workspace.

    160 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Lsp Edit Export

    blackwell-systems/agent-lsp

    Safe workflow for editing exported symbols or public APIs. An agent skill from blackwell-systems/agent-lsp.

    160 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Lsp Fix All

    blackwell-systems/agent-lsp

    Apply available quick-fix code actions for all current diagnostics in a file, one at a time with re-collection between each fix.

    160 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Lsp Generate

    blackwell-systems/agent-lsp

    Trigger language server code generation — implement interface stubs, generate test skeletons, add missing methods, generate mock types.

    160 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Lsp Impact

    blackwell-systems/agent-lsp

    Blast-radius analysis for a symbol or file — shows all callers, type supertypes/subtypes, and reference count before you change it.

    160 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • Lsp Simulate

    blackwell-systems/agent-lsp

    Speculative code editing session — simulate changes in memory before touching disk.

    160 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Lsp Rename

What does Lsp Rename do?

Two-phase safe rename across the entire workspace. An agent skill from blackwell-systems/agent-lsp. Lsp Rename is an agent skill from blackwell-systems/agent-lsp. Two-phase safe rename across the entire workspace.

When should I use Lsp Rename?

Lsp Rename fits situations like: renaming any symbol; identifier — shows all affected sites before executing atomically via LSP.

How do I install Lsp Rename in Claude Code?

Run `npx skills add blackwell-systems/agent-lsp --skill lsp-rename -a claude-code`. Or copy the skill folder (skills/lsp-rename in blackwell-systems/agent-lsp) into .claude/skills/lsp-rename in your project. Claude Code loads it when a task matches its description.

How do I install Lsp Rename in Codex?

Run `npx skills add blackwell-systems/agent-lsp --skill lsp-rename -a codex`. Or copy the skill folder (skills/lsp-rename in blackwell-systems/agent-lsp) into .agents/skills/lsp-rename in your project. Codex loads it when a task matches its description.

Can I use Lsp Rename in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add blackwell-systems/agent-lsp --skill lsp-rename -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/lsp-rename, .gemini/skills/lsp-rename, .github/skills/lsp-rename and .opencode/skills/lsp-rename in your project.

What does Lsp Rename need to run?

SKILL.md names no scripts, command-line tools or credentials: Lsp Rename is instructions for the agent only. Its frontmatter pre-approves these tools: mcp__lsp__go_to_symbol, mcp__lsp__prepare_rename, mcp__lsp__find_references, mcp__lsp__rename_symbol, mcp__lsp__apply_edit, mcp__lsp__get_diagnostics. Compatibility (from SKILL.md): Requires the agent-lsp MCP server (github.com/blackwell-systems/agent-lsp).

Does Lsp Rename access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Lsp Rename safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Lsp Rename use?

Lsp Rename is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Lsp Rename use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 499 tokens, read only when the agent opens those files.

What are the alternatives to Lsp Rename?

Skills that share tags, products or a category with Lsp Rename: MCP Server Builder (anthropics/skills, 180k stars), MCP Server Builder (shareAI-lab/learn-claude-code, 78k stars), MCP Integration for Plugins (anthropics/claude-plugins-official, 38k stars) and MemPalace Memory Search (MemPalace/mempalace, 60k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Lsp Rename?

blackwell-systems (a GitHub user) maintains it in blackwell-systems/agent-lsp, which has 160 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 10, 2026.

Source: blackwell-systems/agent-lsp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.