Issue Report: Custom instruction files in opencode.jsonc not being loaded #3121

Open
opened 2026-02-16 17:38:44 -05:00 by yindo · 4 comments
Owner

Originally created by @coolehs on GitHub (Nov 25, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

The instructions array in opencode.jsonc configuration file is not being loaded into the agent's context at session start. Only the AGENTS.md file appears to be loaded automatically.

Configuration

File: ~/.config/opencode/opencode.jsonc

{
    "$schema": "https://opencode.ai/config.json",
    "model": "github-copilot/claude-sonnet-4.5",
    "autoupdate": true,
    "instructions": [
        "SUPEROPENCODE.md",
        "COMMANDS.md",
        "FLAGS.md",
        "PRINCIPLES.md",
        "RULES.md",
        "MCP.md",
        "PERSONAS.md",
        "ORCHESTRATOR.md",
        "MODES.md",
        "KIRO.md"
    ]
}

Expected Behavior

All instruction files listed in the instructions array should be automatically loaded and available in the agent's context at the start of each session.

Actual Behavior

Only AGENTS.md is loaded into the agent's context. The agent confirms it can only see:

  • Instructions from <project>/AGENTS.md (project-level)
  • Instructions from ~/.config/opencode/AGENTS.md (global)

None of the files specified in the instructions array are loaded.

Verification

All instruction files exist in the config directory:

~/.config/opencode/
  ✓ AGENTS.md
  ✓ SUPEROPENCODE.md
  ✓ COMMANDS.md
  ✓ FLAGS.md
  ✓ PRINCIPLES.md
  ✓ RULES.md
  ✓ MCP.md
  ✓ PERSONAS.md
  ✓ ORCHESTRATOR.md
  ✓ MODES.md
  ✓ KIRO.md

Additional Context

The MCP servers defined in the same config file (context7 and sequential-thinking) appear to be loading correctly, suggesting the config file itself is being read, but the instructions array is not being processed. The default model is also correctly loaded.

OpenCode version

1.0.112

Steps to reproduce

  1. Create custom instruction files in ~/.config/opencode/
  2. Add them to the instructions array in opencode.jsonc
  3. Start a new OpenCode session
  4. Ask the agent if it has access to the custom instructions
  5. Agent confirms it only has access to AGENTS.md

Screenshot and/or share link

No response

Operating System

macOS 14 (Darwin 24.5.0, ARM64)

Terminal

No response

Originally created by @coolehs on GitHub (Nov 25, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description The `instructions` array in `opencode.jsonc` configuration file is not being loaded into the agent's context at session start. Only the `AGENTS.md` file appears to be loaded automatically. ### Configuration **File:** `~/.config/opencode/opencode.jsonc` ```json { "$schema": "https://opencode.ai/config.json", "model": "github-copilot/claude-sonnet-4.5", "autoupdate": true, "instructions": [ "SUPEROPENCODE.md", "COMMANDS.md", "FLAGS.md", "PRINCIPLES.md", "RULES.md", "MCP.md", "PERSONAS.md", "ORCHESTRATOR.md", "MODES.md", "KIRO.md" ] } ``` ### Expected Behavior All instruction files listed in the `instructions` array should be automatically loaded and available in the agent's context at the start of each session. ### Actual Behavior Only `AGENTS.md` is loaded into the agent's context. The agent confirms it can only see: - Instructions from `<project>/AGENTS.md` (project-level) - Instructions from `~/.config/opencode/AGENTS.md` (global) None of the files specified in the `instructions` array are loaded. ### Verification All instruction files exist in the config directory: ``` ~/.config/opencode/ ✓ AGENTS.md ✓ SUPEROPENCODE.md ✓ COMMANDS.md ✓ FLAGS.md ✓ PRINCIPLES.md ✓ RULES.md ✓ MCP.md ✓ PERSONAS.md ✓ ORCHESTRATOR.md ✓ MODES.md ✓ KIRO.md ``` ### Additional Context The MCP servers defined in the same config file (context7 and sequential-thinking) appear to be loading correctly, suggesting the config file itself is being read, but the `instructions` array is not being processed. The default model is also correctly loaded. ### OpenCode version 1.0.112 ### Steps to reproduce 1. Create custom instruction files in `~/.config/opencode/` 2. Add them to the `instructions` array in `opencode.jsonc` 3. Start a new OpenCode session 4. Ask the agent if it has access to the custom instructions 5. Agent confirms it only has access to `AGENTS.md` ### Screenshot and/or share link _No response_ ### Operating System macOS 14 (Darwin 24.5.0, ARM64) ### Terminal _No response_
yindo added the opentuibug labels 2026-02-16 17:38:44 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 25, 2025):

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

  • #4479: [FEATURE] Configurable instruction file search boundary and file types - discusses loading custom instruction files but from a feature request perspective about search boundaries
  • #4054: MCP Servers are not available if config is per project - related issue about per-project configuration not being loaded correctly
  • #4035: [FEATURE] Ability to ignore AGENTS.md - discusses custom instruction file handling in configuration
  • #2225: Automatically load @ referenced files in AGENTS.md into context - related to instruction file loading mechanisms

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

@github-actions[bot] commented on GitHub (Nov 25, 2025): This issue might be a duplicate of existing issues. Please check: - #4479: [FEATURE] Configurable instruction file search boundary and file types - discusses loading custom instruction files but from a feature request perspective about search boundaries - #4054: MCP Servers are not available if config is per project - related issue about per-project configuration not being loaded correctly - #4035: [FEATURE] Ability to ignore AGENTS.md - discusses custom instruction file handling in configuration - #2225: Automatically load @ referenced files in AGENTS.md into context - related to instruction file loading mechanisms Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 25, 2025):

@coolehs the files are resolved relative to where opencode runs. You should use absolute paths here instead

@rekram1-node commented on GitHub (Nov 25, 2025): @coolehs the files are resolved relative to where opencode runs. You should use absolute paths here instead
Author
Owner

@berenar commented on GitHub (Jan 19, 2026):

I had the same exact issue (https://github.com/anomalyco/opencode/issues/9368): I assumed that the paths in instructions are relative, but they are clearly not. I feel this is important information that should be in the docs.

@berenar commented on GitHub (Jan 19, 2026): I had the same exact issue (https://github.com/anomalyco/opencode/issues/9368): I assumed that the paths in `instructions` are relative, but they are clearly not. I feel this is important information that should be in the docs.
Author
Owner

@berenar commented on GitHub (Jan 19, 2026):

@rekram1-node Sent a PR already

@berenar commented on GitHub (Jan 19, 2026): @rekram1-node Sent a PR already
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3121