Skip to content

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

Closed

Description

@devdoshi

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

Activity

  1. github-actions commented on Jan 27, 2026

    @github-actions
    Contributor

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

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

  2. cravenceiling commented on Jan 27, 2026

    @cravenceiling
    Contributor

    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.

  3. devdoshi commented on Jan 29, 2026

    @devdoshi
    Author

    @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

  4. stevoland commented on Jan 29, 2026

    @stevoland
    Contributor

    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

  5. jeremyakers commented on Jan 31, 2026

    @jeremyakers

    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?

  6. added a commit that references this issue on Feb 5, 2026
    fa1cb66
  7. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions