A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/stevemolitor/monet below:

stevemolitor/monet: Monet is an Emacs package that implements the Claude Code IDE protocol, enabling Claude to interact with your Emacs environment through a WebSocket connection.

Self Portrait with a Beret, 1886 by Claude Monet. Source: Wikimedia Commons

Monet is an Emacs package that implements the (undocumented) Claude Code IDE protocol, enabling Claude to interact with your Emacs environment through a WebSocket connection.

You can use Monet with Claude Code running in your favorite terminal emulator (Ghostty, Kitty, iTerm2, WezTerm), or with packages like claude-code.el that run Claude Code directly inside Emacs.

Using use-package with :vc (Emacs 30+)
(use-package monet
  :vc (:url "https://github.com/stevemolitor/monet" :rev :newest))
(straight-use-package
 '(monet :type git :host github :repo "stevemolitor/monet"))
  1. Clone this repository:

    git clone https://github.com/stevemolitor/monet.git
  2. Add to your Emacs configuration:

    (add-to-list 'load-path "/path/to/monet")
    (require 'monet)
  1. Enable Monet mode:

  2. Start a Monet server:

    C-c m s    ; Start server in current project/directory
    
  3. In Claude Code, start a new chat and use the /ide slash command to connect to your Emacs session.

To have Claude automatically connect to your Monet session set ENABLE_IDE_IDE=t before starting Claude.

If you have multiple Monet sessions for the same project you can do this to have Claude automatically connect to the desired instance:

ENABLE_IDE_INTEGRATION=t && CLAUDE_CODE_SSE_PORT=123456 && claude

Monet prints a message with the port number when you call monet-start-server (C-c m s). You can see the list of all running servers with their ports and directories via monet-list-sessions (C-c m l).

You can use Monet with claude-code.el by adding this hook:

(add-hook 'claude-code-process-environment-functions #'monet-start-server-function)

When claude-code.el starts a new session it will start and associate a Monet session with the current claude-code.el instance.

Sessions are automatically cleaned up (killed) when you exit the associated Claude session. When you exit Emacs all sessions are cleaned up. You can stop a session manually via monet-stop-server (C-c q).

Here's Monet in action - Claude running in Ghostty terminal communicating with Emacs:

When monet-mode is enabled, the following key bindings are available (default prefix: C-c m):

When Claude proposes code changes, Monet displays them in a diff view:

Important: With the ediff tool, any manual edits you make to the proposed changes are captured and sent to Claude when you accept. This allows you to refine Claude's suggestions before applying them.

Monet automatically creates session keys based on your context:

With a prefix argument (C-u C-c m s), you can manually select a directory.

You can start multiple sessions per project, or have multiple

;; Change the prefix key (default: "C-c m")
(setq monet-prefix-key "C-c C-m")

;; Or disable prefix key and use M-x commands only
(setq monet-prefix-key nil)

;; Change log buffer name
(setq monet-log-buffer-name "*My Monet Log*")

;; Customize diff keybindings
(setq monet-ediff-accept-key "C-c C-a")      ; Default: "C-c C-c"
(setq monet-ediff-quit-key "C-g")            ; Default: "q"
(setq monet-simple-diff-accept-key "C-c C-c")      ; Default: "y"
(setq monet-simple-diff-quit-key "C-g")      ; Default: "q"

;; Change ediff window split direction
(setq monet-ediff-split-window-direction 'vertical)  ; Default: 'horizontal

Most MCP tools that Claude uses to interact with Emacs are now customizable. You can replace the default implementations with your own functions:

;; Custom file opener that confirms before opening
(defun my-open-file-tool (uri)
  (when (y-or-n-p (format "Open %s? " uri))
    (monet-default-open-file-tool uri)))
(setq monet-open-file-tool 'my-open-file-tool)

;; Custom diagnostics that only reports errors
(defun my-diagnostics-tool (&optional uri)
  (let ((result (monet-flymake-flycheck-diagnostics-tool uri)))
    ;; Filter to only errors... 
    result))
(setq monet-diagnostics-tool 'my-diagnostics-tool)

Available customizable tools:

Important: to customize the diff tool to use ediff, you must set both the diff tool and the diff cleanup tool:

(setq monet-diff-tool #'monet-ediff-tool)
(setq monet-diff-cleanup-tool #'monet-ediff-cleanup-tool)

You can customize how Monet displays diffs by providing your own diff tool functions:

;; Use a custom diff tool
(setq monet-diff-tool 'my-diff-tool)
(setq monet-diff-cleanup-tool 'my-diff-cleanup)

The diff tool function should take: (old-file-path new-file-path new-file-contents on-accept on-quit) and return a context object. The cleanup function takes that context object for cleanup.

Monet creates a WebSocket server that Claude Code connects to via MCP. This allows Claude to:

Each session is isolated to a specific directory/project, ensuring Claude only accesses files within the intended scope.

Simple Monet Diff Tool with Ghostty

Monet Ediff Tool inside claude-code.el


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4