DEV Community

Quo
Quo

Posted on • Originally published at kitepon.dev

AI-to-AI Conversations: The Interactive Terminal Powered by aiterm-mcp

aiterm-mcp was created to eliminate the hassle of tinkering with a home server. Each time you send a command from Claude Code, the connection to the server drops, requiring re-authentication every time you reconnect. If you could hold a single persistent connection, that would no longer be necessary. That's what this tool is for.

The main use of this tool right now is when I have Claude run other AIs—such as Codex, Grok, or Composer. Claude reads what the other AI is doing and gives it the next instruction on the spot. Repeating this, they work together on a single task.

Claude launches Codex within a single terminal it holds, reads the screen, and sends the next command. This back-and-forth of reading and sending forms the conversation. Grok and Composer can also be launched in the same way

Claude launches Codex within a single terminal it holds, reads the screen, and sends the next command. This back-and-forth of reading and sending forms the conversation. Grok and Composer can also be launched in the same way.

How It Works

Suppose you ask Codex to rewrite old tests into a new format. Claude starts Codex inside the terminal it holds and gives it the initial instructions. Codex begins executing. Claude reads the screen to see how it's progressing. If Codex breaks something else along the way, Claude sends "fix that too" on the spot. It can interject while the other is still running.

codex_agent(session_name: "codex1", cwd: "/repo",
            prompt: "古いテストを新しい形式に書き直して")
   → Codex starts running in terminal "codex1"
pty_read("codex1")                  → Reads what it's currently doing
pty_send("codex1", "壊した読み込みも直して")
   → Sends the next instruction while it's still running
Enter fullscreen mode Exit fullscreen mode

What it does is simple: read the other AI's screen and type in the next move. This is repeated several times. The screen output is trimmed to only what's needed, to prevent Claude from getting overwhelmed by long outputs. It's the same as when a person asks someone to do a task and gives feedback from the side: "Do it this way here." Claude does exactly that.

All in the Same Single Terminal

The core of aiterm-mcp is just one terminal that Claude keeps persistently. Whether connecting to a server or launching another AI in this conversation, everything happens within that single terminal.

For Claude, logging into a server, entering a container (an application enclosed in a box), or launching another AI all amount to "sending text to the same single terminal." No matter what you connect to, the handling is the same: open the terminal, send text, read the response. A handful of tools cover everything.

Don't Pretend to Have Launched

Before launching another AI, there are checks to perform: whether the specified working directory actually exists, whether the launch parameters are correct, and whether the required tools are installed on that machine. If any one of these is missing, the process stops and clearly reports the issue.

Skipping this step leads to trouble. For instance, if the working directory is specified incorrectly, the terminal silently proceeds, moving forward as if everything "launched successfully." Even though nothing is actually running, it acts as if it were. So we verify before launching, and don't proceed unless all conditions are met.

This verification foundation was also independently reviewed by external AIs to ensure correctness. I didn't just decide my own tool was correct on my own.

No Need for a Person to Sit Attached

Because this conversation is driven from Claude's side, it can proceed without a person sitting in front of the terminal. Whether in a scheduled automation setup or during pre-delivery automated checks (CI), you can launch and run other AIs in the same way.

You can distribute a single task among multiple AIs while you keep an eye on the overall picture. This workflow can be achieved without a person manually switching between terminals one by one.

Positioning of aiterm-mcp

Recently, there has been an increasing trend of a lead AI having another AI assist it. The lead AI lets one AI handle mechanical rewrites and another run batch edits, while it reviews the results. The assisting AIs all run within a terminal. aiterm-mcp is a tool that gives Claude direct control over that terminal, turning assistance into a conversation through the terminal.

This is what I do with this tool every day: I have Claude converse with Codex, Grok, and Composer, and we all work together.

Top comments (0)