Portable agents
Custom agents let you carve out focused roles—a read-only code reviewer, a test writer, a docs editor, or a researcher—with their own prompt and tool access.
The tricky part is that every AI client names its tools differently. Reading a file is Read in Claude Code, read in Copilot, and view_file in Antigravity. Models and reasoning effort differ across clients too.
OpenLune solves this by separating portable intent (the prompt, capabilities, skills, and MCP servers) from client-specific tuning (models, effort, and native tools).
A basic agent
Section titled “A basic agent”Every agent needs a description (shown to the main agent and user when deciding whether to delegate to it) and an instructions Markdown file:
version: "0.1"
agents: reviewer: description: Review changes for correctness and maintainability. instructions: agents/reviewer.md capabilities: [files.read, files.find, files.search]By default, the agent’s display name in the client matches its resource ID (reviewer). If you want a different native name—for instance, with spaces or capitalization—set name:
agents: reviewer: name: Code Reviewer description: Review changes for correctness and maintainability. instructions: agents/reviewer.mdCapabilities: omitted vs. empty vs. explicit
Section titled “Capabilities: omitted vs. empty vs. explicit”OpenLune maps eight portable capabilities to each client’s native tools:
| Capability | What it allows |
|---|---|
files.read |
Read file contents |
files.find |
List directories and find files by name or glob |
files.search |
Search text across files |
files.write |
Create and edit files |
web.fetch |
Fetch a URL |
web.search |
Search the web |
shell.exec |
Run shell commands |
agents.delegate |
Spawn or delegate to subagents |
How you set capabilities matters—OpenLune deliberately preserves the difference between omitting the field and setting it to []:
- Omitted (
capabilitiesnot set): The agent inherits the parent session’s default tools. - Explicit list (
capabilities: [files.read, files.search]): OpenLune maps those capabilities to the smallest matching set of native tools. - Empty list (
capabilities: []): The agent gets no built-in tools (unless you addnativeTools, skills, or MCP servers).
When a client cannot narrow tools
Section titled “When a client cannot narrow tools”Clients differ in how finely they slice tools:
- Combined native tools: In Copilot,
searchcovers bothfiles.findandfiles.search, andwebcovers bothweb.fetchandweb.search. If you request onlyfiles.search, OpenLune grantssearchand reports a deviation telling youfiles.findcame along with it. - Inherited-only clients: Codex and Grok Build subagents always inherit every tool from the parent session. If you declare
capabilitiesornativeTools, OpenLune still generates the agent and reports a deviation explaining that the client cannot restrict its tools.
You’ll always see these differences during openlune plan and be asked to accept them during openlune apply. See Supported clients for the exact tool mapping per client.
Tuning per client
Section titled “Tuning per client”Under clients.<client-id>, you can override model, effort, capabilities, or add nativeTools for a specific client without affecting the others:
agents: reviewer: description: Review changes for correctness and maintainability. instructions: agents/reviewer.md capabilities: [files.read, files.find, files.search] clients: claude-code: model: sonnet effort: high copilot: model: claude-sonnet-4.6 effort: high codex: model: gpt-5.4 effort: medium grok-build: model: claude-4.6-sonnet effort: high antigravity: model: proA few client rules to keep in mind:
- Models and effort are passed through so you can use whatever model IDs your client supports—with two native constraints:
- Claude Code validates
effortagainstlow,medium,high,xhigh, ormax. - Antigravity validates
modelagainst its four tiers (inherit,flash_lite,flash,pro) and has noeffortsetting (settingeffortthere is reported as a deviation). - Grok Build encodes effort inside the model selector (
model[effort=value]), so settingefforton Grok Build requires an explicitmodelother thaninherit.
- Claude Code validates
- Overriding
capabilitiesper client completely replaces the agent’s top-levelcapabilitiesfor that client.
Adding client-native tools (nativeTools)
Section titled “Adding client-native tools (nativeTools)”Sometimes you want a tool that only exists in one client—or a client-specific selector like Claude Code’s Bash(git diff *). Add it under clients.<id>.nativeTools:
agents: researcher: description: Research documentation and issues on the web. instructions: agents/researcher.md capabilities: [] clients: copilot: nativeTools: [web] claude-code: nativeTools: [WebFetch, WebSearch]Two rules keep nativeTools predictable:
nativeToolsrequires explicitcapabilities. If the agent omitscapabilities(inheriting everything), OpenLune rejects non-emptynativeToolsbecause clients cannot express “all defaults plus one more.” Setcapabilities: []if you want native tools only, or list the portable capabilities you want alongside them.- Don’t grant MCP servers via
nativeTools. Use the agent’smcpfield instead—OpenLune rejects raw MCP tool names innativeTools(likemcp__*in Claude Code orserver/*in Copilot).
Giving an agent skills and MCP servers
Section titled “Giving an agent skills and MCP servers”You can connect an agent to resources declared elsewhere in the same manifest:
agents: reviewer: description: Review changes for correctness and maintainability. instructions: agents/reviewer.md capabilities: [files.read, files.find, files.search] skills: [repository-notes] mcp: [codegraph]Both skills and mcp reference the resource IDs (the map keys under skills: and mcp: in manifest.yaml), not native display names.
Just like capabilities, omitted vs. empty has a clear meaning:
| Setting | Meaning |
|---|---|
| Omitted | Leave skill or MCP access to the client’s default behavior |
[] (empty list) |
Request no skills / no MCP servers for this agent |
[id1, id2] |
Grant access to those declared skills / MCP servers |
Because clients handle skill and MCP scoping differently, OpenLune translates as closely as each client allows and surfaces a deviation whenever the client is broader than requested:
- Skills: No client currently restricts an agent to only a subset of skills—listing skills ensures the agent has the tool needed to invoke skills (such as
Skillin Claude Code, orview_filein Antigravity, which reports a deviation because it also grantsfiles.read). Settingskills: []withholds skills in Claude Code, and reports a deviation in Copilot, Grok Build, and Codex where skills remain available. - MCP servers: With an explicit
capabilitieslist, Claude Code and Copilot grant access only to the listed servers. Antigravity’sinheritMcpswitch is all-or-nothing (so listing servers grants every session server and reports a deviation). In Grok Build, Codex, or any agent that omitscapabilities, MCP servers are inherited from the parent session.