Wiring Claude Code Into Emacs

News

Wiring Claude Code Into Emacs

Today we will explore integrating Claude Code into an Emacs workflow and tackle the challenges of using it within terminal emulators like eat and vterm.

I’ll give some thoughts from my recent experience using it, especially in Emacs, and we’ll kick off a new project so I can show you how it works.

We’ll also compare the experience of using Emacs terminal emulators versus what it’s like in a “real” one like foot, then check out some Emacsp packages that should smooth out the experience.

Let’s try out Claude Code in Emacs and write an XMPP client library for Guile!

The Final Config

We used the following two packages to improve the Claude Code experience in Emacs:

(use-package monet
  :vc (:url "https://github.com/stevemolitor/monet" :rev :newest))

;; NOTE: This will take a while due to massive GIFs in the repo!
(use-package claude-code
  :ensure t
  :vc (:url "https://github.com/stevemolitor/claude-code.el" :rev :newest)

  :config
  ;; optional IDE integration with Monet
  (add-hook 'claude-code-process-environment-functions #'monet-start-server-function)
  (monet-mode 1)

  (claude-code-mode)
  :bind-keymap ("C-c c" . claude-code-command-map)

  ;; Optionally define a repeat map so that "M" will cycle thru Claude auto-accept/plan/confirm modes after invoking claude-code-cycle-mode / C-c M.
  :bind
  (:repeat-map my-claude-code-map ("M" . claude-code-cycle-mode)))
Subscribe to the System Crafters Newsletter!
Stay up to date with the latest System Crafters news and updates! Read the Newsletter page for more information.
Name (optional)
Email Address