Skip to content

File Agents

file_agents loads agents from markdown files with YAML frontmatter: the frontmatter configures the agent, the markdown body becomes its system prompt. Files in the format of Claude Code subagents (.claude/agents/*.md), OpenCode agents and AgentPool's own format (any native agent field in the frontmatter) are supported.

file_agents:
  reviewer: .claude/agents/reviewer.md   # format detected from the frontmatter
  debugger:
    type: opencode                       # explicit format
    path: ./agents/debugger.md
  remote: https://example.com/agents/helper.md  # any UPath location
agents/worker.md
---
model: openai:gpt-6-luna
tools:
  - type: file_access
---
You are a file processing worker.

The same file can be used for several agents (worker_1: agents/worker.md, worker_2: agents/worker.md).

OpenCode permissions

The permission block of an OpenCode agent file becomes pre_tool_use hooks (agentpool.hooks.permission.fixed_decision) for the tools each key covers:

Key AgentPool tools
edit write, edit, agentic_edit, edit_batch, multi_edit, regex_replace_lines, apply_patch, patch, delete_path
bash bash, sandbox_bash, execute_command, execute_code
webfetch webfetch, web_fetch, fetch, download_file

deny blocks the calls (the model is told), ask asks the user before every call, allow keeps the agent's confirmation mode. Command patterns (bash: {"git diff": allow, "*": ask}) are not supported: the strictest decision of the map applies to the whole tool.

Configuration Reference

ClaudeFileAgentConfig

Configuration for a Claude Code format agent file.

Claude Code agents use markdown files with YAML frontmatter containing fields like model, tools, allowed-tools, etc.

Example:

file_agents:
  reviewer:
    type: claude
    path: .claude/agents/reviewer.md

ClaudeFileAgentConfig (YAML)
1
2
3
name:
  type: claude  # Discriminator for Claude Code format
  path: .claude/agents/reviewer.md  # Path to the agent markdown file

OpenCodeFileAgentConfig

Configuration for an OpenCode format agent file.

OpenCode agents use markdown files with YAML frontmatter containing fields like model, tools, description, etc.

Example:

file_agents:
  debugger:
    type: opencode
    path: ./agents/debugger.md

OpenCodeFileAgentConfig (YAML)
1
2
3
name:
  type: opencode  # Discriminator for OpenCode format
  path: ./agents/debugger.md  # Path to the agent markdown file

NativeFileAgentConfig

Configuration for a native format agent file.

Native agents use markdown files with YAML frontmatter containing full NativeAgentConfig fields (model, toolsets, knowledge, etc.).

Example:

file_agents:
  assistant:
    type: native
    path: ./agents/assistant.md

NativeFileAgentConfig (YAML)
1
2
3
name:
  type: native  # Discriminator for native format
  path: ./agents/assistant.md  # Path to the agent markdown file