Embedded CLI agents
Run coding-agent CLIs inside Mel with a tool belt and full key fidelity.
Mel runs Claude Code, Codex and other coding-agent CLIs inside its terminal: type claude or codex in any tab and it opens as a full interactive session with Mel's tool belt around it. You don't have to choose between Mel's agent and the coding-agent CLI you already use: Mel gives each one full TUI rendering and faithful keyboard handling.
How detection works
Mel recognizes coding-agent CLIs by their command name — claude, codex, opencode, copilot, amp, droid, gemini — along with ssh and common TUIs like vim. When one starts, the pane switches into an interactive grid session: a real terminal emulator (alternate screen, cursor addressing, 256-color) renders the agent's interface live, and your keyboard routes straight into it. Slow-starting agents show a "Starting…" overlay until their first output, so a cold start never looks like a dead pane.
This works no matter how you launched Mel: the shell environment is hydrated from your login shell at startup, so CLIs installed via your shell rc resolve even when Mel starts from a desktop launcher.
Embedded in a conversation
Typing a CLI agent's command (or ssh, or vim) inside a Mel agent conversation runs it embedded: the live TUI takes over the conversation's content area while the conversation chrome and transcript stay. On exit, the session collapses into a shell record in the transcript — final screen preserved — and the agent input returns. In a plain terminal pane, the same session collapses into a finished block.
The tool belt
While a CLI agent runs, a belt of helpers appears:
- Rich Input (ctrl+G) — a multi-line box for writing a prompt with a free cursor. Enter sends it to the agent as its prompt (pasted with bracketed paste, so newlines survive, then submitted); shift+enter adds a line; esc keeps your draft for later.
- Voice — dictate instead of typing; see Voice input.
- File explorer — opens the project tree; dragging a file onto the session pastes its absolute path into the agent's input.
- View changes (Ctrl+Shift+=, ⌘⇧= on a Mac) — opens Mel's code review panel over the diff the CLI agent has produced so far.
Claude Code in Mel
- Install Claude Code the way Anthropic's instructions say, and sign in to it once. Mel doesn't install it for you.
- Open a Mel tab in your project's folder and type
claude. If your shell finds it, Mel does too, even when Mel was started from the dock or a launcher. - Claude Code takes the pane over. Use it as you would in any terminal; the belt sits around it.
What Mel adds:
- Rich Input (Ctrl+G) to write a long prompt with a free cursor, sent as one paste.
- View changes (Ctrl+Shift+=, ⌘⇧= on a Mac) to review what Claude Code changed in Mel's code review panel.
- A notification when it waits for you, from any tab.
- Shared instructions. Mel's own agent reads the same
CLAUDE.mdfiles (and.claude/skills/in a project), so both agents follow one set of rules. See Rules & MEL.md. - Workers. In
/orchestrate-cli, a lead agent can start Claude Code as a worker withclaude --permission-mode acceptEdits -p '<task>'.
Claude Code runs on your own Anthropic account or plan. It doesn't use Mel credits.
Codex in Mel
- Install the Codex CLI the way OpenAI's instructions say, and sign in to it once.
- Type
codexin a Mel tab. It opens as a full interactive session with the same belt. - Ctrl+C reaches Codex as a real control byte, so a double Ctrl+C quits it the way Codex expects.
Rich Input, voice, the file explorer, View changes and the waiting notification work as they do for Claude Code. In /orchestrate-cli, a lead can start Codex as a worker with codex exec --full-auto '<task>'. Codex runs on your own OpenAI account and doesn't use Mel credits.
Other CLIs
opencode, copilot (and gh copilot), amp, droid and gemini are recognised the same way. For another program, add a pattern under Commands that enable the toolbar (below) to give it the belt and Rich Input.
Keyboard shortcuts
| Action | Windows and Linux | Mac |
|---|---|---|
| Open Rich Input | Ctrl+G | ⌃G |
| Send Rich Input | Enter (or Ctrl+Enter with the setting on) | ↵ (or ⌘↵ with the setting on) |
| New line in Rich Input | Shift+Enter | ⇧↵ |
| Close Rich Input, keep the draft | Esc | Esc |
| View the agent's changes | Ctrl+Shift+= | ⌘⇧= |
| Interrupt the agent | Ctrl+C | ⌃C |
Settings ▸ Third party CLI agents
- Show coding agent toolbar (on) — the belt above. Off, it is hidden; ctrl+G still opens Rich Input.
- Auto show/hide Rich Input based on agent status (on) — Rich Input opens when the agent goes quiet waiting for you, and closes when it starts working again. It never closes over a draft you are writing.
- Auto open Rich Input when a coding agent session starts (off).
- Auto dismiss Rich Input after prompt submission (off) — off, the box stays open for your next prompt.
- Submit Rich Input with Ctrl+Enter (off; Cmd+Enter on macOS) — on, ctrl+enter sends and enter adds a line.
- Toolbar layout — choose and arrange the chips on the toolbar's left and right sides (changed files, git branch, pull request, time and more).
- Commands that enable the toolbar — regex patterns for other commands that should open with the belt and Rich Input. A pattern names the program (
aider, not./aiderorsudo aider) and matches whole words, as Settings ▸ Melt's lists do.
Key fidelity
The details that make TUIs feel native are handled:
- ctrl+C and ctrl+X are forwarded as real control bytes — so double-ctrl+C quits codex the way it should.
- shift+tab, arrow-key modes, and bracketed paste all behave correctly; pastes arrive as one paste, not replayed keystrokes.
- The session answers standard terminal queries, so cursor-position-sensitive TUIs render correctly.
- Mel's own single-modifier shortcuts are suspended while a TUI is active, so keys like Ctrl+P and Ctrl+D reach the agent instead of Mel; Ctrl+Shift combinations like the review panel stay available.
When the agent waits for you
When Claude Code, Codex or another CLI agent in a Mel tab stops and waits for you — it printed something, then nothing for a few seconds, and you haven't looked at that pane since — Mel tells you once, even from another tab, through the notification bell and a desktop notification. Mel reads no screen text to decide this. These waits also show under Needs you on the Runs screen (Ctrl+Shift+M).
They can be your workers, too
In an orchestration run, the lead agent can spawn Claude Code or Codex as non-interactive workers in background panes — see Orchestration.
FAQ
How do I use Claude Code in a terminal with an AI agent built in? Type claude in a Mel tab. It runs as a full session, and Mel's own agent is one Ctrl+Enter away in any other tab.
Does running Claude Code or Codex in Mel cost Mel credits? No. They run on your own accounts with Anthropic and OpenAI. Mel credits are only for Mel's own agent.
Mel says command not found for claude. Mel finds the programs your login shell finds. Check that claude runs in your usual terminal, then restart Mel so it reloads your shell's environment.
Can I run Claude Code and Codex side by side? Yes. Open each in its own tab or split, ideally in its own worktree so they don't edit the same files.