unable to write plan to .opencode/plans in plan mode #7769

Open
opened 2026-02-16 18:08:10 -05:00 by yindo · 5 comments
Owner

Originally created by @devdoshi on GitHub (Jan 27, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

based on https://opencode.ai/docs/modes

Plan
A restricted mode designed for planning and analysis. In plan mode, the following tools are disabled by default:

write - Cannot create new files
edit - Cannot modify existing files, except for files located at .opencode/plans/*.md to detail the plan itself
patch - Cannot apply patches
bash - Cannot execute shell commands
This mode is useful when you want the AI to analyze code, suggest changes, or create plans without making any actual modifications to your codebase.

However, all the models I tried actively resist modifying files even if I paste in the above excerpt.

Plugins

n/a

OpenCode version

1.1.36

Steps to reproduce

  1. run opencode in terminal
  2. choose local lm studio model (zai-org/glm-4.7-flash, google/gemma-3-27b, openai/gpt-oss-20b)
  3. choose plan mode
  4. tell it to write the plan to a file
  5. it won't

Screenshot and/or share link

No response

Operating System

macOS 15.6

Terminal

kitty

Originally created by @devdoshi on GitHub (Jan 27, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description based on https://opencode.ai/docs/modes > Plan > A restricted mode designed for planning and analysis. In plan mode, the following tools are disabled by default: > > write - Cannot create new files > edit - Cannot modify existing files, except for files located at .opencode/plans/*.md to detail the plan itself > patch - Cannot apply patches > bash - Cannot execute shell commands > This mode is useful when you want the AI to analyze code, suggest changes, or create plans without making any actual modifications to your codebase. However, all the models I tried actively resist modifying files even if I paste in the above excerpt. ### Plugins n/a ### OpenCode version 1.1.36 ### Steps to reproduce 1. run opencode in terminal 2. choose local lm studio model (zai-org/glm-4.7-flash, google/gemma-3-27b, openai/gpt-oss-20b) 3. choose plan mode 4. tell it to write the plan to a file 5. it won't ### Screenshot and/or share link _No response_ ### Operating System macOS 15.6 ### Terminal kitty
yindo added the bug label 2026-02-16 18:08:10 -05:00
Author
Owner

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

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

  • #10741: Changing files in plan mode - discusses the issue that models resist modifying files in plan mode

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

@github-actions[bot] commented on GitHub (Jan 27, 2026): This issue might be a duplicate of existing issues. Please check: - #10741: Changing files in plan mode - discusses the issue that models resist modifying files in plan mode Feel free to ignore if none of these address your specific case.
Author
Owner

@cravenceiling commented on GitHub (Jan 27, 2026):

I think there's a misunderstanding regarding plan mode. According to the docs, the plan mode cannot create any new files, and there's no built-in function to automatically create a plan.md file somewhere.

You could use a plugin like plannotator to save the plan.md files.

@cravenceiling commented on GitHub (Jan 27, 2026): I think there's a misunderstanding regarding plan mode. According to the docs, the plan mode cannot create any new files, and there's no built-in function to automatically create a `plan.md` file somewhere. You could use a plugin like `plannotator` to save the `plan.md` files.
Author
Owner

@devdoshi commented on GitHub (Jan 28, 2026):

@cravenceiling

ok so are you saying the docs should be updated to not say:

edit - Cannot modify existing files, except for files located at .opencode/plans/*.md to detail the plan itself

@devdoshi commented on GitHub (Jan 28, 2026): @cravenceiling ok so are you saying the docs should be updated to not say: > edit - Cannot modify existing files, except for files located at .opencode/plans/*.md to detail the plan itself
Author
Owner

@stevoland commented on GitHub (Jan 29, 2026):

Currently basic plan agent isn't designed to write files. You can enable this behaviour with OPENCODE_EXPERIMENTAL_PLAN_MODE=1 opencode and get a guided plan, write, handover experience that you might be expecting

@stevoland commented on GitHub (Jan 29, 2026): Currently basic plan agent isn't designed to write files. You can enable this behaviour with `OPENCODE_EXPERIMENTAL_PLAN_MODE=1 opencode` and get a guided plan, write, handover experience that you might be expecting
Author
Owner

@jeremyakers commented on GitHub (Jan 31, 2026):

You could use a plugin like plannotator to save the plan.md files.

I looked at this, this is massive overkill. I just want the agent to save the plan to a durable location so it's not lost as context fills up. That's the whole point of a "plan". If the plan isn't actually saved anywhere - what's the point of building a plan in plan mode if it's not being saved somewhere? As context grows the agent starts to become more and more fuzzy on those plan details stored in context, and eventually when compaction happens, those details are often lost. It's pretty important to save those details to a durable form of storage that the agent can always refer back to.

And clearly there was some intention of being able to write plans, otherwise why is .opencode/plans exempted from the no-write policy in plan mode?

OPENCODE_EXPERIMENTAL_PLAN_MODE=1 opencode

Sounds like what we want... How "experimental" is this exactly? Is it safe to use?

@jeremyakers commented on GitHub (Jan 31, 2026): > You could use a plugin like plannotator to save the plan.md files. I looked at this, this is massive overkill. I just want the agent to save the plan to a durable location so it's not lost as context fills up. That's the whole point of a "plan". If the plan isn't actually saved anywhere - what's the point of building a plan in plan mode if it's not being saved somewhere? As context grows the agent starts to become more and more fuzzy on those plan details stored in context, and eventually when compaction happens, those details are often lost. It's pretty important to save those details to a durable form of storage that the agent can always refer back to. And clearly there was some intention of being able to write plans, otherwise why is .opencode/plans exempted from the no-write policy in plan mode? > OPENCODE_EXPERIMENTAL_PLAN_MODE=1 opencode Sounds like what we want... How "experimental" is this exactly? Is it safe to use?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7769