Who it is forAn engineer cleaning up naming in a multi-file project who has watched agents miss references during renames.
The problemAgents without refactoring tools fall back to search and replace, which is error-prone and expensive across files.
The outcomeSymbols renamed everywhere they are referenced, with symbolic edits such as replace symbol body and safe delete.
What you need first
- uv, the only required prerequisite
- An MCP client such as Claude Code, Codex, OpenCode, Gemini-CLI, Cursor, VS Code or a JetBrains assistant
- An LLM to drive the tools, since Serena itself does no reasoning
- For some languages, extra language server dependencies listed on the Language Support page
- Optional: the paid Serena JetBrains Plugin (free trial) for move, inline and debugging
Steps
- Set up Serena as an MCP server in your client as in the Quick Start
- Ask the agent to use Serena's rename tool for the symbol; with language servers it renames symbols only
- Use replace symbol body, insert after symbol and safe delete for targeted edits
- For file and directory moves, inline or propagate deletions, use the JetBrains plugin backend
- Run your tests afterwards with your harness's shell tool
Prompt for your agent
Using oraios/serena's refactoring tools, rename <old symbol> to <new symbol> across this project, then safe delete <unused symbol>. List every file that changed and run the tests.
Caveat. Move, inline and propagate deletions are JetBrains plugin only, and that plugin is paid after the free trial.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for oraios/serena and "Rename a symbol across a codebase in one call"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer