Claude Code EmacsSAFE
This package provides seamless integration with Claude Code, allowing you to run AI-powered coding sessions directly in your Emacs environment.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://github.com/yuya373/claude-code-emacs/actions/workflows/test.yml)
Run Claude Code AI coding sessions directly in Emacs with powerful MCP integration.
Quick Start
;; Add to your init.el (add-to-list 'load-path "/path/to/claude-code") (require 'claude-code) (global-set-key (kbd "C-c c") 'claude-code-transient)
# Install MCP server globally
npm install -g claude-code-mcp-server
# Configure Claude Code to use MCP
claude mcp add-json emacs '{
"type": "stdio",
"command": "claude-code-mcp"
}'Now run M-x claude-code-run to start a session!
Key Features
🚀 Core Features
- Project-isolated sessions - Each project gets its own Claude Code buffer
- Smart file completion - Type
@in prompts to reference project files - Transient menus - Press
C-c cfor the main menu with all commands - Custom commands - Define reusable commands in
.claude/commands/*.md - Project prompts -
.claude-code.prompt.mdfile per project for persistent context
🔌 MCP Integration
Claude Code can directly interact with your Emacs environment:
- Buffer operations - List/read open buffers, get selected text
- LSP integration - Get diagnostics, find definitions/references, describe symbols
- Diff tools - Compare files, view git changes, apply patches
- Real-time events - Buffer changes and diagnostics sent to Claude Code automatically
- Automatic reconnection - If Emacs restarts, running sessions (including background agents) re-register themselves and reconnect automatically
⌨️ Key Bindings
Global
In Claude Code Session (vterm mode)
1f9992b437d1OBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add claude-code-mcp-server -- npx -y [email protected]
{
"mcpServers": {
"claude-code-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
]
}
}
}Exposed tools (14)
14 read · 0 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
describeSymbol | read | |
file1.ts | read | First file |
file2.ts | read | Second file |
findReferences | read | |
getCurrentSelection | read | |
getDefinition | read | |
getDiagnostics | read | |
getOpenBuffers | read | |
main.ts | read | Buffer: /project/src/main.ts |
openCurrentChanges | read | |
openDiffContent | read | |
openDiffFile | read | |
openRevisionDiff | read | |
sendNotification | read |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (6)
import { bufferResourceHandler } from '../../src/resources/buffer-resource.js';import { EmacsBridge } from '../../src/emacs-bridge.js';import { handleGetOpenBuffers } from '../../src/tools/buffer-tools';import { EmacsBridge } from '../../src/emacs-bridge';import { handleGetDefinition, GetDefinitionArgs } from '../../src/tools/definition-tools.js';@modelcontextprotocol/sdk, express, ws, zod, @types/express, @types/jest, @types/node, @types/ws
Gates applied: no_behavioural_pass.
1f9992b437d1full audit observations/trust-audit/mcp-server/yuya373__claude-code-emacs.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 1f9992b437d1 | SAFE | B | 89 | first audit |
Questions
What is the Claude Code Emacs MCP server?
This package provides seamless integration with Claude Code, allowing you to run AI-powered coding sessions directly in your Emacs environment.
What tools does Claude Code Emacs expose?
14 in total: 14 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is Claude Code Emacs safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Claude Code Emacs need?
No credential environment variables were found in its source, so it appears to need none.
How does Claude Code Emacs run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as claude-code-mcp-server at 0.10.1.
How current is this page?
The grade is for one exact copy of the source (1f9992b437d1), read on 2026-10-07. The repository is watched and re-audited when it changes.