Skip to content

Feature Request: Add /restart command to reload MCP servers without losing session #17675

Description

@bluzername

Problem

When adding or modifying MCP server configurations in ~/.claude.json, users must manually:

  1. Quit Claude Code (/exit or Ctrl+C)
  2. Run claude --resume
  3. Select the most recent session from the list

This is a friction-heavy workflow, especially when iterating on MCP server setup or debugging connection issues.

Proposed Solution

Add a built-in /restart command that:

  1. Saves the current session ID
  2. Re-execs the Claude Code process with --resume <session-id>
  3. Automatically reconnects to updated MCP servers

Example Usage

> /restart
Restarting Claude Code...
[Claude Code restarts and resumes the same session with refreshed MCP connections]

Alternatives Considered

  • Shell aliases/wrappers: Work but are external workarounds that don't preserve session context seamlessly
  • Custom skills: Cannot restart the parent process from within

Additional Context

This would significantly improve the developer experience when:

  • Setting up new MCP servers
  • Debugging MCP connection issues
  • Switching between MCP configurations
  • Any scenario where MCP servers need to be reloaded

Environment

  • macOS (though this would benefit all platforms)
  • Claude Code CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions