Claude Code Layer
Table of ContentsClose
1. Description
This layer adds support for Claude Code IDE, an Emacs package that provides seamless integration with Claude Code CLI for AI-assisted coding.
1.1. Features:
- AI-powered code editing and generation using Claude
- Terminal-based interaction with Claude Code CLI
- Multi-project session management
- Deep Emacs integration with transient menus
- Resume and continue conversations
- Send code regions and symbols for analysis
- Project-aware context handling
2. Install
To use this configuration layer, add it to your ~/.spacemacs. You will need to
add claude-code to the existing dotspacemacs-configuration-layers list in this file.
You will also need to install the Claude Code CLI tool:
# Install Claude Code CLI npm install -g @anthropic-ai/claude-code # Or using other package managers brew install anthropic/tap/claude-code
For more installation information, please check the Claude Code Documentation.
3. Configuration
Before using this layer, ensure the claude-code command works in your terminal.
User settings are defined in ~/.claude/settings.json and apply to all projects.
Project settings are saved in your project directory:
.claude/settings.jsonfor settings that are checked into source control and shared with your team.claude/settings.local.jsonfor settings that are not checked in, useful for personal preferences and experimentation.
Please refer the Claude Code settings for detailed information.
The package supports various customization options. You can configure the options in your Spacemacs configuration:
(setq-default dotspacemacs-configuration-layers '((claude-code :variables claude-code-ide-window-side 'right claude-code-ide-window-width 100)))
For the full options, please refer the Claude Code IDE configuration section on its project page.
4. Usage
This layer provides comprehensive integration with Claude Code through Emacs. The main
entry point is the transient menu accessible via SPC a c y.
Basic workflow:
- Open your project in Spacemacs
- Use
SPC a c yto open the Claude Code transient menu - Start a Claude Code session with
SPC a c s - Send prompts with
SPC a c por use helper functions - Continue conversations with
SPC a c cor resume withSPC a c r
The layer includes helpful functions for common tasks:
- Ask questions about symbols at point
5. Key bindings
5.2. Session Management
| Key binding | Description |
|---|---|
SPC $ d s |
Start Claude Code for current project |
SPC $ d c |
Continue Claude Code for current project |
SPC $ d r |
Resume a previous conversation |
SPC $ d l |
List and switch between sessions |
SPC $ d b |
Switch to Claude Code buffer |
SPC $ d t |
Toggle Claude Code window |
SPC $ d q |
Stop Claude Code for current project |
5.4. Interaction
| Key binding | Description |
|---|---|
SPC $ d i |
Insert selected text to Claude prompt |
SPC $ d p |
Send prompt to Claude from minibuffer |
SPC $ d e |
Send escape to Claude buffer |
SPC $ d n |
Insert newline in Claude buffer |
5.5. Debug Commands
| Key binding | Description |
|---|---|
SPC $ d s |
Check claude code status |
SPC $ d v |
Show version |
SPC $ d d |
Toggle the debug mode |
SPC $ d l |
Show debug info |
SPC $ d c |
Clear debug info |
SPC $ d v |
Show version |
SPC $ d m |
Show MCP sessions |
SPC $ d p |
Show active ports |
5.6. Assistant Functions
| Key binding | Description |
|---|---|
SPC $ d * |
Ask question about symbol at point |