Skip to main content

Overview

Mux uses agents to control the model’s:
  • System prompt (what the assistant “is”)
  • Tool access policy (which tools it can call)
This unifies two older concepts:
  • UI modes (Plan/Exec/Compact)
  • Subagents (the presets used by the task tool)
An Agent Definition is a Markdown file:
  • The YAML frontmatter defines metadata + policy.
  • The Markdown body becomes the agent’s system prompt (layered with Mux’s base prelude).

Quick Start

Switch agents: Press Cmd+Shift+M (Mac) or Ctrl+Shift+M (Windows/Linux), or use the agent selector in the chat input. Create a custom agent: Add a markdown file with YAML frontmatter to .mux/agents/ in your project:

Discovery + Precedence

Mux discovers agent definitions from (non-recursive): Higher-priority definitions override lower-priority ones with the same agent id.

Agent IDs

The agent id is derived from the filename:
  • review.mdagentId = "review"
Agent ids are lowercase and should be simple (letters/numbers with -/_).

File Format

Frontmatter Schema

Markdown Body (Instructions)

The markdown body after the frontmatter becomes the agent’s system prompt, layered with Mux’s base prelude. Inheritance behavior: By default, when an agent has a base, the child’s body is appended to the base agent’s body. Set prompt.append: false to replace the base body entirely—useful when you want to completely override the base agent’s instructions while keeping its tool policies or AI defaults.

Disabling Built-in Agents

To hide a built-in agent, create a file with the same name and ui.disabled: true:
This completely removes the agent from discovery. To override (replace) a built-in instead, omit disabled and provide your own configuration.

Extending Built-in Agents

You can extend a built-in agent by creating a file with the same name and using base to inherit from it:
This works because when resolving base: exec, Mux skips the current scope (project) and looks for exec in lower-priority scopes (global, then built-in). Your project-local exec.md extends the built-in exec, not itself. Common pattern: Add repo-specific guidance (CI commands, test patterns) without duplicating the built-in instructions.

Tool Policy Semantics

Tools are controlled via an explicit whitelist. The tools array lists patterns (exact names or regex) that the agent can use. If tools is omitted or empty, no tools are available. Inheritance: Use base to inherit behavior from another agent:
  • base: plan — Plan-mode behaviors and built-in planning guidance (enables ask_user_question, propose_plan)
  • base: exec — Exec-mode behaviors (standard coding workflow)
  • base: <custom-agent-id> — Inherit from any custom agent
Inheritance is multi-level: if my-agent has base: plan, agents inheriting from my-agent also get plan-like behavior. Hard denies in subagents: Even if an agent definition allows them, Mux blocks these tools in child workspaces:
  • task, task_await, task_list, task_terminate (no recursive spawning)
  • propose_plan, ask_user_question (UI-only tools)

Using Agents

Main Agent

Use the agent selector in the chat input to switch agents. Keyboard: Cmd+Shift+M (mac) / Ctrl+Shift+M (win/linux) cycles between agents.

Subagents (task tool)

Spawn a subagent workspace with:
Only agents with subagent.runnable: true can be used this way.

Run-context AI defaults

The same agent identity can use different default model and thinking settings depending on how it runs:
  • UI defaults (agentAiDefaults) apply when you select the agent directly in the UI, such as choosing Exec in the chat input.
  • Subagent defaults (subagentAiDefaults) apply when that agent is spawned through the task tool.
Subagent defaults inherit from UI defaults per field. If the subagent model is unset, Mux uses the matching UI agent model; if subagent thinking is unset, Mux uses the matching UI agent thinking level. You can override one subagent field and keep the other inherited. Mux resolves the subagent model and thinking level when the task call creates the child workspace. Those resolved values are stored with that child workspace, so changing defaults later affects future subagent tasks only.

Examples

Security Audit Agent

Documentation Agent

Built-in Agents

Exec

Implement changes in the repository

Plan

Create a plan before coding

Compact (internal)

History compaction (internal)

Desktop (internal)

Visual desktop automation agent for GUI-heavy, screenshot-intensive workflows

Explore (internal)

Read-only exploration of repository, environment, web, etc. Useful for investigation before making changes.

Name Workspace (internal)

Generate workspace name and title from user message