Add option to persist session after claude code disconnects - #34
Add option to persist session after claude code disconnects#34TristanFloch wants to merge 1 commit into
Conversation
|
Thanks for the PR — the core idea is reasonable and the implementation is clean (lockfile stays in place, client cleared to nil, hooks preserved so reconnection can work). Two things before I can merge:
Once those are squared away I'm happy to merge. Thanks! |
02239ea to
d48ec6c
Compare
|
Hey @stevemolitor, thank you for taking a look.
I'll let you merge if everything else looks good. Thanks! |
Summary
Add
monet-persist-sessionsoption to keep sessions alive after Claude Codedisconnects, 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(defaultnil) that, whenenabled, keeps the websocket server running after Claude disconnects. The session
remains available for a new Claude Code session to reconnect via
/ide.Usage
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:
monet-start-server/idein Claude Code (using a standalone terminal)Ctrl+C Ctrl+Cmonet-list-sessions:ENABLE_IDE_INTEGRATION=t claudeand check it connected to the right session