Overview
mux uses agents to control the model’s:- System prompt (what the assistant “is”)
- Tool access policy (which tools it can call)
- UI modes (Plan/Exec/Compact)
- Subagents (the presets used by the
tasktool)
- 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: PressCmd+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):| Location | Scope | Priority |
|---|---|---|
.mux/agents/*.md | Project | Highest |
~/.mux/agents/*.md | Global | Medium |
| Built-in | System | Lowest |
Agent IDs
The agent id is derived from the filename:review.md→agentId = "review"
-/_).
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 abase, 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 andui.disabled: true:
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 usingbase to inherit from it:
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. Thetools 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 (enablesask_user_question,propose_plan)base: exec— Exec-mode behaviors (standard coding workflow)base: <custom-agent-id>— Inherit from any custom agent
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:subagent.runnable: true can be used this way.
Examples
Security Audit Agent
Documentation Agent
Built-in Agents
Exec
Implement changes in the repositoryView exec.md
View exec.md
Plan
Create a plan before codingView plan.md
View plan.md
Compact (internal)
History compaction (internal)View compact.md
View compact.md
Explore (internal)
Read-only repository explorationView explore.md
View explore.md
Related Docs
- Scoped instructions in
AGENTS.md: see Instruction Files - Built-in skills (
agent_skill_read): see Agent Skills