Claude Code IDE integration for Emacs
TL;DR Highlight
Emacs and Claude Code connected over MCP, giving Claude LSP and tree-sitter access
Who Should Read
Emacs developer who runs Claude Code CLI in a plain terminal and wants it to share editor state
Core Mechanics
- More than a terminal wrapper
- It bridges Claude Code CLI and Emacs in both directions via MCP (Model Context Protocol, a standard for AI tool calls).
- It detects projects and manages sessions automatically.
- Emacs features exposed as MCP tools
- Claude can reach LSP (eglot, lsp-mode, etc.) through xref, plus tree-sitter, Imenu and project info.
- Any Emacs command or function can be added as an MCP tool.
- Claude knows your file and selection
- The prompt shows a label like "⧉ In file.el" or "⧉ 3 lines selected".
- File content is not sent, only the fact that it is open or the selected lines.
- Setting claude-code-ide-share-opened-file to nil reports only selected regions.
- Review and edit changes in ediff
- It is on by default (claude-code-ide-use-ide-diff), with Buffer A as current code and Buffer B as Claude's suggestion.
- Edit Buffer B, press y, and your edits are sent back to Claude to apply to the original file.
- Multiple instances per project
- One instance can refactor while another answers questions.
- Each instance runs its own MCP server, and cursor/selection context is shared across all instances in the project.
- Pick vterm, eat or ghostel
- vterm is the default, and ghostel is recommended for the fewest flicker and scrolling problems.
- For the inline renderer, set "tui": "default" in ~/.claude/settings.json.
Community Reactions
- Many similar packages exist
- Commenters said at least 5 Emacs/Claude Code packages exist, naming claude-code.el, eca-emacs, claude-code-emacs and efrit.
- One user said plain claude-code.el, a terminal wrapper with a Transient menu, already felt smoother than iTerm.
- Typing in the prompt was awkward in evil-mode
- One user tried claude-code.el in Spacemacs evil-mode, found the cursor misbehaving, and went back to the terminal.
- Their workaround was writing instructions in an Emacs file and telling Claude Code to read it.
- Concern about sensitive files
- One commenter worried that files like ssh keys opened in the editor could reach an LLM.
- They solved it with a bubblewrap alias that runs a fully separate nvim instance.
- Experience with Claude writing elisp
- One user said Claude is pretty good at elisp but sometimes loses track of parentheses and needs fixing.
- Protocol reference for IDE integrations
- A commenter pointed to the PROTOCOL doc in coder/claudecode.nvim for anyone building their own IDE integration.
How to Apply
- Verify the setup with check-status
- Install Emacs 28.1+, Claude Code CLI, and one of vterm, eat or ghostel.
- Add the use-package config with a claude-code-ide-menu binding and run M-x claude-code-ide-check-status.
- Enable claude-code-ide-emacs-tools-setup
- Add it to config so xref, tree-sitter and project tools are exposed to Claude.
- Run a code-navigation prompt to confirm LSP-based jumping works.
- Narrow what is shared if you have sensitive files
- Set claude-code-ide-share-opened-file to nil if you do not want open file names reported.
- Only active selected regions are then passed to Claude.
- Switch the terminal backend and renderer
- If flicker bothers you, set claude-code-ide-terminal-backend to 'ghostel.
- To search the whole conversation with isearch, set "tui": "default" in ~/.claude/settings.json.
Try It
; Paste into Emacs init.el (or evaluate in *scratch*) — requires Emacs 30+ and vterm
(use-package claude-code-ide
:vc (:url "https://github.com/manzaltu/claude-code-ide.el" :rev :newest)
:bind ("C-c C-'" . claude-code-ide-menu)
:config
(claude-code-ide-emacs-tools-setup))
;; To share only selected regions, add this line
;; (setq claude-code-ide-share-opened-file nil)
;; To use the ghostel backend
;; (setq claude-code-ide-terminal-backend 'ghostel)Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques
Related Resources
- https://github.com/manzaltu/claude-code-ide.el
- https://github.com/stevemolitor/claude-code.el
- https://github.com/editor-code-assistant/eca-emacs
- https://github.com/editor-code-assistant/eca
- https://github.com/steveyegge/efrit
- https://github.com/yuya373/claude-code-emacs
- https://github.com/coder/claudecode.nvim
- https://github.com/sst/opencode