Feature: Allow plan mode to save plans to configurable paths #4311

Closed
opened 2026-02-16 17:43:23 -05:00 by yindo · 1 comment
Owner

Originally created by @b3nw on GitHub (Jan 6, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Plan mode's strict read-only enforcement prevents saving the plan itself, making it difficult to persist planning work for later reference or handoff to Build mode.

Problem

Currently, Plan mode has a hardcoded system-reminder that enforces:

"STRICTLY FORBIDDEN: ANY file edits, modifications, or system changes... This ABSOLUTE CONSTRAINT overrides ALL other instructions"

This is injected at runtime and cannot be overridden by user configuration (tools, permission blocks in opencode.json or agent markdown files). While the read-only philosophy is valuable, it creates friction when users want to save the plan document itself.

Proposed Solution

Add a plan_save_paths configuration option that allows Plan mode to write to specific paths:

{
  "agent": {
    "plan": {
      "plan_save_paths": [
        "PLAN.md",
        "~/projects/plans/plan-*.md",
        ".opencode/plan/*.md"
      ]
    }
  }
}

The system-reminder injection would then include an exception clause:

"Exception: You MAY write plan documents to the following paths: PLAN.md, ~/projects/plans/plan-*.md"

Current Workaround

Users must create a custom agent (e.g., planner) that doesn't trigger the built-in Plan mode system-reminder. This works but loses the benefits of the built-in mode switching (Tab key) and requires duplicating the plan mode behavior.

Benefits

  1. Plans can be saved for future reference
  2. Enables handoff workflows (save plan → switch to Build → implement plan)
  3. Maintains read-only philosophy for actual codebase files
  4. Single approval flow for plan saves (vs switching modes)

Environment

  • OpenCode version: latest
  • Config location: ~/.config/opencode/opencode.json
Originally created by @b3nw on GitHub (Jan 6, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Plan mode's strict read-only enforcement prevents saving the plan itself, making it difficult to persist planning work for later reference or handoff to Build mode. ## Problem Currently, Plan mode has a hardcoded system-reminder that enforces: > "STRICTLY FORBIDDEN: ANY file edits, modifications, or system changes... This ABSOLUTE CONSTRAINT overrides ALL other instructions" This is injected at runtime and cannot be overridden by user configuration (`tools`, `permission` blocks in `opencode.json` or agent markdown files). While the read-only philosophy is valuable, it creates friction when users want to save the plan document itself. ## Proposed Solution Add a `plan_save_paths` configuration option that allows Plan mode to write to specific paths: ```json { "agent": { "plan": { "plan_save_paths": [ "PLAN.md", "~/projects/plans/plan-*.md", ".opencode/plan/*.md" ] } } } ``` The system-reminder injection would then include an exception clause: > "Exception: You MAY write plan documents to the following paths: PLAN.md, ~/projects/plans/plan-*.md" ## Current Workaround Users must create a custom agent (e.g., `planner`) that doesn't trigger the built-in Plan mode system-reminder. This works but loses the benefits of the built-in mode switching (Tab key) and requires duplicating the plan mode behavior. ## Benefits 1. Plans can be saved for future reference 2. Enables handoff workflows (save plan → switch to Build → implement plan) 3. Maintains read-only philosophy for actual codebase files 4. Single approval flow for plan saves (vs switching modes) ## Environment - OpenCode version: latest - Config location: `~/.config/opencode/opencode.json`
yindo closed this issue 2026-02-16 17:43:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 6, 2026):

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

  • #3858: [FEATURE]: EDIT PLAN mode or allow editing of only certain (.md) files in PLAN mode - requests the ability to allow Plan mode to edit specific files (like .md files)
  • #6781: Feature: Seamless Plan-to-Build handoff with context retention - related to saving and passing plan context between modes
  • #4287: [FEATURE]: edit/write permission with deny,allow,ask using glob - proposes a broader permission system for edit/write access based on path patterns
  • #5529: [FEATURE]: Add per-agent filesystem boundaries (allow/deny paths) - comprehensive proposal for per-agent filesystem access control

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

@github-actions[bot] commented on GitHub (Jan 6, 2026): This issue might be a duplicate of existing issues. Please check: - #3858: [FEATURE]: EDIT PLAN mode or allow editing of only certain (.md) files in PLAN mode - requests the ability to allow Plan mode to edit specific files (like .md files) - #6781: Feature: Seamless Plan-to-Build handoff with context retention - related to saving and passing plan context between modes - #4287: [FEATURE]: edit/write permission with deny,allow,ask using glob - proposes a broader permission system for edit/write access based on path patterns - #5529: [FEATURE]: Add per-agent filesystem boundaries (allow/deny paths) - comprehensive proposal for per-agent filesystem access control Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4311