Claude Code + CMUX: The Ultimate AI Coding Terminal

BBetter Stack
컴퓨터/소프트웨어AI/미래기술

Transcript

00:00:00This is Cmux, a terminal built for coding agents that gives them the ability to open
00:00:04and control a browser, create sub-agents in different panes, send you custom notifications
00:00:09and much much more through a CLI and a socket API.
00:00:13But with so many other terminal agents like Warp, Solotam and Dmux, what makes Cmux so
00:00:19special?
00:00:20Hit subscribe and let's get into it.
00:00:24Despite its name, Cmux has nothing to do with tmux, it's a native Mac app built on top
00:00:30of libghosty that uses a webkit browser and bond split for the layout, so tabs, panes and
00:00:36so on.
00:00:37But the real magic lies in the way the agent communicates with the app.
00:00:41Let me show you.
00:00:42So after installing Cmux and setting it up, we should see a regular looking terminal that
00:00:46supports tabs, we can do splits, either vertical or horizontal ones and we can have tabs inside
00:00:53those splits if we want to as well.
00:00:55Now with Cmux installed, we should also have access to the Cmux CLI, which gives us options
00:01:00for a bunch of things like creating a new workspace and new split panes, showing information like
00:01:06logs and progress in the sidebar and even using tmux compatible commands.
00:01:11All this is thanks to the Cmux Unix socket, which we'll talk about later.
00:01:15But let's do something interesting.
00:01:16First, I'm going to clear this, I'm going to open up called code, which we can see has
00:01:20now changed the sidebar title, we'll change the model to haiku, so that I don't waste
00:01:25any tokens.
00:01:26And then I'm going to ask Claude to use the Cmux CLI to open the browser in a new split
00:01:30pane, then navigate to google.com, type hello world into the input and do a Google search.
00:01:36So if I hit enter, then Claude will do his thing.
00:01:38And here it's learning how to use Cmux.
00:01:40It's opened the new tab to Google.
00:01:42And let's see if it does the search.
00:01:44Okay, it's starting to struggle.
00:01:45And it's done search for hello world.
00:01:47And it's done the search perfectly.
00:01:49And I can even ask it to click on links.
00:01:51So let's say I wanted to click on this IMDb link over here, I can say click on the hello
00:01:55world link from IMDb.
00:01:57And Claude will go ahead and do that.
00:01:59What's really cool is that even inside this split pane browser, I have access to the developer
00:02:04tools, which will help to debug pages that I'm working on.
00:02:07All this is done with browser commands that is similar to the API design of the cells agent
00:02:11browser.
00:02:12So the benefit of having this side to side browser terminal view is that the agent can
00:02:16navigate through the browser, do testing and send back its results, which you can see as
00:02:20a developer in real time.
00:02:21Let's try something else.
00:02:22I'm going to close this tab, clear all this information.
00:02:25I'm going to ask Claude to create two instances of itself in split panes, one to understand
00:02:30the project, and another to analyse the code of this project.
00:02:33And when they're done, they should give the information back to the main Claude instance,
00:02:38and then close the panes.
00:02:39So if we hit enter, it creates two split panes, and then it opens Claude in both of them.
00:02:45And now we can see it's giving them instructions, which is wild to see in real time.
00:02:50Now the panes that aren't selected are a bit dark, so we can click on them to make
00:02:53them brighter.
00:02:54I'm going to fast forward this part of the video since it's going to take a while.
00:02:57And now that both splits are done, Claude has closed them automatically and has got information
00:03:02from the first instance here and the second instance down here, which is very cool.
00:03:07And you can imagine so many uses for this for checking permissions on different sub agents
00:03:11to make sure they don't get stuck.
00:03:12But one problem with the demo I just went through is that whenever one of them had a
00:03:16notification or needed my help, there was no easy way for me to know that.
00:03:21But luckily Cmux makes that easy.
00:03:23Let's try something else.
00:03:24In a new Claude code session, I'm going to give it a prompt to create a new instance of
00:03:28Claude in a split pane using Cmux and then in that plane, ask it to study and suggest
00:03:33code improvements for this project.
00:03:36Once it's done, write an appropriate notification using Cmux and run trigger flash to get my
00:03:40attention.
00:03:41Press command activate a blue flashing border on the specified pane.
00:03:45So while that's going, I'm going to create a new workspace and in here I'm going to run
00:03:48open code.
00:03:49Now the beauty of Cmux is that because it's a CLI, it can run with any agent harness.
00:03:54And just as I finish opening open code, we can see we have a notification from Cmux.
00:03:58If I click on the bell, we can see the parallel analysis has started, so it hasn't quite finished.
00:04:03But if I click on the notification, it shows me the right pane that has the information.
00:04:07Now it didn't quite do what I asked it to, so I'm going to tell it to do it again.
00:04:10And while that's going, let's actually go back to open code and do what I was going to
00:04:13do originally, which is to use the Cmux CLI to add the name of the project branch and use
00:04:19an appropriate icon next to the name of that branch.
00:04:21Now I'm going to hit enter and let it do its thing and we can see we have a notification
00:04:25from Cmux, which is the parallel analysis has started and it looks like it started properly
00:04:29this time.
00:04:30We can even see the message inside the sidebar.
00:04:32So now it's done.
00:04:33I'm going to ask it to close the split pane and clear the sidebar text.
00:04:36And we can see here it added the name of the branch with an appropriate icon and earlier
00:04:40I said SF icons, but I actually meant SF symbol, so I'm glad it's figured that out.
00:04:45And we can see here it's closed the split pane and removed the text that was inside the sidebar.
00:04:49Now all of these examples were really simple, but I hope it gives you a glimpse into the
00:04:52powerful things that the Cmux terminal can do when an agent has control over it.
00:04:57And I didn't even go through some awesome features like being able to use a progress
00:05:00bar, adding a custom colour to your workspace, using the agents to rename tabs, showing all
00:05:05the options in the command palette and the fact that Cmux can read and apply your ghosty
00:05:10configuration.
00:05:11Now I used Cmux without any hooks or skills and I disabled the sandbox in Claude code because
00:05:16I would have got this error, but I highly recommend you getting the core and browser
00:05:20skill for Cmux made by the creator and also setting it up with Claude code hooks to automatically
00:05:26send you notifications or even writing a custom script.
00:05:29All this makes Cmux much more useful, but I do wish there was an easier way to set this
00:05:33up from scratch instead of manually having to copy and paste the skills and notifications
00:05:38in place.
00:05:39Just like with skills.sh that automatically detects what agent harness you have and applies
00:05:43the skill to the right directory, I wish Cmux did the same to help with setting the whole
00:05:48thing up.
00:05:49But Cmux is already an awesome tool and I'm sure a setup script can be added later on.
00:05:53I really like the fact that it's a native Mac app which is good for memory and performance
00:05:58and the fact that the CLI communicates with the app via JSON through Unix sockets, which
00:06:02helps make communication fast and simple.
00:06:04Speaking of fast and simple, did you know there's a database out there 138 times faster than
00:06:10SQLite written in Rust called StoolLab, which you can learn all about in this video from
00:06:17Andris.

Key Takeaway

Cmux is a high-performance, native Mac terminal that empowers AI agents with browser control and multi-pane orchestration through a robust CLI and socket-based communication system.

Highlights

Cmux is a native Mac terminal built on libghosty designed specifically for AI coding agents.

The platform features a built-in WebKit browser that agents can control via a CLI and socket API.

It supports complex agent workflows, including the creation of sub-agents in split panes for parallel tasking.

A Unix socket allows for fast, JSON-based communication between the terminal and AI harnesses like Claude Code.

Unique UI features include custom sidebar notifications, progress bars, and visual 'flashes' to grab developer attention.

Cmux is compatible with existing tools like tmux commands and Ghosty configurations.

Timeline

Introduction to Cmux and Core Architecture

The video introduces Cmux as a specialized terminal environment tailored for coding agents rather than just human users. Unlike common terminal emulators, it integrates a WebKit browser and utilizes a socket API for deep agent interaction. The speaker clarifies that despite the similar name, Cmux is a native Mac application built on libghosty rather than a fork of tmux. It uses 'bom-split' for advanced layout management, allowing for a sophisticated arrangement of tabs and panes. This foundation sets the stage for a terminal that acts as a programmable interface for AI.

Exploring the CLI and Browser Integration

This section demonstrates the Cmux CLI, which provides commands to manage workspaces, split panes, and sidebar logs. A practical demo shows the 'Claude Code' agent using the CLI to open a browser pane, navigate to Google, and perform a search. The agent successfully interacts with web elements, such as clicking specific links on IMDb, while the developer retains access to standard dev tools. This side-by-side view allows developers to monitor an agent's web-based testing or debugging in real-time. The API design for these browser commands is noted for its similarity to the Playwright-based browser tools.

Orchestrating Sub-Agents and Parallel Tasks

The speaker explores the powerful 'sub-agent' capability by instructing Claude to spawn two additional instances of itself in split panes. One sub-agent is assigned to understand the overall project structure, while the other analyzes specific code logic. Once their respective tasks are complete, they pass the findings back to the primary instance and automatically close their panes. This workflow highlights the terminal's ability to manage complex, multi-threaded AI operations visually. However, the speaker notes a potential challenge: keeping track of these background processes without a robust notification system.

Advanced Notifications and Workspace Customization

To solve the visibility issue, the video showcases Cmux's notification features, including a 'trigger flash' that creates a blue border around active panes. The agent can send custom text notifications to a sidebar bell icon, allowing the user to jump directly to the relevant pane when the agent needs help. The demo also shows the agent modifying the terminal UI itself, such as adding the current git branch name and SF Symbols to the sidebar. These features emphasize that the terminal is a dynamic canvas that the AI can manipulate to improve the developer experience. The speaker confirms that the CLI works across different agent harnesses, including OpenCode.

Final Thoughts and Technical Recommendations

The concluding section covers additional features like progress bars, custom workspace colors, and Ghosty config compatibility. The speaker recommends using the official Cmux 'core' and 'browser' skills for the best experience, though he notes that the manual setup process could be improved with an automated script. Technically, the use of Unix sockets for JSON communication is praised for making the app fast and lightweight. The video ends by briefly mentioning 'StoolLab,' a Rust-based database, as a high-speed alternative to SQLite. Overall, Cmux is presented as a significant leap forward for developers who want to give their AI agents a physical presence on their desktop.

Community Posts

View all posts