Overview
An agent in Mux owns two things for a given turn:- System prompt — what the assistant is and how it should behave
- Tool policy — which tools it can call (and which it must call)
- Selected in the UI as the workspace’s current mode (Exec, Plan, or your own)
- Spawned via the
tasktool as a subagent in a child workspace
Quick Start
Drop a Markdown file in.mux/agents/ (project) or ~/.mux/agents/ (global):
.md) is the agent id, used by base: and task({ agentId }). IDs must match ^[a-z0-9]+(?:[a-z0-9_-]*[a-z0-9])?$ (1–64 chars, lowercase).
Switch agents in the UI: Cmd/Ctrl+Shift+A opens the agent picker; Cmd/Ctrl+. cycles through visible agents.
Discovery and Precedence
Mux scans three roots, non-recursive (only direct.md children):
| Location | Scope | Priority |
|---|---|---|
.mux/agents/*.md | Project | Highest |
~/.mux/agents/*.md | Global | Medium |
| Built-in | System | Lowest |
File Format
Frontmatter
Markdown body
The body becomes the agent’s instruction prompt, layered with Mux’s base prelude, the workspace environment context, andAGENTS.md.
- With
prompt.append: true(default), a child’s body is appended to its base’s body, separated by a blank line. - With
prompt.append: false, the child’s body replaces the base’s body. Tool policy, AI defaults, and other frontmatter still inherit normally.
Inheritance and Tool Policy
Base resolution
base: <id> walks the same discovery roots, with two non-obvious rules:
- Same name as the current file — Mux skips the current file’s scope, so a project
exec.mdwithbase: execresolves to the global or built-inexec(not itself). - Different name — Mux anchors the lookup at the current scope or lower. A built-in’s
base: foocannot pull in a project-levelfoo.md.
Tool patterns are anchored regex
Patterns intools.add and tools.remove are regular expressions implicitly anchored as ^pattern$. task_.* matches task_await but not task — list task separately if you need both.
If no agent in the resolved chain declares any tools, the agent has no tools.
Layer ordering
For each layer in the chain, from base → child:- Apply every
tools.addpattern as enable. - Apply every
tools.removepattern as disable. - If
tools.requireis present, the last literal entry becomes that layer’s effective required tool; child layers fully replace base layers.
remove can drop something the base enabled, and a child’s add can re-enable something the base removed.
tools.require semantics
require is not the same as add:
- It enables the tool and forces the model to emit a call to it this turn.
- The value must be a literal tool name. Regex metacharacters cause the entry to be dropped silently.
- Only one tool can be required per turn. Multiple entries collapse to the last one; child layers fully override the base layer.
- The required tool must be one the agent is otherwise allowed to call — subagent hard-denies still apply.
Runtime restrictions
These rules are applied last and cannot be overridden by frontmatter:| Condition | Effect |
|---|---|
| Subagent workspace | ask_user_question is disabled. |
| Subagent + plan-like chain | propose_plan is required, agent_report is disabled. |
| Subagent + non-plan chain | agent_report is required, propose_plan is disabled. |
| Task depth ≥ Max Task Nesting Depth | task and task_.* are disabled. |
Plan agent calling task | Only agentId: "explore" may be spawned. |
| Plan agent editing files | file_edit_* is restricted to the plan file path. |
propose_plan.
Disabling and Extending Built-ins
Disable a built-in by creating a same-name file withdisabled: true:
exec, plan, and compact are always enabled and cannot be disabled this way.
Extend a built-in by giving your file the same id and using base:
base resolution skips the current scope. Use it to add repo-specific guidance (CI commands, test patterns) without copying the built-in body.
Using Agents
As the workspace agent
Switch via the agent picker in the chat input,Cmd/Ctrl+Shift+A, or Cmd/Ctrl+. to cycle.
If a workspace’s stored agent has been disabled or deleted, top-level workspaces silently fall back to exec; subagent workspaces error out instead.
As a subagent via the task tool
subagent.runnable: true. Subagents see the body plus subagent.append_prompt, and must complete via agent_report (or propose_plan for plan-like chains).
Run-context AI defaults
Each agent has two independent default slots, configured in Settings → Agents:- UI defaults (
agentAiDefaults) — used when you select the agent in the workspace. - Subagent defaults (
subagentAiDefaults) — used when the agent is spawned viatask.
ai block. You can override one field (e.g. only thinkingLevel) and leave the other inherited.
Subagent settings are resolved at task creation and frozen on the child workspace. Changing defaults later only affects future spawns.
Examples
Security audit (read-only)
Documentation-only
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
Desktop (internal)
Visual desktop automation agent for GUI-heavy, screenshot-intensive workflowsView desktop.md
View desktop.md
Explore (internal)
Read-only exploration of repository, environment, web, etc. Useful for investigation before making changes.View explore.md
View explore.md
Name Workspace (internal)
Generate workspace name and title from user messageView name_workspace.md
View name_workspace.md
Related Docs
- Scoped instructions in
AGENTS.md: see Instruction Files - Built-in skills (
agent_skill_read): see Agent Skills