ai-dev / references
AGENTS.md4 starsChanged 11 days agoMITView on GitHub
[!NOTE] This file covers V1 agent config (agent map, prompt, permission, disable, temperature). Native V2 uses agents, system, permissions arrays, disabled, and request.body, defaults new custom agents to mode: primary, and has no scout agent. See v2/agents.md. Switch primary agents with Tab (agent_cycle) or Shift+Tab (agent_cycle_reverse). Invoke subagents with @general, @explore, @scout, or let the primary agent call them automatically. When a subagent creates a child session: session_child_first (default Leader+Down) enters it, session_child_cycle/session_child_cycle_reverse (default Right/Left) cycle siblings, session_parent (default Up)…
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- repository-reviewSkill
- weekly-skill-refreshSkill
- skill-maintenanceSkill
- about-me-skill-creatorSkill
- agent-creator-claudecodeSkill
- agent-creator-codexSkill
- agent-creator-copilotSkill
- agent-creator-opencodeSkill
- client-config-claudecodeSkill
- client-config-codexSkill
- client-config-copilotcliSkill
- client-config-opencodeSkill
- copilot-instruction-creatorSkill
- copilot-workerSkill
- docker-image-managementSkill
- git-commit-messagesSkill
- google-style-docsSkill
- handoffSkill
- markdownlint-validatorSkill
- mkdocs-site-managementSkill
- skill-routerSkill
The file
We split this agents.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
When a subagent creates a child session: session_child_first (default Leader+Down) enters it, …
- Distinctive: line 83
Create agents as markdown files with YAML frontmatter:
- Distinctive: line 120
Use glob patterns for fine-grained bash control:
- Very specific: line 159
Must be a primary mode agent.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
V1 Agents Reference
[!NOTE] This file covers V1 agent config (
agentmap,prompt,permission,disable,temperature). Native V2 usesagents,system,permissionsarrays,disabled, andrequest.body, defaults new custom agents tomode: primary, and has noscoutagent. See v2/agents.md.
Built-in agents
| Agent | Mode | Default behavior |
build | primary | Full tool access — default for development work |
plan | primary | file edits and bash set to ask — analysis/planning |
general | subagent | Full access (except todo) — multi-step research tasks, parallelizable |
explore | subagent | Read-only codebase exploration — find files/patterns fast |
scout | subagent | Read-only external docs/dependency research — clones deps into opencode's cache, cross-references upstream source |
compaction | primary (hidden) | Summarises context when it fills up |
title | primary (hidden) | Generates session titles |
summary | primary (hidden) | Generates session summaries |
Switch primary agents with Tab (agent_cycle) or Shift+Tab (agent_cycle_reverse).
Invoke subagents with @general, @explore, @scout, or let the primary agent call them automatically.
When a subagent creates a child session: session_child_first (default Leader+Down) enters it, session_child_cycle/session_child_cycle_reverse (default Right/Left) cycle siblings, session_parent (default Up) returns.
Agent configuration in opencode.json
{
"agent": {
"build": {
"model": "anthropic/claude-opus-4-5",
"steps": 50
},
"plan": {
"prompt": "{file:~/.config/opencode/prompts/plan.md}"
},
"my-reviewer": {
"description": "Reviews code for security and quality issues",
"mode": "subagent",
"model": "anthropic/claude-sonnet-4-5",
"temperature": 0.1,
"color": "#e06c75",
"permission": {
"edit": "deny",
"bash": "deny"
}
}
}
}Agent fields reference
| Field | Description | Example |
description | Purpose — used for @ autocomplete and auto-routing. Required | "Reviews code for quality" |
mode | "primary" (user-selectable), "subagent" (invoked by agents), "all" — defaults to "all" if unset | "subagent" |
model | Override default model for this agent | "anthropic/claude-opus-4-5" |
variant | Default model variant (applies only when using the agent's configured model) | "high" |
prompt | System prompt — inline string or {file:path} (path relative to the config file) | "{file:./prompts/reviewer.md}" |
temperature | Response randomness, typically 0.0–1.0; unset uses model defaults | 0.1 |
top_p | Response diversity control | 0.9 |
steps | Max agentic iterations before falling back to text | 30 |
permission | Tool access rules (see permissions.md) | {"edit": "deny"} |
color | Hex #RRGGBB or theme color name | "#e06c75" or "accent" |
disable | Set true to disable agent | true |
hidden | Hide a subagent from @ autocomplete (still invocable via the Task tool) | true |
options | Generic options object | {} |
tools | Deprecated — use permission (true ≈ {"*": "allow"}, false ≈ {"*": "deny"}) | {"write": false} |
maxSteps | Deprecated — use steps | — |
Theme color names: primary, secondary, accent, success, warning, error, info
Any other key in an agent entry is passed straight to the provider as a model option (e.g. "reasoningEffort": "high"
for OpenAI reasoning models).
Agent markdown files (alternative to JSON)
Create agents as markdown files with YAML frontmatter:
Global: ~/.config/opencode/agents/<name>.md
Project: .opencode/agents/<name>.md
---
description: Reviews code for security vulnerabilities and quality issues
mode: subagent
model: anthropic/claude-sonnet-4-5
temperature: 0.1
color: "#e06c75"
permission:
edit: deny
bash: deny
read: allow
---
# Security Reviewer
You are a security-focused code reviewer. When reviewing code:
1. Check for injection vulnerabilities (SQL, command, XSS)
2. Identify exposed secrets or credentials
3. Flag insecure dependencies
4. Look for auth and authorization flaws
5. Note insecure data handling
Always provide specific line references and concrete remediation steps.Invoke via CLI: opencode agent create for interactive setup.
Granular bash permissions in agents
Use glob patterns for fine-grained bash control:
{
"agent": {
"build": {
"permission": {
"bash": {
"*": "ask",
"git status": "allow",
"git diff *": "allow",
"git add *": "allow",
"git commit *": "allow",
"git push *": "deny",
"npm run *": "allow",
"rm *": "ask"
},
"task": {
"*": "deny",
"code-reviewer": "ask",
"orchestrator-*": "allow"
}
}
}
}
}The task permission controls which subagents this agent can invoke via the Task tool, using glob patterns on
subagent names. A denied subagent is removed from the Task tool description entirely.
Default agent
{ "default_agent": "build" }Must be a primary mode agent. The default is build.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

