global AGENTS.md is ignored (model: Grok Code Fast 1) #2305

Closed
opened 2026-02-16 17:35:04 -05:00 by yindo · 2 comments
Owner

Originally created by @justinmk on GitHub (Oct 27, 2025).

Description

I want to add global rules, and tried the instructions found at https://opencode.ai/docs/rules and https://opencode.ai/docs/agents/ and https://github.com/sst/opencode/commit/23757f3ac09b540f31d5df2088e65e5399d92f7f ... but can't get it to work. Also looked at many issues including https://github.com/sst/opencode/issues/2888 , https://github.com/sst/opencode/issues/847 .

I created ~/.config/opencode/AGENTS.md with this content:

# Prime directive:

ALWAYS use the `bd` tool instead of markdown files for all new work.
See `bd quickstart` to understand the tool.

I created ~/.config/opencode/opencode.jsonc and I know that it's working because when I change the theme in it, then next invocation of opencode uses that theme.

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "system",
  "instructions": ["~/.config/opencode/AGENTS.md"],
  // https://github.com/sst/opencode/issues/3176
  "snapshot": false,
  //"autoupdate": true,
}

I also tried:

  • without "instructions"
  • "instructions": ["AGENTS.md"],

OpenCode version

0.15.18

Steps to reproduce

  1. create ~/.config/opencode/opencode.jsonc
  2. create ~/.config/opencode/AGENTS.md with contents mentioned above.
  3. Start opencode in a project dir.
  4. Select model Grok Code Fast 1
  5. In "build" mode ask it what did i tell you about bd
  6. it gives a dumb answer like You haven't told me anything about bd in this conversation.

Operating System

macos intel 15.7

Terminal

ghostty

Originally created by @justinmk on GitHub (Oct 27, 2025). ### Description I want to add global rules, and tried the instructions found at https://opencode.ai/docs/rules and https://opencode.ai/docs/agents/ and https://github.com/sst/opencode/commit/23757f3ac09b540f31d5df2088e65e5399d92f7f ... but can't get it to work. Also looked at many issues including https://github.com/sst/opencode/issues/2888 , https://github.com/sst/opencode/issues/847 . I created `~/.config/opencode/AGENTS.md` with this content: ``` # Prime directive: ALWAYS use the `bd` tool instead of markdown files for all new work. See `bd quickstart` to understand the tool. ``` I created `~/.config/opencode/opencode.jsonc` and I know that it's working because when I change the `theme` in it, then next invocation of `opencode` uses that theme. ``` { "$schema": "https://opencode.ai/config.json", "theme": "system", "instructions": ["~/.config/opencode/AGENTS.md"], // https://github.com/sst/opencode/issues/3176 "snapshot": false, //"autoupdate": true, } ``` I also tried: - without `"instructions"` - `"instructions": ["AGENTS.md"],` ### OpenCode version 0.15.18 ### Steps to reproduce 1. create `~/.config/opencode/opencode.jsonc` 2. create `~/.config/opencode/AGENTS.md` with contents mentioned above. 3. Start `opencode` in a project dir. 4. Select model `Grok Code Fast 1` 5. In "build" mode ask it `what did i tell you about bd` 6. it gives a dumb answer like `You haven't told me anything about bd in this conversation.` ### Operating System macos intel 15.7 ### Terminal ghostty
yindo added the bug label 2026-02-16 17:35:04 -05:00
yindo closed this issue 2026-02-16 17:35:04 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 27, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3432: Describes the same problem where agent markdown files in custom/global config directories are ignored - user reports that when using custom config paths, agents defined in markdown aren't picked up, only JSON-defined agents work

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 27, 2025): This issue might be a duplicate of existing issues. Please check: - #3432: Describes the same problem where agent markdown files in custom/global config directories are ignored - user reports that when using custom config paths, agents defined in markdown aren't picked up, only JSON-defined agents work Feel free to ignore if none of these address your specific case.
Author
Owner

@justinmk commented on GitHub (Oct 27, 2025):

Somehow this is working after removing the instructions line. Though I did try that before.

I wonder if the issue was related to per-workspace sessions, though I always start opencode without args and don't tell it to use a session.

I also tried opencode --print-logs and it didn't show any hints.

@justinmk commented on GitHub (Oct 27, 2025): Somehow this is working after removing the `instructions` line. Though I did try that before. I wonder if the issue was related to per-workspace sessions, though I always start `opencode` without args and don't tell it to use a session. I also tried `opencode --print-logs` and it didn't show any hints.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2305