Initialize
To create a new AGENTS.md file, you can run the/init command in opencode.
You should commit your project’s AGENTS.md file to Git.
/init scans the important files in your repo, may ask a couple of targeted questions when the codebase cannot answer them, and then creates or updates AGENTS.md with concise project-specific guidance.
It focuses on the things future agent sessions are most likely to need:
- build, lint, and test commands
- command order and focused verification steps when they matter
- architecture and repo structure that are not obvious from filenames alone
- project-specific conventions, setup quirks, and operational gotchas
- references to existing instruction sources like Cursor or Copilot rules
/init will improve it in place instead of blindly replacing it.
Types
opencode also supports reading the AGENTS.md file from multiple locations. And this serves different purposes.Project
Place an AGENTS.md in your project root for project-specific rules. These only apply when you are working in this directory or its sub-directories.Global
You can also have global rules in a~/.config/symbiotic/AGENTS.md file. This gets applied across all opencode sessions.
Since this isn’t committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.
Claude Code Compatibility
For users migrating from Claude Code, Symbiotic Code supports Claude Code’s file conventions as fallbacks:- Project rules: CLAUDE.md in your project directory (used if no AGENTS.md exists)
- Global rules: ~/.claude/CLAUDE.md (used if no
~/.config/symbiotic/AGENTS.mdexists) - Skills: ~/.claude/skills/ — see Agent Skills for details
Precedence
When opencode starts, it looks for rule files in this order:- Local files by traversing up from the current directory (AGENTS.md, CLAUDE.md)
- Global file at ~/.config/symbioticAGENTS.md
- Claude Code file at ~/.claude/CLAUDE.md (unless disabled)
~/.config/symbioticAGENTS.md takes precedence over ~/.claude/CLAUDE.md.
Custom Instructions
You can specify custom instruction files in your symbiotic.json or the global~/.config/symbioticsymbiotic.json. This allows you and your team to reuse existing rules rather than having to duplicate them to AGENTS.md.
Example:
symbiotic.json
symbiotic.json
Referencing External Files
While opencode doesn’t automatically parse file references in AGENTS.md, you can achieve similar functionality in two ways:Using symbiotic.json
The recommended approach is to use the instructions field in symbiotic.json:symbiotic.json
Manual Instructions in AGENTS.md
You can teach opencode to read external files by providing explicit instructions in your AGENTS.md. Here’s a practical example:AGENTS.md