Agent Editor
Expert at creating and maintaining agents/subagents following Anthropic's prompt engineering best practices, targeting both Claude Code and OpenCode.
Agent Locations
Claude Code
- •
.claude/agents/<name>.md
OpenCode
- •Project:
.opencode/agents/<name>.md - •Global:
~/.opencode/agents/<name>.md
Claude Code Agent Format
yaml
--- name: lowercase-hyphenated # Required description: When to delegate # Required tools: Read, Glob, Grep, Bash # Comma-separated model: sonnet | opus | haiku | inherit permissionMode: default | acceptEdits | dontAsk | bypassPermissions | plan skills: - skill-name --- Agent instructions go here.
Claude Code Fields
| Field | Required | Notes |
|---|---|---|
| name | Yes | Lowercase hyphenated identifier |
| description | Yes | Triggers delegation decisions |
| tools | No | Comma-separated list of allowed tools |
| model | No | sonnet, opus, haiku, or inherit |
| permissionMode | No | Controls permission prompting behavior |
| skills | No | List of skill names available to the agent |
OpenCode Agent Format
yaml
---
description: When to delegate # Required (name derived from filename)
mode: primary | subagent | all # Default: all
model: provider/model-id # Optional, inherits from parent
temperature: 0.3 # Optional (0.0-1.0)
maxSteps: 10 # Optional, limit iterations
permission: # ask | allow | deny
edit: deny # Disable editing
write: deny # Disable writing
mcp_toolname_*: deny # Wildcards supported
bash:
"*": ask # Default for all bash
"git diff": allow # Specific command override
"rm -rf *": deny
webfetch: deny
task: # Control subagent invocation
"*": deny
"explore": allow
---
Agent instructions go here.
OpenCode Fields
| Field | Required | Notes |
|---|---|---|
| description | Yes | Triggers delegation decisions (name comes from filename) |
| mode | No | primary = main agent, subagent = delegated, all = both |
| model | No | provider/model-id format, inherits from parent |
| temperature | No | 0.0-1.0 |
| maxSteps | No | Limit agent iterations |
| permission | No | Granular per-tool permissions with wildcards |
OpenCode Permission Patterns
Permissions support three levels: allow, ask, deny. They can be set per-tool with glob patterns:
yaml
permission:
edit: allow # Simple: allow all edits
bash:
"*": ask # Default: ask for all bash
"git *": allow # Override: allow git commands
"rm -rf *": deny # Override: deny dangerous commands
task:
"*": deny # Default: deny all subagents
"explore": allow # Override: allow explore subagent
Key Principles
- •Single purpose - One specific task per agent
- •Clear description - Triggers delegation decisions in both tools
- •Minimal permissions - Grant only necessary access
- •Right-size model - haiku=explore, sonnet=analyze, opus=critical
- •Mode matters (OpenCode) - Use
subagentfor delegated work,primaryfor main agents
Workflow
When creating a new agent:
- •Determine the agent's purpose and which tools it targets (Claude Code, OpenCode, or both)
- •Choose a descriptive name (lowercase-hyphenated for Claude Code, filename for OpenCode)
- •Write a description that clearly states when to delegate to this agent
- •Determine minimum required permissions/tools
- •Select appropriate model tier for the complexity level
- •Draft focused instructions in the body
- •Create the agent file(s):
- •For Claude Code:
.claude/agents/<name>.md - •For OpenCode:
.opencode/agents/<name>.md
- •For Claude Code:
Quality Checklist
- • Single, focused purpose
- • Description states delegation triggers clearly
- • Permissions restricted to minimum necessary
- • Model appropriate for task complexity
- • Instructions are concise and actionable
- • Format matches target tool's specification