# claude-code-ide.el
**Repository Path**: mirrors_wallyqs/claude-code-ide.el
## Basic Information
- **Project Name**: claude-code-ide.el
- **Description**: Claude Code IDE integration for Emacs
- **Primary Language**: Unknown
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-08-19
- **Last Updated**: 2026-04-04
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#+TITLE: Claude Code IDE for Emacs
#+AUTHOR: Yoav Orot
#+EMAIL: orot.yoav@gmail.com
#+DESCRIPTION: Claude Code integration for Emacs
#+KEYWORDS: emacs, claude, ai, code-assistant
#+OPTIONS: toc:t num:nil
[[https://github.com/manzaltu/claude-code-ide.el/actions/workflows/test.yml][file:https://github.com/manzaltu/claude-code-ide.el/workflows/CI/badge.svg]]
[[https://www.gnu.org/software/emacs/][file:https://img.shields.io/badge/GNU%20Emacs-28--30-blueviolet.svg]]
[[https://www.gnu.org/licenses/gpl-3.0][file:https://img.shields.io/badge/License-GPL%20v3-blue.svg]]
* Overview
Claude Code IDE for Emacs provides native integration with Claude Code CLI through the Model Context Protocol (MCP). Unlike simple terminal wrappers, this package creates a bidirectional bridge between Claude and Emacs, enabling Claude to understand and leverage Emacs' powerful features—from LSP and project management to custom Elisp functions. This transforms Claude into a true Emacs-aware AI assistant that works within your existing workflow and can interact with your entire Emacs ecosystem.
** Features
- Automatic project detection and session management
- Terminal integration with full color support using =vterm= or =eat=
- MCP protocol implementation for IDE integration
- Tool support for file operations, editor state, and workspace info
- Extensible MCP tools server for accessing Emacs commands (xrefs, tree-sitter, project info, e.g.)
- Diagnostic integration with Flycheck and Flymake
- Advanced diff view with ediff integration
- Tab-bar support for proper context switching
- Selection and buffer tracking for better context awareness
** Emacs Tool Integration
This package enables Claude Code to leverage the full power of Emacs through MCP tools integration. Claude can directly access and utilize Emacs capabilities including:
- *Language Server Protocol (LSP)* integration through xref commands for intelligent code navigation (eglot, lsp-mode and others)
- *Tree-sitter* for syntax tree analysis and understanding code structure at the AST level
- *Imenu* for structured symbol listing and navigation within files
- *Project* integration for project-aware operations
- *Any Emacs command or function* can be exposed as an MCP tool, allowing Claude to:
- Perform project-wide searches and refactoring
- Access specialized modes and their features
- Execute custom Elisp functions tailored to your workflow
This deep integration means Claude Code understands your project context and can leverage Emacs' extensive ecosystem to provide more intelligent and context-aware assistance.
** Screenshots
*** Active File Awareness
#+CAPTION: Claude Code automatically knows which file you're currently viewing in Emacs
#+html:
#+html:
Claude Code automatically knows which file you're currently viewing in Emacs
*** Code Selection Context #+CAPTION: Claude Code can access and work with selected text in your buffers #+html:
#+html: Claude Code can access and work with selected text in your buffers
*** Advanced Diff View with Diagnostics #+CAPTION: Integrated ediff view for code changes, with Claude Code able to directly access diagnostic data (errors, warnings, etc.) from opened files #+html:
#+html: Integrated ediff view for code changes, with Claude Code able to directly access diagnostic data (errors, warnings, etc.) from opened files
*** Automatic Text Mentions #+CAPTION: Automatically mention and reference selected text in Claude conversations #+html:
#+html: Automatically mention and reference selected text in Claude conversations
*** Session Restoration #+CAPTION: Resume previous Claude Code conversations with the --resume flag #+html:
#+html: Resume previous Claude Code conversations with the --resume flag
* Installation ** Prerequisites - Emacs 28.1 or higher - Claude Code CLI installed and available in PATH - =vterm= or =eat= package (for terminal support) ** Installing Claude Code CLI Follow the installation instructions at [[https://docs.anthropic.com/en/docs/claude-code][Claude Code Documentation]]. ** Installing the Emacs Package Currently, this package is in early development. To install using =emacs-version= >= 30 and =use-package= with the =vc= binding: #+begin_src elisp (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) ; Set your favorite keybinding :config (claude-code-ide-emacs-tools-setup)) ; Optionally enable Emacs MCP tools #+end_src To install using =use-package= and [[https://github.com/raxod502/straight.el][straight.el]]: #+begin_src emacs-lisp (use-package claude-code-ide :straight (:type git :host github :repo "manzaltu/claude-code-ide.el") :bind ("C-c C-'" . claude-code-ide-menu) ; Set your favorite keybinding :config (claude-code-ide-emacs-tools-setup)) ; Optionally enable Emacs MCP tools #+end_src * Usage ** Basic Commands The easiest way to interact with Claude Code IDE is through the transient menu interface, which provides visual access to all available commands. Simply run =M-x claude-code-ide-menu= to open the interactive menu. | Command | Description | |-----------------------------------------+---------------------------------------------------| | =M-x claude-code-ide-menu= | Open transient menu with all Claude Code commands | | =M-x claude-code-ide-emacs-tools-setup= | Set up built-in MCP tools (e.g. xref, project) | | =M-x claude-code-ide= | Start Claude Code for the current project | | =M-x claude-code-ide-send-prompt= | Send prompt to Claude from minibuffer input | | =M-x claude-code-ide-continue= | Continue most recent conversation in directory | | =M-x claude-code-ide-resume= | Resume Claude Code with previous conversation | | =M-x claude-code-ide-stop= | Stop Claude Code for the current project | | =M-x claude-code-ide-switch-to-buffer= | Switch to project's Claude buffer | | =M-x claude-code-ide-list-sessions= | List all active Claude Code sessions and switch | | =M-x claude-code-ide-check-status= | Check if Claude Code CLI is installed and working | | =M-x claude-code-ide-insert-at-mentioned= | Send selected text to Claude prompt | | =M-x claude-code-ide-send-escape= | Send escape key to Claude terminal | | =M-x claude-code-ide-insert-newline= | Insert newline in Claude prompt (sends \ + Enter) | | =M-x claude-code-ide-toggle= | Toggle visibility of Claude Code window | | =M-x claude-code-ide-show-debug= | Show the debug buffer with WebSocket messages | | =M-x claude-code-ide-clear-debug= | Clear the debug buffer | ** Multi-Project Support Claude Code IDE automatically detects your project using Emacs' built-in =project.el=. Each project gets its own Claude Code instance with a unique buffer name like =*claude-code[project-name]*=. You can run multiple Claude Code instances simultaneously for different projects. Use =claude-code-ide-list-sessions= to see all active sessions and switch between them. ** Window Management - Running =claude-code-ide= when a session is already active will toggle the window visibility - The window can be closed with standard Emacs window commands (=C-x 0=) without stopping Claude ** Configuration *** Configuration Variables | Variable | Description | Default | |-----------------------------------------------+---------------------------------------------+--------------------------------------| | ~claude-code-ide-cli-path~ | Path to Claude Code CLI | ~"claude"~ | | ~claude-code-ide-buffer-name-function~ | Function for buffer naming | ~claude-code-ide--default-buffer-name~ | | ~claude-code-ide-cli-debug~ | Enable CLI debug mode (-d flag) | ~nil~ | | ~claude-code-ide-cli-extra-flags~ | Additional CLI flags (e.g. "--model") | ~""~ | | ~claude-code-ide-debug~ | Enable debug logging | ~nil~ | | ~claude-code-ide-terminal-backend~ | Terminal backend (vterm or eat) | ~'vterm~ | | ~claude-code-ide-vterm-anti-flicker~ | Enable vterm flicker reduction | ~t~ | | ~claude-code-ide-vterm-render-delay~ | vterm render batching delay (seconds) | ~0.005~ | | ~claude-code-ide-terminal-initialization-delay~ | Initialization delay for terminals | ~0.1~ | | ~claude-code-ide-log-with-context~ | Include session context in log messages | ~t~ | | ~claude-code-ide-debug-buffer~ | Buffer name for debug output | ~"*claude-code-ide-debug*"~ | | ~claude-code-ide-use-side-window~ | Use side window vs regular buffer | ~t~ | | ~claude-code-ide-window-side~ | Side for Claude window | ~'right~ | | ~claude-code-ide-window-width~ | Width for side windows (left/right) | ~90~ | | ~claude-code-ide-window-height~ | Height for side windows (top/bottom) | ~20~ | | ~claude-code-ide-focus-on-open~ | Focus Claude window when opened | ~t~ | | ~claude-code-ide-focus-claude-after-ediff~ | Focus Claude window after opening ediff | ~t~ | | ~claude-code-ide-show-claude-window-in-ediff~ | Show Claude window during ediff | ~t~ | | ~claude-code-ide-use-ide-diff~ | Use IDE diff viewer instead of terminal | ~t~ | | ~claude-code-ide-switch-tab-on-ediff~ | Switch to Claude's tab when opening ediff | ~t~ | | ~claude-code-ide-system-prompt~ | Custom system prompt to append | ~nil~ | | ~claude-code-ide-enable-mcp-server~ | Enable MCP tools server | ~nil~ | | ~claude-code-ide-mcp-server-port~ | Port for MCP tools server | ~nil~ (auto-select) | | ~claude-code-ide-mcp-server-tools~ | Alist of exposed Emacs functions | ~nil~ | | ~claude-code-ide-diagnostics-backend~ | Diagnostics backend (auto/flycheck/flymake) | ~'auto~ | | ~claude-code-ide-prevent-reflow-glitch~ | Prevent terminal reflow glitch (bug #1422) | ~t~ | *** Side Window Configuration Claude Code buffers open in a side window by default. You can customize the placement: #+begin_src emacs-lisp ;; Open Claude on the left side (setq claude-code-ide-window-side 'left) ;; Open Claude at the bottom with custom height (setq claude-code-ide-window-side 'bottom claude-code-ide-window-height 30) ;; Open Claude on the right with custom width (setq claude-code-ide-window-side 'right claude-code-ide-window-width 100) ;; Don't automatically focus the Claude window (setq claude-code-ide-focus-on-open nil) ;; Keep focus on ediff control window when opening diffs (setq claude-code-ide-focus-claude-after-ediff nil) ;; Hide Claude window during ediff for more screen space (setq claude-code-ide-show-claude-window-in-ediff nil) ;; Disable IDE diff viewer to show diffs in terminal instead (setq claude-code-ide-use-ide-diff nil) #+end_src Or, if you'd prefer to use a regular window: #+begin_src emacs-lisp ;; Use regular window instead of side window (setq claude-code-ide-use-side-window nil) #+end_src *** Terminal Backend Configuration Claude Code IDE supports both =vterm= and =eat= as terminal backends. By default, it uses =vterm=, but you can switch to =eat= if preferred: #+begin_src emacs-lisp ;; Use eat instead of vterm (setq claude-code-ide-terminal-backend 'eat) ;; Or switch back to vterm (default) (setq claude-code-ide-terminal-backend 'vterm) #+end_src The =eat= backend is a pure Elisp terminal emulator that may work better in some environments where =vterm= compilation is problematic. Both backends provide full terminal functionality including color support and special key handling. **** vterm Rendering Optimization Claude Code IDE includes intelligent flicker reduction for vterm terminals to provide smoother visual output: #+begin_src emacs-lisp ;; Enable/disable vterm anti-flicker optimization (enabled by default) (setq claude-code-ide-vterm-anti-flicker t) ;; Adjust the render delay for batching updates (default is 0.005 seconds) (setq claude-code-ide-vterm-render-delay 0.01) ; Increase for smoother but less responsive #+end_src This optimization detects rapid terminal redraw sequences (like when Claude expands text areas) and batches them for smoother rendering. The 5ms default delay provides optimal visual quality with imperceptible latency. **** Terminal Initialization Delay Claude Code IDE includes a brief initialization delay when launching terminals to ensure proper layout rendering: #+begin_src emacs-lisp ;; Adjust the terminal initialization delay (default is 0.1 seconds) (setq claude-code-ide-terminal-initialization-delay 0.15) ;; Or disable it entirely (may cause visual glitches) (setq claude-code-ide-terminal-initialization-delay 0) #+end_src This delay prevents display artifacts such as misaligned prompts and incorrect cursor positioning that can occur when terminal emulation is initializing. The default 100ms delay is imperceptible but ensures reliable terminal startup. **** Terminal Keybindings Claude Code IDE adds custom keybindings to the terminal for easier interaction: | Keybinding | Command | Description | |------------+--------------------------------+--------------------------------------| | =M-RET= | =claude-code-ide-insert-newline= | Insert a newline in the prompt | | =C-