Emacs meets Claude: AI-supported software development with the editor veteran

The open source project Claude Code IDE for Emacs integrates the AI assistant into the text editor via MCP.

listen Print view
Distance,Education,Online,Learning,Concept.,Robot,Teacher,,Abstract,Classroom,Interior

(Image: Besjunior/Shutterstock.com)

3 min. read
Contents

The Emacs text editor can now also support AI-based software development: Claude Code IDE for Emacs integrates Anthropics Claude Code CLI into the editor, which looks back on a history of over forty years.

The open-source project uses the Model Context Protocol (MCP) to integrate the AI model into Emacs. It offers bidirectional communication, which not only enables AI help to be called but also allows Claude Code CLI to actively trigger Emacs functions.

Claude Code IDE for Emacs automatically recognizes the current project to offer appropriate functions and code analysis. Via the Language Server Protocol (LSP), it offers programming language-specific functions for navigating in the code.

Thanks to the integration, the tool recognizes the file in the editor as a Rust module and analyses the central functions of the code.

(Image: Claude Code IDE for Emacs)

To analyze the syntax tree within the code, it relies on the Tree-Sitter parsing library, which Emacs has been integrating directly since 2023.

The Model Context Protocol can be used to provide any Emacs functions for Claude Code CLI. This allows the AI assistant to execute any elisp functions (Emacs Lisp) or perform project-wide refactoring across multiple files.

The wizard uses the project.el file to recognize the active project. When working on multiple projects, each project receives its own instance of Claude Code, which is located in a special buffer (*claude-code[project-name]*).

Claude Code helps with troubleshooting and shows the original file next to the modified one in a diff view.

(Image: Claude Code IDE for Emacs)

Claude Code IDE provides a set of Emacs commands to control the integration: Mx claude-code-ide starts the AI wizard for the active project. The command M-x claude-code-ide-menu calls up an interactive menu with all available functions.

The command claude-code-ide-system-prompt provides Claude Code CLI with a prompt. The GitHub repository lists an example prompt with which the model prefers functional programming patterns and relies on immutability: “Focus on functional programming patterns and avoid mutations.”

Videos by heise

Claude Code for Emacs is available under the GPL 3.0 license. It requires Emacs version 28.1 or higher and one of the terminal packages vterm or eat. Claude Code CLI must also be available in the PATH.

Further details and the source code can be found in the project's GitHub repository. It currently only has 800 stars and six contributors, but who needs cursors and the like when Claude Code CLI helps you program with good old Emacs? An interesting bonus project would be the connection of Claude Code to ELIZA: The primitive chatbot developed in 1966 is part of Emacs' basic equipment.

(rme)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.