Overview
mux layers instructions from two locations:~/.mux/AGENTS.md(+ optionalAGENTS.local.md) — global defaults<workspace>/AGENTS.md(+ optionalAGENTS.local.md) — workspace-specific context
AGENTS.mdAGENT.mdCLAUDE.md
AGENTS.local.md from the same directory (when present).
mux strips HTML-style markdown comments (
<!-- ... -->) from instruction files before sending them
to the model. Use these comments for editor-only metadata—they will not reach the agent.Scoped instructions
mux supports scoped instructions that activate only in specific contexts. You define them using special headings:Model: <regex>— Active only for specific models (e.g., GPT-4, Claude).Tool: <tool_name>— Appended to the description of specific tools.
- AGENTS.md files (global
~/.mux/AGENTS.mdor workspace<workspace>/AGENTS.md) - Custom agent definitions (the Markdown body of
.mux/agents/<name>.mdfiles)
Agent-specific and mode-specific scoped instructions (
Agent: and Mode:) have been removed. Use
custom agent definitions instead to customize behavior per agent.General Rules
- Precedence: Workspace instructions (
<workspace>/AGENTS.md) are checked first, then global instructions (~/.mux/AGENTS.md). - First Match Wins: Only the first matching section found is used. Overriding global defaults is as simple as defining the same section in your workspace.
- Isolation: These sections are stripped from the general
<custom-instructions>block. Their content is injected only where it belongs (e.g., into a specific tool’s description or a special XML tag). - Boundaries: A section’s content includes everything until the next heading of the same or higher level.
Model Prompts
Scope instructions to specific models or families using regex matching. The matched content is injected via a<model-...> tag.
Syntax: Model: <regex>
- Regexes are case-insensitive by default.
- Use
/pattern/flagsfor custom flags (e.g.,/openai:.*codex/i).
Tool Prompts
Customize how the AI uses specific tools by appending instructions to their descriptions. Syntax:Tool: <tool_name>
- Tool names must match exactly (case-insensitive).
- Only tools available for the active model are augmented.
bash, file_read, file_edit_replace_string, file_edit_insert, propose_plan, ask_user_question, todo_write, todo_read, status_set, web_fetch, web_search.