Appearance
AGENTS.md & Context
/init analyzes your project and creates an AGENTS.md file. This file gives OpenCode persistent context about your codebase: architecture, conventions, and dependencies. Every session loads this context automatically.

What you'll learn
/initscans the project and generates an AGENTS.md context file- AGENTS.md persists across sessions and is loaded automatically
- Packed with LSP diagnostics for deep codebase understanding
Build it
Initialize OpenCode in your project to establish the necessary context. This process scans your codebase and produces an AGENTS.md file that models your architecture and conventions.
bash
cd /path/to/project
opencode
/init
# AGENTS.md is created in the project rootWhat goes wrong
| Mistake | How you notice it | The fix |
|---|---|---|
| AGENTS.md outdated | Agent uses old patterns after refactor | Run /init after major architecture changes |
| AGENTS.md too large | Context window overflow | Edit AGENTS.md to keep only essential information |
Next: Desktop & IDE