Skip to content

Conversation

@TristanFloch
Copy link

@TristanFloch TristanFloch commented Jan 20, 2026

Summary

Add monet-persist-sessions option to keep sessions alive after Claude Code
disconnects, allowing reconnection without restarting the server.

Problem

Closes #33.

When Claude Code disconnects (e.g., exiting the CLI), the monet session is
automatically cleaned up. Users who frequently restart Claude Code sessions while
keeping Emacs running must manually restart the monet server each time before
reconnecting.

Solution

Add a new customizable variable monet-persist-sessions (default nil) that, when
enabled, keeps the websocket server running after Claude disconnects. The session
remains available for a new Claude Code session to reconnect via /ide.

Usage

(setq monet-persist-sessions t)

Test plan

I first set up my Doom Emacs configuration to use this option: link to the exact line.

While multiple monet servers are running on different directories:

  • Start a monet server for a new project directory using monet-start-server
  • Connect to that server using /ide in Claude Code (using a standalone terminal)
  • Terminate the Claude Code session using Ctrl+C Ctrl+C
  • Check the monet session is still running using monet-list-sessions:
    doom                 Port: 11617 Connected: No  Initialized: Yes  Directory: /Users/myuser/myproject/
    
  • Restart Claude Code in the same directory using ENABLE_IDE_INTEGRATION=t claude and check it connected to the right session
  • Double check the monet sessions list:
    doom                 Port: 11617 Connected: Yes Initialized: Yes  Directory: /Users/myuser/myproject/
    

@TristanFloch TristanFloch marked this pull request as ready for review January 20, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to persist server sessions after Claude Code disconnects

1 participant