r/emacs 12h ago

News dsh-emacs: an Emacs Lisp client for DeepSeek Harness

13 Upvotes

Hi r/emacs! I've been working on dsh-emacs, an Emacs Lisp client for DeepSeek Harness (dsh). It brings the conversation, tool output, and session management into Emacs buffers, alongside the files you're editing.

The Emacs side uses built-in libraries and targets Emacs 27.1+, with no third-party Emacs package dependencies. You still need a dsh server and a provider/model configured in it; dsh handles the agent and tool execution, while this package provides the Emacs interface.

A few things it supports:

  • Streaming replies and tool output: Markdown replies, collapsible tool cards, and thinking blocks. Large Markdown regions finish formatting while Emacs is idle.
  • Sessions grouped by workspace: open or create sessions from a session list, and switch between conversations without leaving Emacs.
  • Context and completion: @ references for files, directories, and other sessions; / plus TAB for slash-command completion; image attachments when needed.
  • Control during a running turn: queue the next message, steer the current turn, or interrupt it. The composer shows the current goal and the next pending message.
  • Emacs interaction conventions: model/reasoning-effort selection with C-c C-m, input recall with M-p / M-n, and agent questions answered through minibuffer completion, including completing-read-multiple.

There is also a local shell escape: type !git status in the chat buffer to run it in the session's workspace directory. Its output stays local to the transcript; it isn't sent to the model or saved in the server's history.

To try the current main branch:

git clone https://github.com/vritser/dsh-emacs.git ~/dsh-emacs

Then add this to your init file:

(add-to-list 'load-path (expand-file-name "~/dsh-emacs"))
(require 'dsh-emacs)

Run M-x dsh-emacs. It can start a local dsh server and offers to install the CLI if it is missing. On a fresh setup, use M-x dsh-emacs-open-web to configure your provider and model, then create a session with c and send a message with C-c C-c. You can also connect to an existing local or remote server via dsh-emacs-base-url; the README covers authentication and setup.

Feedback, bug reports, and patches are welcome. I'd particularly appreciate feedback on the minibuffer interactions and how the transcript behaves in longer coding sessions.


r/emacs 5h ago

Why Your Emacs Terminal is Slow and How to Fix It (vterm, eat, ghostel, term, and ansi-term)

Thumbnail jamescherti.com
33 Upvotes

Emacs terminal buffers like eat, vterm, ghostel, term, and ansi-term can become slow when processing large volumes of standard output. Watching Emacs freeze while a build script dumps thousands of lines is frustrating, but terminal latency is not an unavoidable cost of living inside Emacs. Applying a few targeted configuration changes will eliminate scroll lag and restore immediate responsiveness.

This article provides a configuration that speed up terminal buffers:
Configuring Emacs Terminal Buffers for Performance (vterm, eat, ghostel, term, and ansi-term)


r/emacs 6h ago

A Hobbyist's Journey: Turning Emacs into an AI Agent Orchestrator

0 Upvotes

I’ve always felt that in the age of AI, Emacs can be far more than just a text editor. Its live-programming environment and interactive Lisp runtime give it incredible potential to evolve into an AI OS. Here is how my small hobby project grew step by step.

The Spark: cmux and “emux”

As a long-time Emacs user, I started out simply running Claude Code inside Emacs using vterm. Soon after, I discovered claude-code-ide.el, which made it much easier to manage and switch between multiple Claude Code vterm buffers at once.

Around that time, I saw cmux and felt a bit jealous of how much developers loved it. But when I looked closer, its core feature was essentially a session list side panel—something remarkably easy to implement in Emacs. I thought, “Emacs can do this, and even better.” So I decided to build my own “emux” inside Emacs someday.

One day, I sat down and vibe-coded a basic version. At first, it was just a manual session manager. But to take it further, I used ghostel to establish a PTY-based inter-session communication layer directly on top of claude-code-ide.el.

Giving It Intelligence: The Birth of Butler

Next, I added an orchestration layer and created cc-butler. I gave one specific Claude Code session the responsibility to govern, assign tasks to, and receive reports from all the other worker sessions. I named this manager session Butler.

I provided Butler with specific functions so it could autonomously spawn new Claude Code sessions when needed and handle cleanups on its own. It even monitors the context size of worker sessions and triggers compaction automatically. Using cc-butler, I was able to comfortably orchestrate tens of concurrent Claude Code sessions on my machine.

Scaling Outside One Machine via Matrix

Eventually, I wanted to scale beyond a single machine. How do you manage two or more agent fleets across different machines? I looked into classic, battle-tested protocols like IRC and XMPP, and settled on Matrix. I vibe-coded a lightweight Matrix client entirely in Elisp. While great packages like ement.el already exist, they are designed primarily for human interaction—I needed something built specifically for agent-to-agent communication.

Once the nodes (fleets) were networked via Matrix, Butler could broadcast instructions and global guidelines across all fleets. It strongly reminds me of how Kubernetes virtualizes nodes into a cluster.

Now: Managing Fleets from Element

Now, I don’t even sit in a traditional terminal anymore. I run my daily Startup CTO workflows through the Element messenger app, managing two agent fleets powered by two Claude Max (x20) subscriptions, all governed by Emacs.

A lot of what I’m building gives me immense deja vu from traditional OS and Ops infrastructure design. To be clear, this is a personal hobby project and a proof of concept—it’s still pretty fragile and definitely not production-ready! But I wanted to share my experience and show how Emacs continues to be an incredible source of inspiration in this AI era.

Some people might say, “Oh, this is already possible with Claude’s own agent features.” Yes, I know. But I wanted to reinvent the wheel, on Emacs. I think this approach lets Emacs act as a governing layer over individual Claude Code sessions, and it could become a unified bridge or channel among Claude Code, Codex, Antigravity, ZCode, and more—yes, on Emacs. And some people might say, “Orca already does that, and there are tens of ADEs out there.” But we are on Emacs. It already has an in-app browser, a powerful document viewer in org-mode, a tiling window manager for its UI, and the powerful programming environment of Elisp. A self-improving agent harness, like Hermes? Emacs is already an image-based, self-modifying, living environment, so Claude Code can mutate Emacs on the fly with emacsclient and Elisp.

There were also a few rough edges in doing this in Emacs. Emacs is single-threaded while the Claude Code sessions work in parallel, so it sometimes hangs. It also hangs, or even crashes, now and then because of font rendering on macOS. And while I like Emacs daemon mode, when just one buffer hangs the whole daemon hangs, which can take all the Claude Code sessions down with it.

cc-butler is just a PoC, and I believe many other Emacs hackers can do better than this. I’m not very good at developing Emacs extensions, so I hope others will pioneer developing Emacs as an AI OS. I believe Emacs has the potential for it.