Emacs integrates Claude AI for smarter, automated software development

Emacs now integrates AI assistance via Claude Code IDE, enabling context-aware coding and project-wide refactoring within the editor. It uses MCP for seamless AI interaction and supports multiple projects efficiently.

Categorized in: AI News IT and Development
Published on: Aug 09, 2025
Emacs integrates Claude AI for smarter, automated software development

Emacs Meets Claude: AI-Supported Software Development with a Veteran Editor

The long-standing Emacs text editor now integrates AI-powered assistance through the open-source Claude Code IDE for Emacs. This project brings Anthropics’ Claude Code CLI into Emacs via the Model Context Protocol (MCP), enabling smooth, bidirectional communication between the AI and the editor.

How It Works

Claude Code IDE automatically detects the current project, offering functions and code analysis tailored to the context. It leverages the Language Server Protocol (LSP) to provide language-specific features like code navigation. For syntax tree analysis, it uses Tree-Sitter, a parsing library that Emacs began integrating natively in 2023.

This setup allows the AI assistant to understand the file as a Rust module, for example, and analyze its core functions accurately. The integration feels native and supports a range of programming tasks directly within Emacs.

Model Context Protocol (MCP) as the Control Hub

The MCP enables Claude Code CLI to invoke any Emacs Lisp function, making it possible to perform project-wide refactoring or execute editor commands on demand. When working with multiple projects, each gets a dedicated Claude Code instance inside a special buffer named *claude-code[project-name]*. This setup helps keep AI interactions organized per project.

Claude Code also supports troubleshooting by displaying diffs side-by-side: the original file next to the modified one, which simplifies reviewing changes suggested or applied by the AI.

Controlling Claude Code IDE

  • M-x claude-code-ide: Launches the AI assistant for the current project.
  • M-x claude-code-ide-menu: Opens an interactive menu listing available AI functions.

Customizing AI Assistance with Prompts

You can provide Claude Code CLI with a system prompt using the claude-code-ide-system-prompt command. For instance, an example prompt encourages the model to favor functional programming and immutability: “Focus on functional programming patterns and avoid mutations.”

Claude Code for Emacs requires Emacs 28.1 or higher and a terminal package like vterm or eat. The CLI tool must be in your PATH for the integration to work.

The project is available under the GPL 3.0 license and can be found on GitHub. While it currently has a modest following, it’s a useful tool for developers who prefer Emacs workflows enhanced by AI.

An Interesting Side Note

Emacs includes the classic ELIZA chatbot from 1966 as part of its standard setup. Connecting Claude Code with ELIZA could be an intriguing experiment for enthusiasts interested in blending AI assistants with historical software tools.