Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/opencode/src/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ export namespace Session {
}

export function plan(input: { slug: string; time: { created: number } }) {
return path.join(Instance.worktree, ".opencode", "plans", [input.time.created, input.slug].join("-") + ".md")
// Use Instance.directory when worktree is "/" (non-git project) to avoid
// creating files at root directory (e.g., /.opencode/plans/...)
const base = Instance.worktree === "/" ? Instance.directory : Instance.worktree
return path.join(base, ".opencode", "plans", [input.time.created, input.slug].join("-") + ".md")
}

export const get = fn(Identifier.schema("session"), async (id) => {
Expand Down