Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/web/src/content/docs/rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ export OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 # Disable only .claude/skills

## Precedence

When opencode starts, it looks for rule files in this order:
OpenCode loads and concatenates rule files from multiple layers. All three layers below are loaded in order, with later layers appended after earlier ones:

1. **Local files** by traversing up from the current directory (`AGENTS.md`, `CLAUDE.md`)
2. **Global file** at `~/.config/opencode/AGENTS.md`
3. **Claude Code file** at `~/.claude/CLAUDE.md` (unless disabled)

The first matching file wins in each category. For example, if you have both `AGENTS.md` and `CLAUDE.md`, only `AGENTS.md` is used. Similarly, `~/.config/opencode/AGENTS.md` takes precedence over `~/.claude/CLAUDE.md`.
Within each layer, the first matching file wins. For example, if your project root has both `AGENTS.md` and `CLAUDE.md`, only `AGENTS.md` from that layer is used`CLAUDE.md` is skipped. Similarly, a global `~/.config/opencode/AGENTS.md` takes precedence over `~/.claude/CLAUDE.md`, but both layers are still included after the local layer.

---

Expand Down
Loading