Agents

Agents

Start a chat with a reusable role or delegate a task to one with an agent mention.

An agent is a Markdown file with a YAML header and standing instructions. Use it to start a new chat in that role or delegate a task from an existing chat.

Typical uses: a code reviewer that enforces your team's quality checks, a documentation writer that matches your house style, or a quick-answer agent pinned to a cheaper model.

Quick Start

Create an agent file in your workspace.

mkdir -p ~/.fabric-agent/workspaces/{ws}/agents
cat > ~/.fabric-agent/workspaces/{ws}/agents/code-reviewer.md <<'EOF'
---
name: "Code Reviewer"
description: "Reviews code for quality, security, and best practices"
color: "green"
---

You are a meticulous code reviewer. When reviewing code:
- Verify consistent style and naming.
- Flag unnecessary complexity or duplication.
- Identify injection vulnerabilities or missing input validation.
- Be constructive and specific — suggest fixes with code examples.
EOF

Open Agents, select Code Reviewer, and click Start session. A normal chat opens with an agent badge above the composer. For an agent from a working folder, the chat uses that folder. If the agent's model cannot be resolved on a configured connection, Fabric Agents uses the default model and shows a notice.

Starting a session from an agent captures the Markdown body as standing instructions. Editing the agent later leaves those instructions in effect, and the session displays a notice when it detects the change. The body can be up to 64 KB (65,536 UTF-8 bytes). A missing, unreadable, malformed, or larger file prevents the session from starting.

Branches, Continue in a new session, and workspace transfers between compatible versions retain the captured instructions. To start a child with captured instructions, pass the agent slug as agent to spawn_session. A child does not inherit its parent’s agent. In a Claude session, the agent instructions sit alongside the Claude Code prompt and any applicable CLAUDE.md that Claude Code loads.

To delegate from an existing chat, use an agent mention, for example @code-reviewer Please review the changes in my last commit. The child receives the agent's standing instructions and the task. Both entry points recognize model short names such as opus and sonnet. With inherit, a new chat uses its default model and a mention uses the parent chat's model.

File Format

Each agent is a single .md file. The filename (without .md) becomes the agent's slug.

---
name: "Agent Display Name"     # required
description: "Short tagline"   # required — shown in @ mention menu
color: "blue"                  # optional — colored dot in UI
model: "inherit"               # optional — model override, or "inherit"
icon: "🤖"                     # optional — emoji or URL
thinkingLevel: "high"           # optional — initial thinking level
---

# Agent Instructions

Your standing instructions go here.

Required fields

  • name — Display name shown in the sidebar and @ mention menu.
  • description — One-line tagline explaining what the agent specializes in.

Optional fields

  • color — Visual color identifier (red, yellow, blue, green, purple, orange, …).
  • model — Model identifier to override the session default (e.g., claude-sonnet-4-20250514). Set to "inherit" or omit to use the current session model.
  • thinkingLevel — Initial thinking level. Use off, low, medium, high, xhigh, or max. Unrecognized values leave the default in place.
  • icon — Emoji character or URL to a remote image. Inline SVG and relative paths are not supported.

Storage Locations

Fabric Agents reads three scopes.

Home-folder agents

~/.agents/agents/{slug}.md
~/.codex/agents/{slug}.md
~/.claude/agents/{slug}.md

Claude sessions can also use agents in ~/.claude/agents as Claude Code subagents.

Workspace agents

~/.fabric-agent/workspaces/{workspaceId}/agents/{slug}.md

Available from that workspace. Use a working-folder agent to share a definition through a repository.

Project agents

Live in your repository — so they ship with your code and teammates get them automatically:

{projectRoot}/.agents/agents/{slug}.md
{projectRoot}/.codex/agents/{slug}.md
{projectRoot}/.claude/agents/{slug}.md

Fabric Agents reads all three directories to stay compatible with repos already using Codex or Claude Code conventions.

Priority order

Fabric Agents shows one entry per slug. A working-folder definition overrides a workspace definition, and a workspace definition overrides a home-folder definition. Within the home and working-folder scopes, .claude takes precedence over .codex, then .agents. The agent detail page shows the selected file and its source.

Examples

Documentation writer

---
name: "Doc Writer"
description: "Writes clear, comprehensive documentation"
color: "blue"
icon: "📝"
---

You specialize in writing clear, well-structured documentation.

- Use plain language; avoid jargon unless necessary.
- Include code examples for technical concepts.
- Structure content with clear headings and sections.
- Keep paragraphs short (3-4 sentences max).

Project manager

---
name: "PM Assistant"
description: "Helps with project planning, task breakdown, and status tracking"
color: "purple"
icon: "📋"
---

You help with project management tasks.

- Break down features into actionable tasks with effort estimates.
- Flag risks and blockers prominently.
- Draft status updates and progress reports.
- Be concise and action-oriented.

Quick helper with model override

---
name: "Quick Helper"
description: "Fast responses for simple questions using a lighter model"
color: "yellow"
model: "claude-sonnet-4-20250514"
---

You provide fast, concise answers to straightforward questions.

- Keep responses brief (1-3 sentences when possible).
- Skip preamble and get straight to the answer.
- Ask for clarification only when truly ambiguous.

When this agent is mentioned, it runs on the specified model instead of the session default — useful for routing low-stakes interactions to a cheaper model.

Subagent sessions (parent-child tree)

When you @mention an agent, Fabric Agents spawns a child session with its own conversation context, standing instructions, and tools. The agent runs to completion and a structured summary flows back as a tool result in the parent.

What this means in practice:

  • The child session shows up under the parent in the sidebar's tree view with progress + completion state. Click into a child to see its full conversation, tool calls, and intermediate output.
  • The child session inherits permission mode, working directory, and the LLM connection from the parent. The model can be overridden via model: frontmatter on the agent.
  • When a child needs permission, the request shows in the child session itself, like any session's, and on the child's card in the parent's chat, with Allow, Allow Always and Deny. Answer it in either place. Several requests on a card show one at a time ("1 of 2"). A child that was still running when Fabric restarted shows Idle on its card once it stops working.
  • The child's chat input is disabled — it runs autonomously until done. To intervene, cancel the child and let the parent take over, or branch the child into its own top-level session.
  • Multi-task spawning: Fabric Agents detects multi-task user messages ("one for X, another for Y") and spawns parallel subagent instances — one per task. Results merge back into the parent in order.
  • Cascade lifecycle: cancelling or deleting the parent cancels/deletes children. Cancelling a child only stops that subtree.
  • Cross-machine considerations: subagent sessions are first-class on disk under the same workspace, so they sync with workspaces and remote sessions identically to top-level sessions.
  • Nesting depth: on Claude-backed connections, subagents can spawn their own subagents only one level deep by default. If a workflow relies on deeper nesting, set the CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH environment variable to raise the cap.

You'll see this in the sidebar as nested rows beneath the parent session. The child session header has a back-to-parent breadcrumb so you can pop back without losing your place.

Subagent model

With Claude, Settings → AI → Performance → Subagent model runs general-purpose subagents on Sonnet or Haiku when they would otherwise inherit the session's model (usually Opus). Agents that set their own model:, and Agent calls that name a model, keep theirs. When the decision model's Subagent models feature is on, its pick for each task comes first and this setting is the fallback. A subagent never runs on a model more expensive than the session's. The setting applies to new and restarted sessions.

Best Practices

  • One agent, one role. Narrow focus beats broad generalists.
  • Show, don't tell. Include example outputs so the agent matches your expectations.
  • Define tone explicitly. "Be concise and action-oriented" is more reliable than hoping for it implicitly.
  • Color by category. Assign distinct colors to agents you invoke often so they're easy to spot in the UI.
  • Commit high-signal agents to the repo. Anything your team should share belongs in .agents/agents/ rather than a workspace folder.

Troubleshooting

Agent doesn't appear in the mention menu

  • Confirm the file ends with .md and lives in one of the supported directories.
  • Verify frontmatter is delimited by --- on its own lines.
  • Check that both name and description are present and non-empty.

Agent loads the wrong version

  • Project agents override workspace agents with the same slug.
  • Check for duplicate slugs across .agents/agents/, .codex/agents/, and .claude/agents/.

Model override is ignored

  • The model field expects a canonical model ID. Typos fall back to inherit.
  • If the current session already uses a different backend that doesn't know that model, the override is skipped.

See also

  • Skills — reusable instruction sets invoked with @ and scoped per-invocation
  • Commands — slash-prefixed prompt templates with arguments
  • Permissions — control how much autonomy agents have

On this page