claude-code.el  by stevemolitor

Emacs integration for Claude Code CLI

created 5 months ago
398 stars

Top 72.5% on SourcePulse

GitHubView on GitHub
Project Summary

This Emacs package provides seamless integration with the Claude Code CLI, enabling users to interact with Claude AI for coding assistance directly within their Emacs environment. It allows for sending code snippets, regions, or entire files, fixing errors, and managing multiple concurrent Claude sessions without leaving the editor.

How It Works

The package leverages Emacs' terminal emulation capabilities, supporting both eat and vterm backends for interacting with the Claude Code CLI. It provides a transient menu for easy command access and allows for context-aware commands, including file paths and line numbers. The integration supports resuming previous conversations and offers quick response keystrokes for common interactions.

Quick Start & Requirements

  • Installation: Install via package-install (requires transient, eat or vterm). Installation examples for package.el and straight.el are provided.
  • Prerequisites: Emacs 30.0 or higher, Claude Code CLI installed and configured.
  • Dependencies: transient (required), eat (optional, for eat backend), vterm (optional, for vterm backend).
  • Configuration: Set a prefix key (e.g., C-c c) and optionally configure the terminal backend.

Highlighted Details

  • Seamless integration within Emacs, keeping users in their coding buffer.
  • Ability to fix errors directly at the cursor point using Claude.
  • Support for multiple, named Claude instances for different projects or tasks.
  • Quick response commands (e.g., /, /1, /2, /3) for immediate interaction.
  • Smart context inclusion (file paths, line numbers) for more relevant AI responses.
  • Customizable keybindings, notifications, and display preferences.
  • Hook integration for custom event handling from the Claude Code CLI.

Maintenance & Community

The project is actively maintained by stevemolitor. Contributions are welcome via Pull Requests.

Licensing & Compatibility

Licensed under the Apache License 2.0. This license is permissive and generally compatible with commercial and closed-source use.

Limitations & Caveats

Users must have the Claude Code CLI installed and configured separately. Font configuration might be necessary for proper rendering of special Unicode characters in the Claude output buffer. Some Linux/Windows notification examples are untested.

Health Check
Last commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
11
Issues (30d)
25
Star History
112 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic) and Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic).

claude-code-sdk-python by anthropics

3.4%
829
SDK for Claude Code interaction
created 2 months ago
updated 3 days ago
Feedback? Help us improve.