muxd March 2026: 9 New Features in One Day

This is the biggest single update to muxd since launch. Nine features that make the agent smarter, more transparent, and cheaper to run.

1. Inline Diffs

Every file edit now shows a styled red and green diff right in the chat stream. You see exactly what the agent changed without switching to your editor.

--- a/store.go
+++ b/store.go
@@ -31,7 +31,9 @@
-  db, err := sql.Open("sqlite", dsn+"?_pragma=journal_mode(wal)")
+  db, err := sql.Open("sqlite", dsn+"?_pragma=journal_mode(wal)&_pragma=busy_timeout(5000)")

File overwrites show diffs too. New file creation shows a brief notice. Toggle with /config set show_diffs false.

2. Read Any Document

The agent can now read PDFs, Word docs, Excel spreadsheets, PowerPoint slides, HTML pages, CSV, JSON, and XML files. Works both as chat attachments and when the agent encounters documents during file_read.

No plugins, no external binaries. Pure Go extraction that works on Windows, Mac, and Linux.

3. Self Extending Tools

The agent can create its own tools at runtime. Ask for a tool and it builds one.

  • tool_create for quick command templates with parameter substitution
  • tool_register for complex scripts the agent writes with file_write
  • Mark tools as persistent to load them automatically on every future session
  • Stored in ~/.config/muxd/tools/

4. Second Opinion

The agent can ask a different model for a second opinion when it is uncertain. Configure a consult model with /config set model.consult <model> and the agent gets a consult tool. You can also trigger it manually with /consult.

The response appears in a separate styled view with a crystal ball emoji, independent from the main conversation. The primary agent never sees the response. You read it and decide.

5. Smart Compression

Context compaction is now tiered instead of a single brutal cut at 100k tokens:

  • 60k tokens: compress old tool results to one line summaries (no LLM call)
  • 75k tokens: collapse old conversation turns to bullet points (no LLM call)
  • 90k tokens: full LLM summarization with an improved prompt focused on decisions, file changes, and current plan

The summary prompt now asks for what the agent actually needs to continue working, not generic meeting notes. Summarization defaults to the cheapest model per provider (Haiku, GPT 4o Mini, etc.).

6. Live Activity Status

No more staring at a blank spinner. The status line now shows what the agent is doing at all times:

⠹ Reading main.go · 4 tool calls · 2 files changed · 18s
⠹ Searching for "func main" · 6 tool calls · 25s
⠹ Wrote auth.go → Writing response... · 8 tool calls · 3 files changed · 42s

Fun thinking messages rotate while the model is between tool calls: "Pondering...", "Brewing ideas...", "Connecting the dots..."

7. Session Resilience

Fixed a class of bugs where muxd would lose sessions after long idle periods (sleep, hibernate). SQLite now has a 5 second busy timeout, connection pools are properly limited, and the TUI automatically recovers lost sessions by creating a new one and retrying your message.

8. Heartbeat Improvements

Hub heartbeat failures are now tracked with a rolling window instead of a consecutive counter. A single success no longer resets everything, so sustained instability triggers re-registration reliably. Nodes purged from the hub are detected instantly via HTTP 404 and re-register immediately.

9. Hub Dispatch Test Coverage

Comprehensive tests added for the entire hub dispatch flow: node resolution (by ID, by name, case insensitive, offline, not found), session creation, SSE stream reading, 50KB truncation, and full end to end dispatch integration.

Get Started

Update to the latest:

go install github.com/batalabs/muxd@latest

All features work out of the box. The only one requiring configuration is the second opinion consult (/config set model.consult <model>).