Emacs meets Claude: AI-supported software development with the editor veteran
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.
Insight into the context
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.
MCP as a control unit
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.
Prompt for customized assistance
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.”
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.
Dieser Link ist leider nicht mehr gültig.
Links zu verschenkten Artikeln werden ungültig,
wenn diese älter als 7 Tage sind oder zu oft aufgerufen wurden.
Sie benötigen ein heise+ Paket, um diesen Artikel zu lesen. Jetzt eine Woche unverbindlich testen – ohne Verpflichtung!