The Solemn Silence of Written Words
Plato on Socrates
- tags
Claude Code provides a CLI interface to Claude that maintains full project context and can execute commands directly. The claude-code.el package integrates this into Emacs, giving you access to Claude's capabilities without leaving your editor.
Claude Code operates on entire directory trees rather than individual files. When you start a session from your project root, Claude has read access to all files in that directory and can understand relationships between components, build configurations, and test files.
The integration uses a terminal emulator (eat or vterm) to run Claude Code's CLI. This means Claude can execute shell commands, run tests, install dependencies, and interact with git - not just generate code suggestions.
Sessions persist across Emacs restarts. You can resume conversations, and Claude maintains awareness of previous changes made to your codebase during that session.
The claude-code-fix-error-at-point
function sends Claude both the
error message and surrounding code context, including file paths and
line numbers. Claude can then make targeted fixes with full
understanding of the error's location.
|
|
C-c c c
(claude-code
): Start from current buffer's directoryC-c c d
(claude-code-start-in-directory
): Select specific directory scopeC-c c e
(claude-code-fix-error-at-point
): Send error at cursor with surrounding contextC-c c r
(claude-code-send-region
): Send selected region or current bufferC-c c o
(claude-code-send-buffer-file
): Send entire current fileC-c c s
(claude-code-send-command
): Send arbitrary text commandC-c c C
(claude-code-continue
): Resume last sessionC-c c R
(claude-code-resume
): Select from all previous sessionsC-c c k
(claude-code-kill
): Terminate current sessionThe choice of starting directory determines Claude's file access scope. Starting from a project root gives access to build files, documentation, and full source tree. Starting from a subdirectory limits scope to that subtree, which can be useful for large monorepos or when working with sensitive files.
Claude can modify multiple files in a single response when it has appropriate context. For example, renaming a function will update its definition, all call sites, tests, and documentation if they're within the accessible directory tree.
Commands execute in a persistent shell session. This means environment variables, directory changes, and installed packages persist throughout the session. Claude can run test suites, install dependencies, and create git commits as part of its responses.
claude-code-fix-error-at-point
sends the error message, cursor
position, and surrounding code context. This often provides sufficient
information for Claude to identify the root cause and implement fixes
across related files.
Conversations persist across Emacs sessions. Claude maintains context about previous modifications and can refer to earlier parts of the conversation when making new changes.
Key Binding | Function | Description |
---|---|---|
C-c c c | claude-code | Start session from current directory |
C-c c d | claude-code-start-in-directory | Start session with directory selection |
C-c c e | claude-code-fix-error-at-point | Send error context to Claude |
C-c c r | claude-code-send-region | Send region or buffer content |
C-c c o | claude-code-send-buffer-file | Send current file |
C-c c s | claude-code-send-command | Send text command |
C-c c C | claude-code-continue | Resume last session |
C-c c R | claude-code-resume | Select previous session |
C-c c k | claude-code-kill | Terminate current session |
C-c c m | claude-code-transient | Open command menu |
C-c c b | claude-code-switch-to-buffer | Switch to Claude buffer |
C-c c z | claude-code-toggle-read-only-mode | Toggle text selection mode |
The package requires a terminal emulator backend (eat or vterm) and assumes Claude Code CLI is available in your PATH. The optional Monet integration provides IDE features like go-to-definition within Claude sessions.
Directory selection affects performance and response relevance. Large codebases benefit from scoping to specific subtrees. The persistent shell session means Claude can maintain state across multiple commands within a session.
Previously
Next